Commit e30e34f3 authored by akwizgran's avatar akwizgran

Include java.lang.invoke classes in bootstrap classpath.

parent fc93ced0
......@@ -38,10 +38,5 @@ artifacts {
// 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")
}
}
useJava6StandardLibrary(it)
}
......@@ -41,10 +41,5 @@ artifacts {
// 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")
}
}
useJava6StandardLibrary(it)
}
......@@ -8,10 +8,5 @@ dependencies {
// 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")
}
}
useJava6StandardLibrary(it)
}
......@@ -36,10 +36,5 @@ dependencyVerification {
// 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")
}
}
useJava6StandardLibrary(it)
}
......@@ -24,3 +24,27 @@ buildscript {
classpath files('libs/gradle-witness.jar')
}
}
// If a Java 6 JRE is available, check we're not using any Java 7 or 8 APIs
ext.useJava6StandardLibrary = { task ->
def home = System.env.JAVA_6_HOME;
if (home != null && !home.isEmpty()) {
println "Setting Java 6 bootstrap classpath for ${task.name}"
task.dependsOn createJavaLangInvokeJar
task.options.bootstrapClasspath = files(
"${project.rootDir}/build/invoke.jar",
"${home}/jre/lib/rt.jar",
"${home}/jre/lib/jsse.jar"
)
}
}
// Create a jar containing the java.lang.invoke classes for the Java 6 bootstrap classpath
task createJavaLangInvokeJar(type: Zip) {
archiveName 'invoke.jar'
destinationDir file("${project.rootDir}/build")
from zipTree("${System.getProperty('java.home')}/lib/rt.jar").matching {
include 'java/lang/invoke/*'
}
include '**/*'
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment