]> source.dussan.org Git - poi.git/commitdiff
Gradle: Synchronize the code in the different build-scripts across the projects
authorDominik Stadler <centic@apache.org>
Thu, 15 Apr 2021 14:25:38 +0000 (14:25 +0000)
committerDominik Stadler <centic@apache.org>
Thu, 15 Apr 2021 14:25:38 +0000 (14:25 +0000)
No actual change in behavior expected
Mostly moved parts to make it easier to compare the build files with each other

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1888791 13f79535-47bb-0310-9956-ffa450edef68

poi-excelant/build.gradle
poi-integration/build.gradle
poi-ooxml/build.gradle
poi-scratchpad/build.gradle
poi/build.gradle

index 4c2b063f3270e5f103222e5e5c3fd90bb94d5e0e..5dea6d7b2d4a1386fab898f6f040ffe87481bcfb 100644 (file)
@@ -29,6 +29,10 @@ final String TEST9_SRC = 'src/test/java9'
 final String TEST9_OUT = "${buildDir}/classes/java9/test/"
 final String VERSIONS9 = 'META-INF/versions/9'
 
+configurations {
+       tests
+}
+
 sourceSets {
     main {
         if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
@@ -42,10 +46,6 @@ sourceSets {
     }
 }
 
-configurations {
-    tests
-}
-
 dependencies {
     api 'org.apache.ant:ant:1.10.9'
 
@@ -193,7 +193,7 @@ test {
             "-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}",
             '-Djunit.jupiter.execution.parallel.enabled=true',
             '-Djunit.jupiter.execution.parallel.config.strategy=fixed',
-            '-Djunit.jupiter.execution.parallel.config.fixed.parallelism=3',
+            '-Djunit.jupiter.execution.parallel.config.fixed.parallelism=3'
             // -Xjit:verbose={compileStart|compileEnd},vlog=build/jit.log${no.jit.sherlock}   ... if ${isIBMVM}
         ]
         if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
@@ -201,6 +201,7 @@ test {
                 '-Dsun.reflect.debugModuleAccessChecks=true',
                 '-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true',
                 '--illegal-access=warn',
+
                 '--add-modules', MODULE_NAME,
 
                 // see https://github.com/java9-modularity/gradle-modules-plugin/issues/97
index b4e72eba7865846f0d0d12f1e4833c66d8e79a64..0cf8087976181fc1a00546d80b203195b339b661 100644 (file)
@@ -21,6 +21,10 @@ final String TEST9_SRC = 'src/test/java9'
 final String TEST9_OUT = "${buildDir}/classes/java9/test/"
 final String VERSIONS9 = 'META-INF/versions/9'
 
+configurations {
+       tests
+}
+
 sourceSets {
     test {
         if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
@@ -29,11 +33,6 @@ sourceSets {
     }
 }
 
-configurations {
-    tests
-}
-
-
 dependencies {
     testImplementation 'org.apache.ant:ant:1.10.9'
     testImplementation 'org.apache.commons:commons-collections4:4.4'
@@ -86,7 +85,6 @@ task cacheTest9(type: Copy) {
     into(TEST9_SRC)
 }
 
-
 jar {
     destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
 
index 9f67a73103c90136c87bec75368968b8e3424e08..69884f7221859f0bbe76efaca9e27081e1fa8030 100644 (file)
@@ -29,6 +29,18 @@ final String TEST9_SRC = 'src/test/java9'
 final String TEST9_OUT = "${buildDir}/classes/java9/test/"
 final String VERSIONS9 = 'META-INF/versions/9'
 
+configurations {
+       all {
+               exclude group: 'xalan', module: 'xalan'
+               if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
+                       exclude group: 'xml-apis', module: 'xml-apis'
+               }
+       }
+       broken
+       tests
+    javadocs
+}
+
 sourceSets {
     main {
         if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
@@ -42,18 +54,6 @@ sourceSets {
     }
 }
 
-configurations {
-    all {
-        exclude group: 'xalan', module: 'xalan'
-        if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
-            exclude group: 'xml-apis', module: 'xml-apis'
-        }
-    }
-    broken
-    tests
-    javadocs
-}
-
 dependencies {
     api project(':poi')
     api project(':poi-ooxml-full')
@@ -192,7 +192,6 @@ task testJar(type: Jar, dependsOn: testClasses) {
     }
 }
 
-
 sourcesJar {
     destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
     exclude 'META-INF/services/**'
@@ -234,7 +233,7 @@ test {
     // for some reason catching the OOM does not work when run from Gradle
     exclude '**/MemoryUsage.class'
 
-    dependsOn 'testJar'
+    dependsOn { testJar }
 
     useJUnitPlatform()
 
index ca5c05bf4ce6d2f8cc8f04f9aa4834aa298971a9..693c913526e3503f6984cda085a3931c08ed61b8 100644 (file)
@@ -159,12 +159,29 @@ sourcesJar {
     exclude 'META-INF/services/**'
 }
 
+javadoc {
+       failOnError = true
+       doFirst {
+               options {
+                       if (JavaVersion.current().isJava9Compatible()) {
+                               addBooleanOption('html5', true)
+                       }
+                       links 'https://poi.apache.org/apidocs/dev/'
+                       links 'https://docs.oracle.com/javase/8/docs/api/'
+                       use = true
+                       splitIndex = true
+                       source = "1.8"
+                       classpath += configurations.javadocs.files
+               }
+       }
+}
+
 artifacts {
     tests testJar
 }
 
 test {
-    dependsOn 'testJar'
+    dependsOn { testJar }
 
     useJUnitPlatform()
 
@@ -181,7 +198,7 @@ test {
             '-ea',
             '-Djunit.jupiter.execution.parallel.enabled=true',
             '-Djunit.jupiter.execution.parallel.config.strategy=fixed',
-            '-Djunit.jupiter.execution.parallel.config.fixed.parallelism=3',
+            '-Djunit.jupiter.execution.parallel.config.fixed.parallelism=3'
             // -Xjit:verbose={compileStart|compileEnd},vlog=build/jit.log${no.jit.sherlock}   ... if ${isIBMVM}
         ]
         if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
@@ -205,23 +222,6 @@ test {
     }
 }
 
-javadoc {
-    failOnError = true
-    doFirst {
-        options {
-            if (JavaVersion.current().isJava9Compatible()) {
-                addBooleanOption('html5', true)
-            }
-            links 'https://poi.apache.org/apidocs/dev/'
-            links 'https://docs.oracle.com/javase/8/docs/api/'
-            use = true
-            splitIndex = true
-            source = "1.8"
-            classpath += configurations.javadocs.files
-        }
-    }
-}
-
 publishing {
     publications {
         POI(MavenPublication) {
index e6ee6bde48b49b1b5e9340df23d36be8efe152e9..b5423599c824a0188299beb49f546e288bc114d7 100644 (file)
@@ -77,7 +77,6 @@ java {
     withSourcesJar()
 }
 
-
 task compileJava9(type: JavaCompile) {
     dependsOn 'compileJava'
 
@@ -121,7 +120,6 @@ task cacheTest9(type: Copy) {
     into(TEST9_SRC)
 }
 
-
 jar {
     destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
 
@@ -163,8 +161,29 @@ sourcesJar {
     exclude 'META-INF/services/**'
 }
 
+javadoc {
+       failOnError = true
+       doFirst {
+               options {
+                       if (JavaVersion.current().isJava9Compatible()) {
+                               addBooleanOption('html5', true)
+                       }
+                       links 'https://poi.apache.org/apidocs/dev/'
+                       links 'https://docs.oracle.com/javase/8/docs/api/'
+                       use = true
+                       splitIndex = true
+                       source = "1.8"
+                       classpath += configurations.javadocs.files
+               }
+       }
+}
+
+artifacts {
+    tests testJar
+}
+
 test {
-    dependsOn 'testJar'
+    dependsOn { testJar }
 
     useJUnitPlatform()
 
@@ -191,6 +210,7 @@ test {
                 '--illegal-access=warn',
 
                 '--add-modules', MODULE_NAME,
+
                 // see https://github.com/java9-modularity/gradle-modules-plugin/issues/97
                 // opposed to the recommendation there, it doesn't work to add ... to the dependencies
                 // testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.7.1'
@@ -204,27 +224,6 @@ test {
     }
 }
 
-javadoc {
-    failOnError = true
-    doFirst {
-        options {
-            if (JavaVersion.current().isJava9Compatible()) {
-                addBooleanOption('html5', true)
-            }
-            links 'https://poi.apache.org/apidocs/dev/'
-            links 'https://docs.oracle.com/javase/8/docs/api/'
-            use = true
-            splitIndex = true
-            source = "1.8"
-            classpath += configurations.javadocs.files
-        }
-    }
-}
-
-artifacts {
-    tests testJar
-}
-
 publishing {
     publications {
         POI(MavenPublication) {