Created
April 26, 2019 03:49
-
-
Save rivergod/ee07014733d2f7ddd257c0210d349bac to your computer and use it in GitHub Desktop.
JDK fork per version - ~/.gradle/init.d/bootstrap.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| allprojects { | |
| afterEvaluate { | |
| def versions = [ | |
| '1.6' : "/usr/lib/jvm/zulu-6-amd64/jre/lib/", | |
| '1.7' : "/usr/lib/jvm/zulu-7-amd64/jre/lib/", | |
| '1.8' : "/usr/lib/jvm/zulu-8-amd64/jre/lib/" | |
| ] | |
| // convert map to classpaths | |
| versions = versions.collectEntries { key, value -> | |
| [key, fileTree(dir: value, include: "*.jar")] | |
| } | |
| def apply = { task -> | |
| if (versions.containsKey(task.targetCompatibility)) | |
| { | |
| task.options.fork = true; | |
| task.options.bootstrapClasspath = versions[task.targetCompatibility] | |
| } | |
| } | |
| tasks.withType(JavaCompile, apply) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment