Details
-
Type:
Bug
-
Status:
Reopened
-
Resolution: Unresolved
-
Affects Version/s: 1.0-milestone-9
-
Fix Version/s: None
Description
Consider the following simple script:
build.gradle
apply plugin: 'java'
configurations {
all*.exclude group: 'commons-logging', module: 'commons-logging'
}
repositories {
mavenLocal()
}
dependencies {}
test {
useTestNG()
}
compileJava {
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
options.encoding = 'UTF-8'
options.compilerArgs = ['-Xlint', '-Xlint:-serial', '-Xlint:-path']
}
compileTestJava {
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
options.encoding = 'UTF-8'
options.compilerArgs = ['-Xlint', '-Xlint:-serial', '-Xlint:-path']
}
We're expecting to see language level '1.7' from org.gradle.tooling.model.idea.IdeaProject.getLanguageLevel() built against the script. Unfortunately, it always returns 1.6 (default value?).
Hey,
You should configure the compatibility outside of the tasks, i.e. as top-level elements of the build.gradle: