I'd like to make two proposals on how Java compilation could be improved,
based on experiences in the field.

1. First-class support for compiling with a specific JDK

Many people want to compile with a specific JDK. Currently the only way to
achieve this is to set `options.forkOptions.executable`. However, this means
that Gradle can't use the compiler daemon and has to fall back to the
command line compiler integration, which forks a new compiler for each
compile task and is dead slow.

Therefore I propose to add a `forkOptions.jdkHome` property that points to
the JDK used to run the compiler daemon. This will significantly speed up
compilation and will get more people off the command line compiler
integration.

2. Default to empty source path

Currently, Gradle inherits the javac behavior of defaulting the source path
to the compile class path. This causes problems as soon as Jars on the
compile class path contain sources, which isn't uncommon (`guava-gwt` being
just one example). Most people haven't even heard about source paths and
can't explain what's going on. While useful in some cases (e.g. Java-Groovy
joint compilation), source paths seem to be a mostly historic feature.

Therefore I propose to add an explicit `sourcepath` property that gets
defaulted to the empty source path. This makes source paths an opt-in rather
than an opt-out, solving a recurring pain for users.

Thoughts?

Cheers,
Peter



--
View this message in context: 
http://gradle.1045684.n5.nabble.com/Proposals-for-Java-compilation-improvements-tp5711609.html
Sent from the gradle-dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to