From 41ff8bb20c9b1b127968becda2c67fad812e7015 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Thu, 13 May 2021 12:11:35 +0000 Subject: [PATCH] Start moving some bits to the main Gradle file Use a common definition of some constants Gradle plugins are in the main file already anyway git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1889839 13f79535-47bb-0310-9956-ffa450edef68 --- build.gradle | 8 +++++++- poi-examples/build.gradle | 10 ---------- poi-excelant/build.gradle | 12 ------------ poi-ooxml-full/build.gradle | 10 ---------- poi-ooxml-lite-agent/build.gradle | 10 ---------- poi-ooxml-lite/build.gradle | 9 --------- poi-ooxml/build.gradle | 12 ------------ poi-scratchpad/build.gradle | 12 ------------ poi/build.gradle | 12 ------------ 9 files changed, 7 insertions(+), 88 deletions(-) diff --git a/build.gradle b/build.gradle index 485313ff61..2ee40a3092 100644 --- a/build.gradle +++ b/build.gradle @@ -81,7 +81,7 @@ wrapper.finalizedBy adjustWrapperPropertiesFile */ allprojects { // apply plugin: 'eclipse' - apply plugin: 'idea' + apply plugin: 'idea' } /** @@ -107,6 +107,12 @@ subprojects { hamcrestVersion = '2.2' xmlbeansVersion = '5.0.0' batikVersion = '1.14' + + JAVA9_SRC = 'src/main/java9' + JAVA9_OUT = "${buildDir}/classes/java9/main/" + TEST9_SRC = 'src/test/java9' + TEST9_OUT = "${buildDir}/classes/java9/test/" + VERSIONS9 = 'META-INF/versions/9' } tasks.withType(JavaCompile) { diff --git a/poi-examples/build.gradle b/poi-examples/build.gradle index 8a2b26f717..21bb62e598 100644 --- a/poi-examples/build.gradle +++ b/poi-examples/build.gradle @@ -17,16 +17,6 @@ import java.util.regex.Pattern -plugins { - id 'java' - id 'maven-publish' - id 'java-library' -} - -final String JAVA9_SRC = 'src/main/java9' -final String JAVA9_OUT = "${buildDir}/classes/java9/main/" -final String VERSIONS9 = 'META-INF/versions/9' - sourceSets { main { if (JavaVersion.current() != JavaVersion.VERSION_1_8) { diff --git a/poi-excelant/build.gradle b/poi-excelant/build.gradle index 5dea6d7b2d..7d31dc74bc 100644 --- a/poi-excelant/build.gradle +++ b/poi-excelant/build.gradle @@ -17,18 +17,6 @@ import java.util.regex.Pattern -plugins { - id 'java' - id 'maven-publish' - id 'java-library' -} - -final String JAVA9_SRC = 'src/main/java9' -final String JAVA9_OUT = "${buildDir}/classes/java9/main/" -final String TEST9_SRC = 'src/test/java9' -final String TEST9_OUT = "${buildDir}/classes/java9/test/" -final String VERSIONS9 = 'META-INF/versions/9' - configurations { tests } diff --git a/poi-ooxml-full/build.gradle b/poi-ooxml-full/build.gradle index d79da73deb..ea1804a30b 100644 --- a/poi-ooxml-full/build.gradle +++ b/poi-ooxml-full/build.gradle @@ -17,17 +17,7 @@ import java.util.regex.Pattern limitations under the License. ==================================================================== */ - -plugins { - id 'java' - id 'maven-publish' - id 'java-library' -} - final String MODULE_NAME = 'org.apache.poi.ooxml.schemas' -final String JAVA9_SRC = 'src/main/java9' -final String JAVA9_OUT = "${buildDir}/classes/java9/main/" -final String VERSIONS9 = 'META-INF/versions/9' final String BEANS_SRC = "${buildDir}/generated-sources" final String BEANS_RES = "${buildDir}/generated-resources" diff --git a/poi-ooxml-lite-agent/build.gradle b/poi-ooxml-lite-agent/build.gradle index 7b9204c8f3..fc0cf7b2df 100644 --- a/poi-ooxml-lite-agent/build.gradle +++ b/poi-ooxml-lite-agent/build.gradle @@ -15,16 +15,6 @@ limitations under the License. ==================================================================== */ -plugins { - id 'java' - id 'maven-publish' - id 'java-library' -} - -final String JAVA9_SRC = 'src/main/java9' -final String JAVA9_OUT = "${buildDir}/classes/java9/main/" -final String VERSIONS9 = 'META-INF/versions/9' - sourceSets { main { if (JavaVersion.current() != JavaVersion.VERSION_1_8) { diff --git a/poi-ooxml-lite/build.gradle b/poi-ooxml-lite/build.gradle index 8dd452f5eb..485f572c62 100644 --- a/poi-ooxml-lite/build.gradle +++ b/poi-ooxml-lite/build.gradle @@ -19,15 +19,6 @@ import java.util.stream.Collectors limitations under the License. ==================================================================== */ -plugins { - id 'java' - id 'maven-publish' - id 'java-library' -} - -final String JAVA9_SRC = 'src/main/java9' -final String JAVA9_OUT = "${buildDir}/classes/java9/main/" -final String VERSIONS9 = 'META-INF/versions/9' final String BEANS_SRC = "${buildDir}/generated-sources" final String BEANS_RES = "${buildDir}/generated-resources" diff --git a/poi-ooxml/build.gradle b/poi-ooxml/build.gradle index e801ed89aa..fcc8d79470 100644 --- a/poi-ooxml/build.gradle +++ b/poi-ooxml/build.gradle @@ -17,18 +17,6 @@ import java.util.regex.Pattern -plugins { - id 'java' - id 'maven-publish' - id 'java-library' -} - -final String JAVA9_SRC = 'src/main/java9' -final String JAVA9_OUT = "${buildDir}/classes/java9/main/" -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' diff --git a/poi-scratchpad/build.gradle b/poi-scratchpad/build.gradle index 693c913526..4669dc98dc 100644 --- a/poi-scratchpad/build.gradle +++ b/poi-scratchpad/build.gradle @@ -17,18 +17,6 @@ import java.util.regex.Pattern limitations under the License. ==================================================================== */ -plugins { - id 'java' - id 'maven-publish' - id 'java-library' -} - -final String JAVA9_SRC = 'src/main/java9' -final String JAVA9_OUT = "${buildDir}/classes/java9/main/" -final String TEST9_SRC = 'src/test/java9' -final String TEST9_OUT = "${buildDir}/classes/java9/test/" -final String VERSIONS9 = 'META-INF/versions/9' - configurations { tests javadocs diff --git a/poi/build.gradle b/poi/build.gradle index b5423599c8..d4388eebfc 100644 --- a/poi/build.gradle +++ b/poi/build.gradle @@ -17,18 +17,6 @@ import java.util.regex.Pattern -plugins { - id 'java' - id 'maven-publish' - id 'java-library' -} - -final String JAVA9_SRC = 'src/main/java9' -final String JAVA9_OUT = "${buildDir}/classes/java9/main/" -final String TEST9_SRC = 'src/test/java9' -final String TEST9_OUT = "${buildDir}/classes/java9/test/" -final String VERSIONS9 = 'META-INF/versions/9' - configurations { tests javadocs -- 2.39.5