gautamworah96 commented on a change in pull request #175:
URL: https://github.com/apache/lucene/pull/175#discussion_r647053364



##########
File path: gradle/testing/alternative-jdk-support.gradle
##########
@@ -18,60 +18,60 @@
 // This adds support for compiling and testing against a different Java 
runtime.
 // This is the only way to build against JVMs not yet supported by Gradle 
itself.
 
-JavaInstallationRegistry registry = 
extensions.getByType(JavaInstallationRegistry)
-
-JavaInstallation currentJvm = 
registry.installationForCurrentVirtualMachine.get()
-
-JavaInstallation altJvm = {
-  def runtimeJavaHome = propertyOrDefault("runtime.java.home", 
System.getenv('RUNTIME_JAVA_HOME'))
-  if (!runtimeJavaHome) {
-    return currentJvm
-  } else {
-    return registry.installationForDirectory(
-        layout.projectDirectory.dir(runtimeJavaHome)).get()
-  }
-}()
-
-// Set up root project's property.
-rootProject.ext.runtimeJava = altJvm
-rootProject.ext.runtimeJavaVersion = altJvm.javaVersion
-
-if (!currentJvm.javaExecutable.equals(altJvm.javaExecutable)) {
-  // Set up java toolchain tasks to use the alternative Java.
-  // This is a related Gradle issue for the future:
-  // https://github.com/gradle/gradle/issues/1652
-
-  configure(rootProject) {
-    task altJvmWarning() {
-      doFirst {
-        logger.warn("""NOTE: Alternative java toolchain will be used for 
compilation and tests:
-  Project will use Java ${altJvm.javaVersion} from: 
${altJvm.installationDirectory}
-  Gradle runs with Java ${currentJvm.javaVersion} from: 
${currentJvm.installationDirectory}
-""")
-      }
-    }
-  }
-
-  // Set up toolchain-dependent tasks to use the alternative JVM.
-  allprojects {
-    // Any tests
-    tasks.withType(Test) {
-      dependsOn ":altJvmWarning"
-      executable = altJvm.javaExecutable
-    }
-
-    // Any javac compilation tasks
-    tasks.withType(JavaCompile) {
-      dependsOn ":altJvmWarning"
-      options.fork = true
-      options.forkOptions.javaHome = altJvm.installationDirectory.asFile
-    }
-
-    // Javadoc compilation.
-    def javadocExecutable = altJvm.jdk.get().javadocExecutable.asFile
-    tasks.matching { it.name == "renderJavadoc" || it.name == 
"renderSiteJavadoc" }.all {
-      dependsOn ":altJvmWarning"
-      executable = javadocExecutable
-    }
-  }
-}
+//JavaInstallationRegistry registry = 
extensions.getByType(JavaInstallationRegistry)

Review comment:
       Sure.
   Gradle 7 has something similar to what we have already setup today i.e., 
using an env variable to send in the location of the JVM. I can get it running 
and then add instructions in lucene/help/jvms.txt, cleanup the comments in this 
file as well!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to