diqiu50 commented on code in PR #7877:
URL: https://github.com/apache/gravitino/pull/7877#discussion_r2276653130
##########
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:
The issue is that the `embedded` mode in integration tests depends on the
server and core modules. This causes all modules to require the target to be
set to JDK 8. To remove this requirement, the integration tests need to be
modified according to the approach @FANNG1 used previously.
--
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]