summaryrefslogtreecommitdiffstats
path: root/build.gradle
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2021-09-12 20:31:43 +0000
committerAndreas Beeker <kiwiwings@apache.org>2021-09-12 20:31:43 +0000
commit596db3117021cea11793fff2d3018e5e2907a2c9 (patch)
tree2af7961416ce3c30cc037de1a62c7b58783faae4 /build.gradle
parent99047b5245ea588419cd45b8a8ac3a1ca15494ea (diff)
downloadpoi-596db3117021cea11793fff2d3018e5e2907a2c9.tar.gz
poi-596db3117021cea11793fff2d3018e5e2907a2c9.zip
XmlSec/BouncyCastle and Batik are now optional
disable SonarQube build based on ant remove sonar and maven directory, because POMs are now created via Gradle remove maven section from seed-build fix duplicated maven dependencies on POM export git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1893289 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle64
1 files changed, 57 insertions, 7 deletions
diff --git a/build.gradle b/build.gradle
index 8393a48950..7e59616989 100644
--- a/build.gradle
+++ b/build.gradle
@@ -15,6 +15,13 @@
limitations under the License.
==================================================================== */
+import org.w3c.dom.Node
+import org.w3c.dom.NodeList
+
+import javax.xml.xpath.XPath
+import javax.xml.xpath.XPathConstants
+import javax.xml.xpath.XPathFactory
+
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
@@ -124,6 +131,15 @@ subprojects {
NO_SCRATCHPAD = (findProperty("scratchpad.ignore") == "true")
}
+ configurations {
+ all {
+ resolutionStrategy {
+ force "commons-io:commons-io:${commonsIoVersion}"
+ force 'org.slf4j:slf4j-api:1.8.0-beta4'
+ }
+ }
+ }
+
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint:unchecked'
@@ -191,8 +207,23 @@ subprojects {
}
jar {
+ from("../legal") {
+ include "NOTICE"
+ include "LICENSE"
+ }
+
+ rename('^(NOTICE|LICENSE)', 'META-INF/$1')
+
manifest {
- attributes 'Implementation-Title': 'Apache POI', 'Implementation-Version': project.version
+ attributes(
+ 'Specification-Title': 'Apache POI',
+ 'Specification-Version': project.version,
+ 'Specification-Vendor': 'The Apache Software Foundation',
+ 'Implementation-Title': 'Apache POI',
+ 'Implementation-Version': project.version,
+ 'Implementation-Vendor': 'org.apache.poi',
+ 'Implementation-Vendor-Id': 'The Apache Software Foundation'
+ )
}
}
@@ -384,6 +415,20 @@ subprojects {
// adding ASF header before root node is ignored
// doc.insertBefore(asl, doc.getDocumentElement())
r.insertBefore(asl, r.getFirstChild())
+
+ // Replace ooxml-full with ooxml-lite
+ XPath xpath = XPathFactory.newInstance().newXPath()
+ NodeList res = (NodeList)xpath.evaluate("//dependency/artifactId[text() = 'poi-ooxml-full']", doc, XPathConstants.NODESET)
+ for (int i=res.getLength()-1; i>=0; i--) {
+ res.item(i).setTextContent('poi-ooxml-lite')
+ }
+
+ // remove duplicate entries
+ res = (NodeList)xpath.evaluate("//dependency[artifactId = ./preceding-sibling::dependency/artifactId]", doc, XPathConstants.NODESET)
+ for (int i=res.getLength()-1; i>=0; i--) {
+ Node n = res.item(i)
+ n.getParentNode().removeChild(n)
+ }
}
}
}
@@ -392,9 +437,14 @@ subprojects {
generatePomFileForPOIPublication.destination = "../build/dist/maven/${project.archivesBaseName}/${project.archivesBaseName}-${project.version}.pom"
+ tasks.withType(GenerateModuleMetadata) {
+ enabled = false
+ }
+
signing {
sign publishing.publications.POI
}
+ signPOIPublication.dependsOn('generatePomFileForPOIPublication')
spotbugs {
ignoreFailures = true
@@ -402,9 +452,9 @@ subprojects {
}
build {
- // disabled until next release build - only works when you've configured the signing key in your
- // user gradle.properties file
- // dependsOn 'signPOIPublication'
+ if (project.hasProperty('signing.keyId')) {
+ dependsOn 'signPOIPublication'
+ }
}
}
@@ -525,8 +575,8 @@ task replaceVersion() {
var version = subprojects[0].version
var tokens = [
- [ 'sonar', '**/pom.xml', '(packaging>\\n\\s*<version>)[0-9.]+(?:-SNAPSHOT)?', "\\1${version}" ],
- [ 'sonar', '**/pom.xml', '(poi-parent&lt;/artifactId>\\n\\s*<version>)[0-9.]+(?:-SNAPSHOT)?', "\1${version}" ],
+// [ 'sonar', '**/pom.xml', '(packaging>\\n\\s*<version>)[0-9.]+(?:-SNAPSHOT)?', "\\1${version}" ],
+// [ 'sonar', '**/pom.xml', '(poi-parent&lt;/artifactId>\\n\\s*<version>)[0-9.]+(?:-SNAPSHOT)?', "\1${version}" ],
[ 'osgi', 'pom.xml', '(packaging>\\n\\s*<version>)[0-9.]+(?:-SNAPSHOT)?', "\\1${version}" ]
// [ '.', 'build.gradle', ' version = \'[0-9.]+(?:-SNAPSHOT)?\'', " version = '${version}'" ]
]
@@ -582,7 +632,7 @@ distributions {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
eachFile {
- var root = "poi-bin-${version}/"
+ String root = "poi-bin-${version}/"
if (name.startsWith('poi')) {
path = root + name
} else if (poiDep.contains(file)) {