On 12/11/2010, at 3:17 AM, richardm wrote: > > Hi, > > I'm using Gradle 0.9-rc-1 and I have set the sourceCompatibility to 1.6 as > follows: > > allprojects { > sourceCompatibility = 1.6 > targetCompatibility = 1.6 > }
You need to set these after the java plugin has been applied to each project, otherwise these values get ignored. Gradle could certainly behave better in this situation, either by allowing you to set the properties before the plugin has been applied, or giving you an error message telling you that they won't have any effect. > > When I run gradle -d build I can see the ant javac task is called with > -target=1.5. The correct jdk is being used, but why is the ant javac task > called with target=1.5, source=1.5? I've tried setting the > sourceCompatibility and targetCompatibility in subprojects but get the same > results. > > 16:10:03.297 [main] DEBUG o.g.a.i.t.compile.AntJavaCompiler - Running ant > javac with the following options {includeAntRuntime=false, > destdir=D:\workspace\gui\build\classes\main, classpathref=compile.classpath, > sourcepath=, target=1.5, source=1.5, failonerror=true, verbose=false, > listfiles=false, deprecation=false, nowarn=false, optimize=false, > debug=true, fork=false, includeJavaRuntime=false} > -- > View this message in context: > http://gradle.1045684.n5.nabble.com/sourceCompatibility-appears-to-get-ignored-tp3260565p3260565.html > Sent from the gradle-user mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > -- Adam Murdoch Gradle Developer http://www.gradle.org CTO, Gradle Inc. - Gradle Training, Support, Consulting http://www.gradle.biz