Support Java 8 language features in Java modules.

This commit is contained in:
akwizgran
2017-11-15 16:46:15 +00:00
parent 53c8cf09b6
commit f8425658e4
6 changed files with 52 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
apply plugin: 'java'
sourceCompatibility = 1.6
targetCompatibility = 1.6
sourceCompatibility = 1.8
targetCompatibility = 1.8
apply plugin: 'net.ltgt.apt'
apply plugin: 'idea'
@@ -33,3 +33,13 @@ dependencyVerification {
'com.squareup.okio:okio:734269c3ebc5090e3b23566db558f421f0b4027277c79ad5d176b8ec168bb850',
]
}
// If a Java 6 JRE is available, check we're not using any Java 7 or 8 APIs
tasks.withType(JavaCompile) {
doFirst {
def home = System.env.JAVA_6_HOME;
if (home != null && !home.isEmpty()) {
options.bootstrapClasspath = files("${home}/jre/lib/rt.jar", "${home}/jre/lib/jsse.jar")
}
}
}