Browse Source

Lazily compute Java 8 home in reindex configuration (#42630)

In the reindex from old tests we require Java 8. Today when configuring
the reindex from old tests, we eagerly evalulate Java 8 home, which
means that we require JAVA8_HOME to be set even if the reindex from old
test tasks are not in the task graph. This is an onerous requirement if,
for example, all that you want to do is build a distribution. This
commit addresses this by making evaluation of Java 8 home lazy, so that
it is only done and required if the reindex from old test tasks would be
executed.
Jason Tedor 6 years ago
parent
commit
7d28095970
1 changed files with 1 additions and 1 deletions
  1. 1 1
      modules/reindex/build.gradle

+ 1 - 1
modules/reindex/build.gradle

@@ -125,7 +125,7 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) {
       dependsOn unzip
       executable = new File(project.runtimeJavaHome, 'bin/java')
       env 'CLASSPATH', "${ -> project.configurations.oldesFixture.asPath }"
-      env 'JAVA_HOME', getJavaHome(it, 8)
+      env 'JAVA_HOME', "${ -> getJavaHome(it, 8)}"
       args 'oldes.OldElasticsearch',
            baseDir,
            unzip.temporaryDir,