Community
Participate
Working Groups
Currently, to get Ant scripts to compile from within Eclipse, the user has to manually map the Ant 'build.compiler' variable to the Eclipse compiler adapter (which can be done in a number of ways). Could we instead have a setting to do this automatically (and for the love of all that's holy, make it default to true). Sincerely, Someone-who-can't-take-directing-yet-another- person-to-the-Eclpse-Wiki-to-explain-this.
Currently Ant knows nothing about our compiler adapter. However, the setting approach is tempting if doable. CC'ing Rodrigo for comment.
I think this has to be done throught the ant support and not in JDT/Core. Move to Platform/Core.
It is an interesting suggestion but the implementation might be tricky. Since Ant Core does not depend on JDT Core we can't set that automatically. One alternative would be to provide an extension point where a plug-in could set a property before every script run. In this case JDT Core (or the External Tools - probably the best place) would provide the setting to define the JDT compiler to be the default. Also, we have to be *very* careful when setting the JDT compiler to be the default compiler and I believe we should *only* do that if we can't find tools.jar since the Ant behaviour (and what Ant users are used to) is to use javac as the default compiler.
I agree that the best place for such an option is the "External tools" support. I also agree that the Eclipse compiler should not be the default value. Having an option to change the default compiler is good enough. The default option has to be the one expected by the majority of Ant users. We should document as well that switching compilers might have an impact on the size of the generated .class files.
Current solution: Global properties and global property files can be specified. There is no extension point for plugins (yet ;-) ) but this would allow Eclipse users to easily set the build.compiler property to the JDTCompilerAdapter: build.compiler= org.eclipse.jdt.core.JDTCompilerAdapter See bug 25698 and bug 25699. As well plain old javac works with tools.jar on the Ant classpath (which is done by default).