mirror of
https://github.com/apache/poi.git
synced 2026-02-27 12:30:08 +08:00
Fix some more Gradle deprecation-warnings in preparation for Gradle 9
Only signing-handling in poi-ooxml is still remaining, but this deprecation seems to have been moved to Gradle 10 anyway. Gradle 9 will require JDK 17, though, so we can only upgrade when the min. supported JDK is bumped once more.
This commit is contained in:
parent
3ac160b57d
commit
9e1afbbab1
20
build.gradle
20
build.gradle
@ -227,14 +227,14 @@ subprojects {
|
|||||||
|
|
||||||
tasks.withType(Jar).configureEach {
|
tasks.withType(Jar).configureEach {
|
||||||
duplicatesStrategy = DuplicatesStrategy.FAIL
|
duplicatesStrategy = DuplicatesStrategy.FAIL
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
// make sure we do not have distribution jar-files with different versions
|
// 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"
|
// in the build-dir as those lead to strange errors about "duplicate modules"
|
||||||
// when building java9 JPMS class files ("java9")
|
// when building java9 JPMS class files ("java9")
|
||||||
ant.delete(failOnError: true, verbose: true) {
|
ant.delete(failOnError: true, verbose: true) {
|
||||||
fileset(dir: "../build/dist/maven/${project.archivesBaseName}", erroronmissingdir: false) {
|
fileset(dir: "../build/dist/maven/${base.archivesName.get()}", erroronmissingdir: false) {
|
||||||
include(name: '*.jar')
|
include(name: '*.jar')
|
||||||
exclude(name: "*${version}.jar")
|
exclude(name: "*${version}.jar")
|
||||||
exclude(name: "*${version}-sources.jar")
|
exclude(name: "*${version}-sources.jar")
|
||||||
@ -260,7 +260,7 @@ subprojects {
|
|||||||
}
|
}
|
||||||
// use failOnError=false for -javadoc and -tests as not all modules create this directory
|
// use failOnError=false for -javadoc and -tests as not all modules create this directory
|
||||||
ant.delete(failOnError: false, verbose: true) {
|
ant.delete(failOnError: false, verbose: true) {
|
||||||
fileset(dir: "../build/dist/maven/${project.archivesBaseName}-javadoc", erroronmissingdir: false) {
|
fileset(dir: "../build/dist/maven/${base.archivesName.get()}-javadoc", erroronmissingdir: false) {
|
||||||
include(name: '*-javadoc.jar')
|
include(name: '*-javadoc.jar')
|
||||||
exclude(name: "*${version}-javadoc.jar")
|
exclude(name: "*${version}-javadoc.jar")
|
||||||
|
|
||||||
@ -275,7 +275,7 @@ subprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ant.delete(failOnError: false, verbose: true) {
|
ant.delete(failOnError: false, verbose: true) {
|
||||||
fileset(dir: "../build/dist/maven/${project.archivesBaseName}-tests", erroronmissingdir: false) {
|
fileset(dir: "../build/dist/maven/${base.archivesName.get()}-tests", erroronmissingdir: false) {
|
||||||
include(name: '*-tests.jar')
|
include(name: '*-tests.jar')
|
||||||
exclude(name: "*${version}-tests.jar")
|
exclude(name: "*${version}-tests.jar")
|
||||||
|
|
||||||
@ -290,8 +290,8 @@ subprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ant.checksum(file: it.archivePath, algorithm: 'SHA-256', fileext: '.sha256', format: 'MD5SUM')
|
ant.checksum(file: it.archiveFile.get().asFile, algorithm: 'SHA-256', fileext: '.sha256', format: 'MD5SUM')
|
||||||
ant.checksum(file: it.archivePath, algorithm: 'SHA-512', fileext: '.sha512', format: 'MD5SUM')
|
ant.checksum(file: it.archiveFile.get().asFile, algorithm: 'SHA-512', fileext: '.sha512', format: 'MD5SUM')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,11 +319,11 @@ subprojects {
|
|||||||
javadocJar {
|
javadocJar {
|
||||||
// if javadocs and binaries are in the same directory, JPMS complaints about duplicated modules
|
// if javadocs and binaries are in the same directory, JPMS complaints about duplicated modules
|
||||||
// in the module-path
|
// in the module-path
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}-javadoc")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}-javadoc")
|
||||||
}
|
}
|
||||||
|
|
||||||
sourcesJar {
|
sourcesJar {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
|
||||||
exclude 'META-INF/services/**'
|
exclude 'META-INF/services/**'
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -504,7 +504,7 @@ subprojects {
|
|||||||
publications {
|
publications {
|
||||||
POI(MavenPublication) {
|
POI(MavenPublication) {
|
||||||
groupId = 'org.apache.poi'
|
groupId = 'org.apache.poi'
|
||||||
artifactId = project.archivesBaseName
|
artifactId = base.archivesName.get()
|
||||||
|
|
||||||
from components.java
|
from components.java
|
||||||
|
|
||||||
@ -585,7 +585,7 @@ subprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
generatePomFileForPOIPublication.destination = "../build/dist/maven/${project.archivesBaseName}/${project.archivesBaseName}-${project.version}.pom"
|
generatePomFileForPOIPublication.destination = "../build/dist/maven/${base.archivesName.get()}/${base.archivesName.get()}-${project.version}.pom"
|
||||||
|
|
||||||
tasks.withType(GenerateModuleMetadata).configureEach {
|
tasks.withType(GenerateModuleMetadata).configureEach {
|
||||||
enabled = false
|
enabled = false
|
||||||
|
|||||||
@ -67,7 +67,7 @@ tasks.register('compileJava9', JavaCompile) {
|
|||||||
jar {
|
jar {
|
||||||
dependsOn compileJava9
|
dependsOn compileJava9
|
||||||
|
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
||||||
|
|||||||
@ -95,7 +95,7 @@ tasks.register('compileTest9', JavaCompile) {
|
|||||||
jar {
|
jar {
|
||||||
dependsOn compileJava9
|
dependsOn compileJava9
|
||||||
|
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
||||||
@ -119,7 +119,7 @@ sourcesJar {
|
|||||||
// Create a separate jar for test-code to depend on it in other projects
|
// Create a separate jar for test-code to depend on it in other projects
|
||||||
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
|
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
|
||||||
task testJar(type: Jar, dependsOn: [ testClasses, compileTest9 ] ) {
|
task testJar(type: Jar, dependsOn: [ testClasses, compileTest9 ] ) {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}-tests")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}-tests")
|
||||||
|
|
||||||
setArchiveClassifier 'tests'
|
setArchiveClassifier 'tests'
|
||||||
// ignore second module-info.class from main
|
// ignore second module-info.class from main
|
||||||
|
|||||||
@ -109,7 +109,7 @@ tasks.register('compileTest9', JavaCompile) {
|
|||||||
|
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
||||||
@ -119,7 +119,7 @@ jar {
|
|||||||
// Create a separate jar for test-code to depend on it in other projects
|
// Create a separate jar for test-code to depend on it in other projects
|
||||||
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
|
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
|
||||||
task testJar(type: Jar, dependsOn: [ testClasses, compileTest9 ] ) {
|
task testJar(type: Jar, dependsOn: [ testClasses, compileTest9 ] ) {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}-tests")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}-tests")
|
||||||
|
|
||||||
setArchiveClassifier 'tests'
|
setArchiveClassifier 'tests'
|
||||||
// ignore second module-info.class from main
|
// ignore second module-info.class from main
|
||||||
|
|||||||
@ -56,7 +56,7 @@ tasks.register('compileJava9', JavaCompile) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
attributes (
|
attributes (
|
||||||
|
|||||||
@ -107,7 +107,7 @@ task compileJava9(type: JavaCompile, dependsOn: 'compileJava') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
|
||||||
|
|
||||||
doFirst {
|
doFirst {
|
||||||
File clazzFile = file("${OOXML_LITE_REPORT}.clazz")
|
File clazzFile = file("${OOXML_LITE_REPORT}.clazz")
|
||||||
|
|||||||
@ -187,7 +187,7 @@ tasks.register('compileTest9', JavaCompile) {
|
|||||||
|
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
||||||
@ -197,7 +197,7 @@ jar {
|
|||||||
// Create a separate jar for test-code to depend on it in other projects
|
// Create a separate jar for test-code to depend on it in other projects
|
||||||
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
|
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
|
||||||
task testJar(type: Jar, dependsOn: testClasses) {
|
task testJar(type: Jar, dependsOn: testClasses) {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}-tests")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}-tests")
|
||||||
|
|
||||||
setArchiveClassifier 'tests'
|
setArchiveClassifier 'tests'
|
||||||
// ignore second module-info.class from main
|
// ignore second module-info.class from main
|
||||||
|
|||||||
@ -88,7 +88,7 @@ tasks.register('compileTest9', JavaCompile) {
|
|||||||
|
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
||||||
@ -98,7 +98,7 @@ jar {
|
|||||||
// Create a separate jar for test-code to depend on it in other projects
|
// Create a separate jar for test-code to depend on it in other projects
|
||||||
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
|
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
|
||||||
task testJar(type: Jar, dependsOn: testClasses) {
|
task testJar(type: Jar, dependsOn: testClasses) {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}-tests")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}-tests")
|
||||||
|
|
||||||
setArchiveClassifier 'tests'
|
setArchiveClassifier 'tests'
|
||||||
// ignore second module-info.class from main
|
// ignore second module-info.class from main
|
||||||
|
|||||||
@ -124,7 +124,7 @@ jar {
|
|||||||
// Create a separate jar for test-code to depend on it in other projects
|
// Create a separate jar for test-code to depend on it in other projects
|
||||||
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
|
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
|
||||||
task testJar(type: Jar, dependsOn: [ testClasses, compileTest9 ]) {
|
task testJar(type: Jar, dependsOn: [ testClasses, compileTest9 ]) {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}-tests")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}-tests")
|
||||||
|
|
||||||
setArchiveClassifier 'tests'
|
setArchiveClassifier 'tests'
|
||||||
// ignore second module-info.class from main
|
// ignore second module-info.class from main
|
||||||
@ -138,11 +138,11 @@ task testJar(type: Jar, dependsOn: [ testClasses, compileTest9 ]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
javadoc {
|
javadoc {
|
||||||
dependsOn configurations.javadocs.dependencies.collect{ ':' + it.dependencyProject.name + ':compileJava' }
|
dependsOn configurations.javadocs.dependencies.collect{ ':' + project.project(it.path).name + ':compileJava' }
|
||||||
|
|
||||||
doFirst {
|
doFirst {
|
||||||
options {
|
options {
|
||||||
classpath += files(configurations.javadocs.dependencies.collect{ it.dependencyProject.sourceSets.main.output.classesDirs })
|
classpath += files(configurations.javadocs.dependencies.collect{ project.project(it.path).sourceSets.main.output.classesDirs })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user