From edee60d87a0f3b6d54d056a8f63dd42a386eb593 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Sun, 25 Dec 2022 23:56:32 +0000 Subject: [PATCH] rebuild module-info.class files even if Java8 used git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1906207 13f79535-47bb-0310-9956-ffa450edef68 --- poi-examples/build.gradle | 10 +++------- poi-excelant/build.gradle | 16 ++++++---------- poi-integration/build.gradle | 8 +++----- poi-ooxml-full/build.gradle | 8 +++----- poi-ooxml-lite-agent/build.gradle | 8 +++----- poi-ooxml-lite/build.gradle | 8 +++----- poi-ooxml/build.gradle | 16 ++++++---------- poi-scratchpad/build.gradle | 16 ++++++---------- poi/build.gradle | 17 ++++++----------- poi/src/main/java9/module-info.class | Bin 3377 -> 3386 bytes poi/src/test/java9/module-info.class | Bin 4198 -> 4199 bytes 11 files changed, 39 insertions(+), 68 deletions(-) diff --git a/poi-examples/build.gradle b/poi-examples/build.gradle index 40101428ab..c6916d90ea 100644 --- a/poi-examples/build.gradle +++ b/poi-examples/build.gradle @@ -59,10 +59,11 @@ task compileJava9(type: JavaCompile) { dependsOn 'compileJava', ':poi-ooxml:jar', ':poi-scratchpad:jar' javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(jdkVersion) + languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion)) if (jdkVendor != '') vendor = JvmVendorSpec.matching(jdkVendor) } - + sourceCompatibility = 1.9 + targetCompatibility = 1.9 destinationDirectory = file(JAVA9_OUT + VERSIONS9) source = file(JAVA9_SRC) classpath = files() @@ -70,11 +71,6 @@ task compileJava9(type: JavaCompile) { '--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}", '--module-path', files(MODULE_COMPILE_PATH).asPath ] - - - onlyIf { - jdkVersion > 8 - } } task cacheJava9(type: Copy) { diff --git a/poi-excelant/build.gradle b/poi-excelant/build.gradle index 3d72c8dcbd..aa67f1f13d 100644 --- a/poi-excelant/build.gradle +++ b/poi-excelant/build.gradle @@ -69,9 +69,11 @@ task compileJava9(type: JavaCompile) { dependsOn 'compileJava', ':poi-ooxml:jar', ':poi-scratchpad:jar' javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(jdkVersion) + languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion)) if (jdkVendor != '') vendor = JvmVendorSpec.matching(jdkVendor) } + sourceCompatibility = 1.9 + targetCompatibility = 1.9 destinationDirectory = file(JAVA9_OUT + VERSIONS9) source = file(JAVA9_SRC) classpath = files() @@ -79,10 +81,6 @@ task compileJava9(type: JavaCompile) { '--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}", '--module-path', files(MAIN_MODULE_PATH).asPath ] - - onlyIf { - jdkVersion > 8 - } } task cacheJava9(type: Copy) { @@ -96,9 +94,11 @@ task compileTest9(type: JavaCompile) { dependsOn 'compileTestJava', ':poi-ooxml:jar', ':poi-scratchpad:jar' javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(jdkVersion) + languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion)) if (jdkVendor != '') vendor = JvmVendorSpec.matching(jdkVendor) } + sourceCompatibility = 1.9 + targetCompatibility = 1.9 destinationDirectory = file(TEST9_OUT + VERSIONS9) source = file(TEST9_SRC) options.compilerArgs = [ @@ -106,10 +106,6 @@ task compileTest9(type: JavaCompile) { '--module-path', files(TEST_MODULE_PATH).asPath ] classpath = files() - - onlyIf { - jdkVersion > 8 - } } diff --git a/poi-integration/build.gradle b/poi-integration/build.gradle index 4509fe4f12..4defe90224 100644 --- a/poi-integration/build.gradle +++ b/poi-integration/build.gradle @@ -107,9 +107,11 @@ task compileTest9(type: JavaCompile) { dependsOn 'compileTestJava', ':poi-ooxml:testJar', ':poi-scratchpad:testJar', ':poi-examples:jar' javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(jdkVersion) + languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion)) if (jdkVendor != '') vendor = JvmVendorSpec.matching(jdkVendor) } + sourceCompatibility = 1.9 + targetCompatibility = 1.9 destinationDirectory = file(TEST9_OUT + VERSIONS9) source = file(TEST9_SRC) options.compilerArgs = [ @@ -117,10 +119,6 @@ task compileTest9(type: JavaCompile) { '--module-path', files(MODULE_COMPILE_PATH).asPath ] classpath = files() - - onlyIf { - jdkVersion > 8 - } } diff --git a/poi-ooxml-full/build.gradle b/poi-ooxml-full/build.gradle index 4f857994c0..4a29e38d3f 100644 --- a/poi-ooxml-full/build.gradle +++ b/poi-ooxml-full/build.gradle @@ -60,9 +60,11 @@ task compileJava9(type: JavaCompile) { dependsOn 'compileJava' javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(jdkVersion) + languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion)) if (jdkVendor != '') vendor = JvmVendorSpec.matching(jdkVendor) } + sourceCompatibility = 1.9 + targetCompatibility = 1.9 destinationDirectory = file(JAVA9_OUT + VERSIONS9) source = file(JAVA9_SRC) classpath = files() @@ -70,10 +72,6 @@ task compileJava9(type: JavaCompile) { '--patch-module', "${MODULE_NAME}=${sourceSets.main.output.asPath}", '--module-path', files(MAIN_MODULE_PATH).asPath ] - - onlyIf { - jdkVersion > 8 - } } task cacheJava9(type: Copy) { diff --git a/poi-ooxml-lite-agent/build.gradle b/poi-ooxml-lite-agent/build.gradle index 168caf8bf3..45fcb762d8 100644 --- a/poi-ooxml-lite-agent/build.gradle +++ b/poi-ooxml-lite-agent/build.gradle @@ -42,9 +42,11 @@ task compileJava9(type: JavaCompile) { dependsOn 'compileJava' javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(jdkVersion) + languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion)) if (jdkVendor != '') vendor = JvmVendorSpec.matching(jdkVendor) } + sourceCompatibility = 1.9 + targetCompatibility = 1.9 destinationDirectory = file(JAVA9_OUT + VERSIONS9) source = file(JAVA9_SRC) classpath = files() @@ -54,10 +56,6 @@ task compileJava9(type: JavaCompile) { '--module-path', sourceSets.main.compileClasspath.asPath ] } - - onlyIf { - jdkVersion > 8 - } } task cacheJava9(type: Copy) { diff --git a/poi-ooxml-lite/build.gradle b/poi-ooxml-lite/build.gradle index c329ebd34e..4603810c77 100644 --- a/poi-ooxml-lite/build.gradle +++ b/poi-ooxml-lite/build.gradle @@ -101,9 +101,11 @@ sourcesJar.dependsOn 'compileOoxmlLite' task compileJava9(type: JavaCompile, dependsOn: 'compileJava') { javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(jdkVersion) + languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion)) if (jdkVendor != '') vendor = JvmVendorSpec.matching(jdkVendor) } + sourceCompatibility = 1.9 + targetCompatibility = 1.9 destinationDirectory = file(JAVA9_OUT + VERSIONS9) source = file(JAVA9_SRC) classpath = files() @@ -113,10 +115,6 @@ task compileJava9(type: JavaCompile, dependsOn: 'compileJava') { '--module-path', files(MAIN_MODULE_PATH).asPath ] } - - onlyIf { - jdkVersion > 8 - } } task cacheJava9(type: Copy, dependsOn: 'compileJava9') { diff --git a/poi-ooxml/build.gradle b/poi-ooxml/build.gradle index 037dd59c05..e92d7e2534 100644 --- a/poi-ooxml/build.gradle +++ b/poi-ooxml/build.gradle @@ -180,9 +180,11 @@ task compileJava9(type: JavaCompile) { dependsOn 'compileJava', ':poi:jar' javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(jdkVersion) + languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion)) if (jdkVendor != '') vendor = JvmVendorSpec.matching(jdkVendor) } + sourceCompatibility = 1.9 + targetCompatibility = 1.9 destinationDirectory = file(JAVA9_OUT + VERSIONS9) source = file(JAVA9_SRC) classpath = files() @@ -190,10 +192,6 @@ task compileJava9(type: JavaCompile) { '--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}", '--module-path', files(MAIN_MODULE_PATH).asPath ] - - onlyIf { - jdkVersion > 8 - } } task cacheJava9(type: Copy) { @@ -207,9 +205,11 @@ task compileTest9(type: JavaCompile) { dependsOn 'compileTestJava', ':poi:testJar' javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(jdkVersion) + languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion)) if (jdkVendor != '') vendor = JvmVendorSpec.matching(jdkVendor) } + sourceCompatibility = 1.9 + targetCompatibility = 1.9 destinationDirectory = file(TEST9_OUT + VERSIONS9) source = file(TEST9_SRC) options.compilerArgs = [ @@ -217,10 +217,6 @@ task compileTest9(type: JavaCompile) { '--module-path', files(TEST_MODULE_PATH).asPath ] classpath = files() - - onlyIf { - jdkVersion > 8 - } } diff --git a/poi-scratchpad/build.gradle b/poi-scratchpad/build.gradle index 7e53bba708..baa3875d80 100644 --- a/poi-scratchpad/build.gradle +++ b/poi-scratchpad/build.gradle @@ -65,9 +65,11 @@ task compileJava9(type: JavaCompile) { dependsOn 'compileJava', ':poi:jar' javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(jdkVersion) + languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion)) if (jdkVendor != '') vendor = JvmVendorSpec.matching(jdkVendor) } + sourceCompatibility = 1.9 + targetCompatibility = 1.9 destinationDirectory = file(JAVA9_OUT + VERSIONS9) source = file(JAVA9_SRC) classpath = files() @@ -75,10 +77,6 @@ task compileJava9(type: JavaCompile) { '--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}", '--module-path', files(MAIN_MODULE_PATH).asPath ] - - onlyIf { - jdkVersion > 8 - } } task cacheJava9(type: Copy) { @@ -92,9 +90,11 @@ task compileTest9(type: JavaCompile) { dependsOn 'compileTestJava', ':poi:jar' javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(jdkVersion) + languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion)) if (jdkVendor != '') vendor = JvmVendorSpec.matching(jdkVendor) } + sourceCompatibility = 1.9 + targetCompatibility = 1.9 destinationDirectory = file(TEST9_OUT + VERSIONS9) source = file(TEST9_SRC) options.compilerArgs = [ @@ -102,10 +102,6 @@ task compileTest9(type: JavaCompile) { '--module-path', files(TEST_MODULE_PATH).asPath ] classpath = files() - - onlyIf { - jdkVersion > 8 - } } diff --git a/poi/build.gradle b/poi/build.gradle index b411b99dc5..6bf2fa7180 100644 --- a/poi/build.gradle +++ b/poi/build.gradle @@ -94,9 +94,11 @@ task compileJava9(type: JavaCompile) { dependsOn 'compileJava' javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(jdkVersion) + languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion)) if (jdkVendor != '') vendor = JvmVendorSpec.matching(jdkVendor) } + sourceCompatibility = 1.9 + targetCompatibility = 1.9 destinationDirectory = file(JAVA9_OUT + VERSIONS9) source = file(JAVA9_SRC) classpath = files() @@ -104,10 +106,6 @@ task compileJava9(type: JavaCompile) { '--patch-module', "${MODULE_NAME}=${sourceSets.main.output.classesDirs.asPath}", '--module-path', sourceSets.main.compileClasspath.asPath ] - - onlyIf { - jdkVersion > 8 - } } task cacheJava9(type: Copy) { @@ -121,10 +119,11 @@ task compileTest9(type: JavaCompile) { dependsOn 'compileTestJava' javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(jdkVersion) + languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion)) if (jdkVendor != '') vendor = JvmVendorSpec.matching(jdkVendor) } - + sourceCompatibility = 1.9 + targetCompatibility = 1.9 destinationDirectory = file(TEST9_OUT + VERSIONS9) source = file(TEST9_SRC) options.compilerArgs = [ @@ -132,10 +131,6 @@ task compileTest9(type: JavaCompile) { '--module-path', files(MODULE_PATH).asPath ] classpath = files() - - onlyIf { - jdkVersion > 8 - } } diff --git a/poi/src/main/java9/module-info.class b/poi/src/main/java9/module-info.class index 3958dff10e55932ee2abfcb14ef29778227b57f1..a0332da1c11c6fdacf04d601a3fc1469738a9a8d 100644 GIT binary patch delta 168 zcmW-aISK+%5C!X_*r2%43Sw>~3^R&|kw7D1UtdtXit3RM z^6~d4cmWme!f+cex+7(55YKa5$Ezw6Wva}Sxw24}hDgcrYL2U{l(lZx&s>JRa1f5d xNjM7^;VRtxvS~!K36i!Tr2b6*S@(CbjVUy({1&D~n+{z<_8EHC41Mc{!51~q9LN9w delta 159 zcmW-ZISRs16h+TR;eiqdo;Iqa3R@&I9p1(ATGc~iJvs*+|%61 zeYwu}7kz*RPhlK5)yhPf8pQX#n&;P*nKD-v%2HV=Yh|Nsm0cm&zl*|2I13lyD%^y- q@Ccixohm`b9t+u+xtJ~T)`Z9O!IU9Mhb}$(BL#8l8mM}xMFhdR_1G}M~ VAxK=9A(xSX)l?6tU}N12egO4h4c-6% delta 68 zcmaE^@JwNXtEGW3Ly9m%sxU*EFhja9Lk1%Qn~|QOxt^ggL#8l8mM}xMFhdSd&`{6N WNY7lDA(xSX)l|