]> source.dussan.org Git - poi.git/commitdiff
revert batik change due to build issues
authorPJ Fanning <fanningpj@apache.org>
Wed, 9 Oct 2024 19:18:22 +0000 (19:18 +0000)
committerPJ Fanning <fanningpj@apache.org>
Wed, 9 Oct 2024 19:18:22 +0000 (19:18 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1921218 13f79535-47bb-0310-9956-ffa450edef68

build.gradle
build.xml
osgi/pom.xml
poi-ooxml/build.gradle
poi-ooxml/src/main/java9/module-info.java
poi-ooxml/src/test/java9/module-info.java

index db8d5631c181e90dffaf5d504ecb17932a4f376d..3c371f58a410268e3f70b5f58eefa340ec110c4c 100644 (file)
@@ -128,7 +128,7 @@ subprojects {
         mockitoVersion = '4.11.0'
         hamcrestVersion = '3.0'
         xmlbeansVersion = '5.2.1'
-        batikVersion = '1.18'
+        batikVersion = '1.17'
         graphics2dVersion = '3.0.2'
         pdfboxVersion = '3.0.3'
         saxonVersion = '12.5'
index 3796643f9a095ac63dd4559d4d601a0619ce1293..bb4075a2c095a0b5c5f48dbd635d418407b18eb8 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -305,26 +305,26 @@ under the License.
 
     <!-- svg/batik/pdf libs - not part of the distribution - move batik to its own directory because of JPMS module-path issues -->
     <dependency prefix="svg.xml-apis-ext" artifact="xml-apis:xml-apis-ext:1.3.04" usage="ooxml-batik"/>
-    <dependency prefix="svg.xmlgraphics-commons" artifact="org.apache.xmlgraphics:xmlgraphics-commons:2.9" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-anim" artifact="org.apache.xmlgraphics:batik-anim:1.18" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-awt-util" artifact="org.apache.xmlgraphics:batik-awt-util:1.18" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-bridge" artifact="org.apache.xmlgraphics:batik-bridge:1.18" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-codec" artifact="org.apache.xmlgraphics:batik-codec:1.18" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-constants" artifact="org.apache.xmlgraphics:batik-constants:1.18" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-css" artifact="org.apache.xmlgraphics:batik-css:1.18" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-dom" artifact="org.apache.xmlgraphics:batik-dom:1.18" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-ext" artifact="org.apache.xmlgraphics:batik-ext:1.18" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-gvt" artifact="org.apache.xmlgraphics:batik-gvt:1.18" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-i18n" artifact="org.apache.xmlgraphics:batik-i18n:1.18" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-parser" artifact="org.apache.xmlgraphics:batik-parser:1.18" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-script" artifact="org.apache.xmlgraphics:batik-script:1.18" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-shared-resources" artifact="org.apache.xmlgraphics:batik-shared-resources:1.18" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-svg-dom" artifact="org.apache.xmlgraphics:batik-svg-dom:1.18" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-svggen" artifact="org.apache.xmlgraphics:batik-svggen:1.18" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-svgrasterizer" artifact="org.apache.xmlgraphics:batik-svgrasterizer:1.18" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-transcoder" artifact="org.apache.xmlgraphics:batik-transcoder:1.18" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-util" artifact="org.apache.xmlgraphics:batik-util:1.18" usage="ooxml-batik"/>
-    <dependency prefix="svg.batik-xml" artifact="org.apache.xmlgraphics:batik-xml:1.18" usage="ooxml-batik"/>
+    <dependency prefix="svg.xmlgraphics-commons" artifact="org.apache.xmlgraphics:xmlgraphics-commons:2.7" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-anim" artifact="org.apache.xmlgraphics:batik-anim:1.17" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-awt-util" artifact="org.apache.xmlgraphics:batik-awt-util:1.17" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-bridge" artifact="org.apache.xmlgraphics:batik-bridge:1.17" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-codec" artifact="org.apache.xmlgraphics:batik-codec:1.17" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-constants" artifact="org.apache.xmlgraphics:batik-constants:1.17" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-css" artifact="org.apache.xmlgraphics:batik-css:1.17" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-dom" artifact="org.apache.xmlgraphics:batik-dom:1.17" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-ext" artifact="org.apache.xmlgraphics:batik-ext:1.17" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-gvt" artifact="org.apache.xmlgraphics:batik-gvt:1.17" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-i18n" artifact="org.apache.xmlgraphics:batik-i18n:1.17" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-parser" artifact="org.apache.xmlgraphics:batik-parser:1.17" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-script" artifact="org.apache.xmlgraphics:batik-script:1.17" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-shared-resources" artifact="org.apache.xmlgraphics:batik-shared-resources:1.17" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-svg-dom" artifact="org.apache.xmlgraphics:batik-svg-dom:1.17" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-svggen" artifact="org.apache.xmlgraphics:batik-svggen:1.17" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-svgrasterizer" artifact="org.apache.xmlgraphics:batik-svgrasterizer:1.17" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-transcoder" artifact="org.apache.xmlgraphics:batik-transcoder:1.17" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-util" artifact="org.apache.xmlgraphics:batik-util:1.17" usage="ooxml-batik"/>
+    <dependency prefix="svg.batik-xml" artifact="org.apache.xmlgraphics:batik-xml:1.17" usage="ooxml-batik"/>
     <dependency prefix="pdf.pdfbox" artifact="org.apache.pdfbox:pdfbox:3.0.3" usage="ooxml-provided"/>
     <dependency prefix="pdf.pdfbox.io" artifact="org.apache.pdfbox:pdfbox-io:3.0.3" usage="ooxml-provided"/>
     <dependency prefix="pdf.fontbox" artifact="org.apache.pdfbox:fontbox:3.0.3" usage="ooxml-provided"/>
index b1cdfd09939e2ef976e770bd88ea0b3bd607843c..1980941e44b7f895fafa9e5c77745de60cc0f67c 100644 (file)
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>test</scope>
-            <version>4.13.2</version>
+            <version>4.13.1</version>
         </dependency>
 
         <!-- Pax Exam -->
index 84c1fa157fa265143176a169f7daddafc3c24a0b..843c21ead5566119fb1879ac33250b974b1ff858 100644 (file)
@@ -28,6 +28,7 @@ configurations {
         exclude group: 'xml-apis', module: 'xml-apis'
     }
 
+    broken
     tests
     javadocs
 }
@@ -125,19 +126,29 @@ dependencies {
     testImplementation "org.apache.logging.log4j:log4j-slf4j2-impl:${log4jVersion}"
     testImplementation 'org.slf4j:slf4j-simple:2.0.16'
 
+    broken("org.apache.xmlgraphics:batik-script:${batikVersion}"){
+        exclude group: 'xalan', module: 'xalan'
+        exclude group: 'xml-apis', module: 'xml-apis'
+    }
+
     javadocs project(':poi')
     javadocs project(':poi-scratchpad')
 }
 
 final String MODULE_NAME = 'org.apache.poi.ooxml'
+final Pattern MODULE_NOT_REGEX = ~'(poi[/\\\\][^/\\\\]+$|batik-script)'
 final Pattern MODULE_REGEX = ~'\\.jar$'
 final List MAIN_MODULE_PATH = sourceSets.main.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX }.collect{ it.parent }.unique()
-final List TEST_MODULE_PATH = sourceSets.test.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX }.collect{ it.parent }.unique()
+final List TEST_MODULE_PATH = sourceSets.test.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX && !(it.path =~ MODULE_NOT_REGEX) }.collect{ it.parent }.unique() + files("build/brokenJars")
 
 final String OOXML_LITE_AGENT = "../build/dist/maven/poi-ooxml-lite-agent/poi-ooxml-lite-agent-${project.version}.jar"
 final String OOXML_LITE_REPORT = '../src/resources/ooxml-lite-report'
 final String OOXML_LITE_INCLUDES = "^(com/microsoft/schemas|org/(etsi|openxmlformats|w3/)|org/apache/poi/schemas)"
 
+compileJava {
+    dependsOn 'fixBatik', 'cleanupBatik'
+}
+
 task compileJava9(type: JavaCompile) {
     dependsOn 'compileJava', ':poi:jar'
 
@@ -197,6 +208,25 @@ task testJar(type: Jar, dependsOn: testClasses) {
     }
 }
 
+// based on https://github.com/moditect/moditect-gradle-plugin/issues/12
+task fixBatik(type: Zip) {
+    ant.mkdir(dir: "${buildDir}/brokenJars")
+    archiveFileName = "batik-script-${batikVersion}.jar"
+    destinationDirectory = file("${buildDir}/brokenJars")
+    from zipTree(configurations.broken.files.find{ f -> f.name.startsWith("batik-script") })
+    filesMatching("**/org.apache.batik.script.InterpreterFactory") {
+        it.filter{ it2 -> it2.contains("Rhino") ? "#" + it2 : it2 }
+    }
+}
+
+task cleanupBatik(type: Delete) {
+    // remove older files to avoid build failures because of duplicate modules
+    delete fileTree("${buildDir}/brokenJars/").matching {
+        include "*.jar"
+        exclude "batik*-${batikVersion}.jar"
+    }
+}
+
 javadoc {
     failOnError = true
     doFirst {
index d740345f59e505a131ef261ad356b7722e7f3633..35a257fb754ab4574b13fca7a96ac4a2f9512d7c 100644 (file)
@@ -93,25 +93,25 @@ module org.apache.poi.ooxml {
     requires static org.bouncycastle.pkix;
 
     /* optional dependencies for slideshow rendering via PPTX2PNG */
-    requires static org.apache.xmlgraphics.batik.anim;
-    requires static org.apache.xmlgraphics.batik.awt.util;
-    /* this typo appears in Batik 1.18 and will be fixed in a future release */
-    requires static org.apache.xmlgraphics.batik.brdige;
-    requires static org.apache.xmlgraphics.batik.codec;
-    requires static org.apache.xmlgraphics.batik.constants;
-    requires static org.apache.xmlgraphics.batik.css;
-    requires static org.apache.xmlgraphics.batik.dom;
-    requires static org.apache.xmlgraphics.batik.ext;
-    requires static org.apache.xmlgraphics.batik.gvt;
-    requires static org.apache.xmlgraphics.batik.i18n;
-    requires static org.apache.xmlgraphics.batik.parser;
-    requires static org.apache.xmlgraphics.batik.script;
-    requires static org.apache.xmlgraphics.batik.svgdom;
-    requires static org.apache.xmlgraphics.batik.svggen;
-    requires static org.apache.xmlgraphics.batik.svgrasterizer;
-    requires static org.apache.xmlgraphics.batik.transcoder;
-    requires static org.apache.xmlgraphics.batik.util;
-    requires static org.apache.xmlgraphics.batik.xml;
+    requires static batik.anim;
+    requires static batik.awt.util;
+    requires static batik.bridge;
+    requires static batik.codec;
+    requires static batik.constants;
+    requires static batik.css;
+    requires static batik.dom;
+    requires static batik.ext;
+    requires static batik.gvt;
+    requires static batik.i18n;
+    requires static batik.parser;
+    requires static batik.script;
+    requires static batik.shared.resources;
+    requires static batik.svg.dom;
+    requires static batik.svggen;
+    requires static batik.svgrasterizer;
+    requires static batik.transcoder;
+    requires static batik.util;
+    requires static batik.xml;
     requires static xmlgraphics.commons;
 
     requires static org.apache.pdfbox;
index 1f114f5aa2e402c3dfb70a3ae412977973674a16..cc65353c3b4c2e739c8842eb91c8588da8e7640c 100644 (file)
@@ -95,25 +95,25 @@ module org.apache.poi.ooxml {
 
 
     /* optional dependencies for slideshow rendering via PPTX2PNG */
-    requires static org.apache.xmlgraphics.batik.anim;
-    requires static org.apache.xmlgraphics.batik.awt.util;
-    /* this typo appears in Batik 1.18 and will be fixed in a future release */
-    requires static org.apache.xmlgraphics.batik.brdige;
-    requires static org.apache.xmlgraphics.batik.codec;
-    requires static org.apache.xmlgraphics.batik.constants;
-    requires static org.apache.xmlgraphics.batik.css;
-    requires static org.apache.xmlgraphics.batik.dom;
-    requires static org.apache.xmlgraphics.batik.ext;
-    requires static org.apache.xmlgraphics.batik.gvt;
-    requires static org.apache.xmlgraphics.batik.i18n;
-    requires static org.apache.xmlgraphics.batik.parser;
-    requires static org.apache.xmlgraphics.batik.script;
-    requires static org.apache.xmlgraphics.batik.svgdom;
-    requires static org.apache.xmlgraphics.batik.svggen;
-    requires static org.apache.xmlgraphics.batik.svgrasterizer;
-    requires static org.apache.xmlgraphics.batik.transcoder;
-    requires static org.apache.xmlgraphics.batik.util;
-    requires static org.apache.xmlgraphics.batik.xml;
+    requires static batik.anim;
+    requires static batik.awt.util;
+    requires static batik.bridge;
+    requires static batik.codec;
+    requires static batik.constants;
+    requires static batik.css;
+    requires static batik.dom;
+    requires static batik.ext;
+    requires static batik.gvt;
+    requires static batik.i18n;
+    requires static batik.parser;
+    requires static batik.script;
+    requires static batik.shared.resources;
+    requires static batik.svg.dom;
+    requires static batik.svggen;
+    requires static batik.svgrasterizer;
+    requires static batik.transcoder;
+    requires static batik.util;
+    requires static batik.xml;
     requires static xmlgraphics.commons;
 
     requires static org.apache.pdfbox;