aboutsummaryrefslogtreecommitdiffstats
path: root/build.gradle
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2024-01-23 09:28:17 +0000
committerDominik Stadler <centic@apache.org>2024-01-23 09:28:17 +0000
commitb010f9c99cf815ae704223b9e38d77234fed3366 (patch)
tree6624160c077eaf754338ac6d30ccb03989cb5bcd /build.gradle
parentc868af2e575c2e56bba9037c2f03fdb59ce301cf (diff)
downloadpoi-b010f9c99cf815ae704223b9e38d77234fed3366.tar.gz
poi-b010f9c99cf815ae704223b9e38d77234fed3366.zip
Try to remove outdated files from the "distribution" folder
Clean directory and keep only the expected files with the current version. Otherwise we get strange errors about "duplicate modules" when building after version was switched. git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1915368 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle60
1 files changed, 60 insertions, 0 deletions
diff --git a/build.gradle b/build.gradle
index 430b91bb64..31014c7903 100644
--- a/build.gradle
+++ b/build.gradle
@@ -236,6 +236,66 @@ subprojects {
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
doLast {
+ // make sure we do not have distribution jar-files with different versions
+ // in the build-dir as those lead to strange errors about "duplicate modules"
+ // when building java9 JPMS class files ("java9")
+ ant.delete(failOnError: true, verbose: true) {
+ fileset(dir: "../build/dist/maven/${project.archivesBaseName}") {
+ include(name: '*.jar')
+ exclude(name: "*${version}.jar")
+ exclude(name: "*${version}-sources.jar")
+
+ include(name: '*.jar.asc')
+ exclude(name: "*${version}.jar.asc")
+ exclude(name: "*${version}-sources.jar.asc")
+
+ include(name: '*.jar.sha256')
+ exclude(name: "*${version}.jar.sha256")
+ exclude(name: "*${version}-sources.jar.sha256")
+
+ include(name: '*.jar.sha512')
+ exclude(name: "*${version}.jar.sha512")
+ exclude(name: "*${version}-sources.jar.sha512")
+
+ include(name: '*.pom')
+ exclude(name: "*${version}.pom")
+
+ include(name: '*.pom.asc')
+ exclude(name: "*${version}.pom.asc")
+ }
+ }
+ // use failOnError=false for -javadoc and -tests as not all modules create this directory
+ ant.delete(failOnError: false, verbose: true) {
+ fileset(dir: "../build/dist/maven/${project.archivesBaseName}-javadoc") {
+ include(name: '*-javadoc.jar')
+ exclude(name: "*${version}-javadoc.jar")
+
+ include(name: '*-javadoc.jar.asc')
+ exclude(name: "*${version}-javadoc.jar.asc")
+
+ include(name: '*-javadoc.jar.sha256')
+ exclude(name: "*${version}-javadoc.jar.sha256")
+
+ include(name: '*-javadoc.jar.sha512')
+ exclude(name: "*${version}-javadoc.jar.sha512")
+ }
+ }
+ ant.delete(failOnError: false, verbose: true) {
+ fileset(dir: "../build/dist/maven/${project.archivesBaseName}-tests") {
+ include(name: '*-tests.jar')
+ exclude(name: "*${version}-tests.jar")
+
+ include(name: '*-tests.jar.asc')
+ exclude(name: "*${version}-tests.jar.asc")
+
+ include(name: '*-tests.jar.sha256')
+ exclude(name: "*${version}-tests.jar.sha256")
+
+ include(name: '*-tests.jar.sha512')
+ exclude(name: "*${version}-tests.jar.sha512")
+ }
+ }
+
ant.checksum(file: it.archivePath, algorithm: 'SHA-256', fileext: '.sha256', format: 'MD5SUM')
ant.checksum(file: it.archivePath, algorithm: 'SHA-512', fileext: '.sha512', format: 'MD5SUM')
}