Lazy evaluate java9home (#33301)

This commit is contained in:
Alpar Torok 2018-08-31 16:36:57 +03:00 committed by GitHub
parent 0c4b3162be
commit a84a20844b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -211,7 +211,7 @@ class BuildPlugin implements Plugin<Project> {
project.rootProject.ext.minimumRuntimeVersion = minimumRuntimeVersion
project.rootProject.ext.inFipsJvm = inFipsJvm
project.rootProject.ext.gradleJavaVersion = JavaVersion.toVersion(gradleJavaVersion)
project.rootProject.ext.java9Home = findJavaHome("9")
project.rootProject.ext.java9Home = "${-> findJavaHome("9")}"
}
project.targetCompatibility = project.rootProject.ext.minimumRuntimeVersion

View File

@ -51,7 +51,8 @@ public class ForbiddenApisCliTask extends DefaultTask {
private JavaVersion targetCompatibility;
private FileCollection classesDirs;
private SourceSet sourceSet;
private String javaHome;
// This needs to be an object so it can hold Groovy GStrings
private Object javaHome;
@Input
public JavaVersion getTargetCompatibility() {
@ -142,11 +143,11 @@ public class ForbiddenApisCliTask extends DefaultTask {
}
@Input
public String getJavaHome() {
public Object getJavaHome() {
return javaHome;
}
public void setJavaHome(String javaHome) {
public void setJavaHome(Object javaHome) {
this.javaHome = javaHome;
}