Skip to content

Instantly share code, notes, and snippets.

@cpw
Forked from AbrarSyed/bootstrap.gradle
Last active April 27, 2017 19:36
Show Gist options
  • Save cpw/fe8a6ee27bde84d8731a to your computer and use it in GitHub Desktop.
Save cpw/fe8a6ee27bde84d8731a to your computer and use it in GitHub Desktop.
This makes gradle compile java6 stuff with the actual java 6 classpath. --- Usage: Drop this file in USER_HOME/.gradle/init.d --- You will probably want to change the path to your java6 instance.
allprojects {
afterEvaluate {
def versions = [
'1.6' : "/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/",
]
// convert map to classpaths
versions = versions.collectEntries { key, value ->
[key, fileTree(dir: value, include: "*.jar").getAsPath()]
}
def apply = { task ->
if (versions.containsKey(task.targetCompatibility))
{
task.options.fork = true;
task.options.bootClasspath = versions[task.targetCompatibility]
}
}
tasks.withType(JavaCompile, apply)
}
}
@cpw
Copy link
Author

cpw commented Oct 18, 2015

ALL DEBIAN ALL THE TIME!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment