This is an automated email from the ASF dual-hosted git repository.

emilles pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 5ac33ade3f GROOVY-11666: `groovyc`: add to classpath for incremental 
compilation
5ac33ade3f is described below

commit 5ac33ade3f77a281ec57c8469d4a5979a08f1c50
Author: Eric Milles <[email protected]>
AuthorDate: Thu Jul 17 16:45:10 2025 -0500

    GROOVY-11666: `groovyc`: add to classpath for incremental compilation
---
 .../groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovyc.java | 3 +++
 .../src/test-resources/org/codehaus/groovy/ant/GroovycTest.xml    | 8 ++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git 
a/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovyc.java 
b/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovyc.java
index ae21dccf40..d26bc3041d 100644
--- a/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovyc.java
+++ b/subprojects/groovy-ant/src/main/java/org/codehaus/groovy/ant/Groovyc.java
@@ -1325,6 +1325,9 @@ public class Groovyc extends MatchingTask {
             List<String> jointOptions = extractJointOptions(classpath);
             List<String> commandLineList = new ArrayList<>();
 
+            // GROOVY-11666: add target directory to classpath for incremental 
compilation
+            if (destDir != null && isIncludeDestClasses()) 
classpath.setLocation(destDir);
+
             if (fork) doForkCommandLineList(commandLineList, classpath, 
File.separator);
             doNormalCommandLineList(commandLineList, jointOptions, classpath);
             addSourceFiles(commandLineList);
diff --git 
a/subprojects/groovy-ant/src/test-resources/org/codehaus/groovy/ant/GroovycTest.xml
 
b/subprojects/groovy-ant/src/test-resources/org/codehaus/groovy/ant/GroovycTest.xml
index 1461b83cb7..73ceffbccb 100644
--- 
a/subprojects/groovy-ant/src/test-resources/org/codehaus/groovy/ant/GroovycTest.xml
+++ 
b/subprojects/groovy-ant/src/test-resources/org/codehaus/groovy/ant/GroovycTest.xml
@@ -163,7 +163,7 @@
     </target>
 
     <target name="noForkNoAntRuntime">
-        <compile-plain includes="**/GroovycTest1.groovy" fork="false" 
includeAntRuntime="false"/>
+        <compile-plain includes="**/GroovycTest1.groovy" fork="false" 
includeantruntime="false"/>
     </target>
 
     <!-- GROOVY-9197 -->
@@ -202,16 +202,16 @@
 
     <!-- GROOVY-11666 -->
     <target name="incrementalCompilation">
-        <compile-plain includes="**/GroovycTest3*.groovy"/>
+        <compile-plain includes="**/GroovycTest3*.groovy" fork="true" 
includeantruntime="false"/>
 
         <local name="boo"/>
-        <compile-plain includes="**/GroovycTest3.groovy" 
updatedProperty="boo"/>
+        <compile-plain includes="**/GroovycTest3.groovy" fork="true" 
includeantruntime="false" updatedProperty="boo"/>
         <fail if="boo" message="GroovycTest3.groovy was re-compiled"/>
 
         <touch file="GroovycTest3.groovy"/>
 
         <local name="yay"/>
-        <compile-plain includes="**/GroovycTest3.groovy" 
updatedProperty="yay"/>
+        <compile-plain includes="**/GroovycTest3.groovy" fork="true" 
includeantruntime="false" updatedProperty="yay"/>
         <fail unless="yay" message="GroovycTest3.groovy was not re-compiled"/>
 
         <java classname="org.codehaus.groovy.ant.GroovycTest3"/>

Reply via email to