On Sat, Jun 7, 2014 at 11:28 PM, Adam Murdoch <adam.murd...@gradleware.com> wrote:
> > On 7 Jun 2014, at 9:41 am, Thomas Broyer <t.bro...@gmail.com> wrote: > > Hi, > > I'd like to work on GRADLE-3085 [1] and would like guidance on how to > proceed: > > * how to configure the javax.tool.JavaCompiler to use in the DSL > * how to implement it > * how to test it > > Looking at the current code, I think Gradle could expose some kind of > JavaCompilerProvider on the JavaCompile task or its CompileOptions: > > interface JavaCompilerProvider { > javax.tool.JavaCompiler getJavaCompiler(); > } > > > I think what we want to do here is model the Java compiler as a toolchain, > similar to what we’re doing for the native C/C++ languages. > > A toolchain is essentially just a factory for tools that do some work - > the java compiler in this instance. There would be a few different > implementations - one that uses the compiler from the current jdk, and one > that uses an installed jdk. There can then also be other implementations: > one that uses error_prone, one that uses the Eclipse compiler, one that > uses the aspectj compiler, and so on. > > A project would have a set of available java toolchains, from which the > build author can select a particular implementation. Each JavaCompile task > (and GroovyCompile and ScalaCompile task for joint compilation) would have > an associated toolchain instance. There should also be a project level > default toolchain. > Sounds great! When do you think it'd be ready? I'm almost ready to submit a pull request for what I proposed; so it could possibly be used in the mean time, if you think it's worth it. If I can help in any way, I'll gladly do (at the very least, I'll try to test it as soon as it's available) -- Thomas Broyer /tɔ.ma.bʁwa.je/ <http://xn--nna.ma.xn--bwa-xxb.je/>