Lazy evaluate java9home (#33301)
This commit is contained in:
parent
0c4b3162be
commit
a84a20844b
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue