[GRADLE-323] compile.options.fork = false has no effect on Groovy compilation Created: 16/Dec/08  Updated: 04/Jan/13  Resolved: 22/Dec/08

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 0.6

Type: Bug
Reporter: Peter Niederwieser Assignee: Hans Dockter
Resolution: Not A Bug Votes: 0


 Description   

compile.options.fork = false doesn't prevent forking of the Groovy compiler. See transcript below.

/swd/prj/gradletest> gradle -version

----------------------------------------
Gradle 0.6-20081216210743+0100
----------------------------------------

Gradle buildtime: Tuesday, December 16, 2008 9:07:43 PM CET
Groovy: 1.5.6
Ant: Apache Ant version 1.7.0 compiled on December 13 2006
Ivy: 2.0.0-rc2
Java: 1.5.0_16
JVM: 1.5.0_16-133
JVM Vendor: Apple Inc.
OS Name: Mac OS X

/swd/prj/gradletest> ls
build build.gradle src

/swd/prj/gradletest> cat build.gradle
usePlugin("groovy")
sourceCompatibility = 1.5
targetCompatibility = 1.5

dependencies {
addFlatDirResolver "lib", new File("/swd/src/groovy/target/install/embeddable") // Groovy 1.6-RC-1-SNAPSHOT rev. 14452
compile ":groovy-all:1.6-RC-1-SNAPSHOT"
}

compile.options.fork = false

/swd/prj/gradletest> cat src/main/groovy/HelloWorld.groovy
class HelloWorld {
static void main(args)

{ I won't compile! }

}

/swd/prj/gradletest> gradle compile
:init
:resources
:compile
Exception in thread "main" java.lang.NoSuchMethodError: main // we already know that Gradle's forked compilation isn't yet compatible with Groovy 1.6, but why does it fork in the first place?

Build failed with an exception.
Run with -s or -d option to get more details. Run with -f option to get the full (very verbose) stacktrace.

Build file '/swd/prj/gradletest/build.gradle'

Execution failed for task :compile.
Cause: Forked groovyc returned error code: 1

BUILD FAILED

Total time: 4.148 secs



 Comments   
Comment by Peter Niederwieser [ 16/Dec/08 ]

Should have been "Affects version 0.6" instead of "Fix version 0.6".

Comment by Hans Dockter [ 18/Dec/08 ]

Sorry, Peter, I have given you the wrong advise in my mail.

{{ compile.groovyOptions.fork = false }} should do the job.

If you need it for both compiles you might do: {{ [compile, testCompile].groovyOptions.fork = false }}

compile.options is for setting the javac options (in case of joint compilation the fork setting would be ignored and only the groovyOptions fork would be taken into consideration).

Comment by Hans Dockter [ 18/Dec/08 ]

If the above works for you I will close the issue. Please let me know.

Generated at Wed Jun 30 11:27:15 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.