diqiu50 commented on code in PR #7877:
URL: https://github.com/apache/gravitino/pull/7877#discussion_r2271873171
##########
build.gradle.kts:
##########
@@ -273,19 +259,78 @@ subprojects {
mavenLocal()
}
+ fun CompatibleWithJDK8(project: Project): Boolean {
+ val name = project.name.lowercase()
+ val path = project.path.lowercase()
+
+ if (path.startsWith(":client") ||
+ path.startsWith(":spark-connector") ||
+ path.startsWith(":flink-connector") ||
+ path.startsWith(":bundles")
+ ) {
+ return true
+ }
+
+ if (name == "api" || name == "common" ||
+ name == "catalog-common" || name == "hadoop-common"
+ ) {
+ return true
+ }
+
+ return false
+ }
+
+ tasks.register("printJvm") {
+ group = "help"
+ description = "print JVM information"
+
+ doLast {
+
+ val compileJvmVersion =
tasks.withType<JavaCompile>().firstOrNull()?.javaCompiler?.get()
+ ?.metadata?.languageVersion?.asInt() ?: "undefined"
+
+ val testJvmVersion =
tasks.withType<Test>().firstOrNull()?.javaLauncher?.get()
+ ?.metadata?.languageVersion?.asInt() ?: "undefined"
+
+ val testJvmArgs = tasks.withType<Test>().firstOrNull()?.jvmArgs ?:
listOf()
+
+ val targetJvmVersion = (java.targetCompatibility?.majorVersion ?:
"undefined")
+
+ val sourceJvmVersion = (java.sourceCompatibility?.majorVersion ?:
"undefined")
+
+ println(
+ """
+ |=== ${project.name} JVM information===
+ | project path: ${project.path}
+ | JVM for compile: $compileJvmVersion
+ | JVM for test: $testJvmVersion
+ | JVM test args: $testJvmArgs
+ | target JVM version: $targetJvmVersion
+ | source JVM version: $sourceJvmVersion
+ |==================================
+ """.trimMargin()
+ )
+ }
+ }
+
java {
toolchain {
// Some JDK vendors like Homebrew installed OpenJDK 17 have problems in
building trino-connector:
// It will cause tests of Trino-connector hanging forever on macOS, to
avoid this issue and
// other vendor-related problems, Gravitino will use the specified
AMAZON OpenJDK 17 to build
// Trino-connector on macOS.
+ val clientCompatibleWithJDK8 =
project.hasProperty("clientCompatibleWithJDK8")
if (project.name == "trino-connector") {
if (OperatingSystem.current().isMacOsX) {
vendor.set(JvmVendorSpec.AMAZON)
}
languageVersion.set(JavaLanguageVersion.of(17))
+ } else if (clientCompatibleWithJDK8 && CompatibleWithJDK8(project)) {
Review Comment:
Yes, in clientCompatibleWithJDK8 mode, integration tests for some modules
cannot be compiled. This option can be removed once the issue is resolved,
making JDK 8 compatibility the default behavior for the client module.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]