From 389eab2fbdbe9e8a474e7588d31333031ecac612 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Sat, 26 Sep 2020 05:22:14 +0000 Subject: [PATCH] Try to fix the Gradle build Third party lib updates Also use the temporary XMLBeans 4.0.0 jar Add missing dependencies git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1882036 13f79535-47bb-0310-9956-ffa450edef68 --- build.gradle | 63 +++++++++++++------ .../poi/stress/HSSFRecordsStresser.java | 3 +- 2 files changed, 47 insertions(+), 19 deletions(-) diff --git a/build.gradle b/build.gradle index 83277719fb..b3da423b36 100644 --- a/build.gradle +++ b/build.gradle @@ -68,6 +68,21 @@ task adjustWrapperPropertiesFile { } wrapper.finalizedBy adjustWrapperPropertiesFile + +// helper method to download a jar file manually from an URL, e.g. XMLBeans 4.0.0 +def urlFile = { url, name -> + File file = new File("$buildDir/download/${name}.jar") + file.parentFile.mkdirs() + if (!file.exists()) { + new URL(url).withInputStream { downloadStream -> + file.withOutputStream { fileOut -> + fileOut << downloadStream + } + } + } + files(file.absolutePath) +} + /** Define properties for all projects, including this one @@ -92,14 +107,14 @@ subprojects { version = '5.0.0-SNAPSHOT' ext { - bouncyCastleVersion = '1.65' + bouncyCastleVersion = '1.66' commonsCodecVersion = '1.14' commonsCompressVersion = '1.20' commonsMathVersion = '3.6.1' japicmpversion = '4.1.2' junitVersion = '4.13' - mockitoVersion = '3.3.3' - xmlbeansVersion = '3.1.0' + mockitoVersion = '3.5.0' + xmlbeansVersion = '4.0.0' } tasks.withType(JavaCompile) { @@ -193,7 +208,7 @@ project('main') { testCompile "junit:junit:${junitVersion}" testCompile "org.mockito:mockito-core:${mockitoVersion}" - testCompile 'org.reflections:reflections:0.9.11' + testCompile 'org.reflections:reflections:0.9.12' } jar { @@ -234,35 +249,38 @@ project('ooxml') { compileJava.dependsOn 'ant-compile-ooxml-xsds' dependencies { - compile "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}" + // revert this back to a normal dependency after XMLBeans 4.0.0 is released + //compile "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}" + compile urlFile('https://ci-builds.apache.org/job/POI/job/POI-XMLBeans-DSL-1.8/lastSuccessfulBuild/artifact/build/xmlbeans-4.0.0.jar', 'xmlbeans') + compile 'org.apache.commons:commons-collections4:4.4' compile "org.apache.commons:commons-math3:${commonsMathVersion}" compile "org.apache.commons:commons-compress:${commonsCompressVersion}" - compile 'org.apache.santuario:xmlsec:2.1.5' + compile 'org.apache.santuario:xmlsec:2.2.0' compile "org.bouncycastle:bcpkix-jdk15on:${bouncyCastleVersion}" compile 'com.github.virtuald:curvesapi:1.06' compile 'com.zaxxer:SparseBitSet:1.2' // compile only, don't add it to our dist as it blows up the size - compile 'org.apache.xmlgraphics:batik-all:1.12' + compile 'org.apache.xmlgraphics:batik-all:1.13' compile 'xml-apis:xml-apis-ext:1.3.04' - compile 'org.apache.xmlgraphics:xmlgraphics-commons:2.3' + compile 'org.apache.xmlgraphics:xmlgraphics-commons:2.4' // for ooxml-lite, should we move this somewhere else? compile "junit:junit:${junitVersion}" compile project(':main') compile project(':scratchpad') // TODO: get rid of this dependency! - compile files('../../lib/ooxml/ooxml-schemas-1.4.jar') - compile files('../../lib/ooxml/ooxml-security-1.1.jar') + compile files('../../build/dist/maven/ooxml-schemas/ooxml-schemas-1.5.jar') testCompile "junit:junit:${junitVersion}" testCompile "org.mockito:mockito-core:${mockitoVersion}" - testCompile 'org.xmlunit:xmlunit-core:2.5.1' - testCompile 'org.reflections:reflections:0.9.11' + testCompile 'org.xmlunit:xmlunit-core:2.7.0' + testCompile 'org.reflections:reflections:0.9.12' testCompile project(path: ':main', configuration: 'tests') - testCompile 'org.openjdk.jmh:jmh-core:1.19' - testCompile 'org.openjdk.jmh:jmh-generator-annprocess:1.19' + testCompile 'org.openjdk.jmh:jmh-core:1.25' + testCompile 'org.openjdk.jmh:jmh-generator-annprocess:1.25' + testCompile 'com.google.guava:guava:29.0-jre' } jar { @@ -286,8 +304,12 @@ project('examples') { compile project(':main') compile project(':ooxml') compile project(':scratchpad') - compile "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}" - compile files('../../lib/ooxml/ooxml-schemas-1.4.jar') + + // revert this back to a normal dependency after XMLBeans 4.0.0 is released + //compile "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}" + compile urlFile('https://ci-builds.apache.org/job/POI/job/POI-XMLBeans-DSL-1.8/lastSuccessfulBuild/artifact/build/xmlbeans-4.0.0.jar', 'xmlbeans') + + compile files('../../build/dist/maven/ooxml-schemas/ooxml-schemas-1.5.jar') compile "org.apache.commons:commons-compress:${commonsCompressVersion}" } @@ -331,8 +353,13 @@ project('integrationtest') { compile project(':examples') testCompile "junit:junit:${junitVersion}" - testCompile "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}" - testCompile files('../../lib/ooxml/ooxml-schemas-1.4.jar') + + // revert this back to a normal dependency after XMLBeans 4.0.0 is released + //testCompile "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}" + testCompile urlFile('https://ci-builds.apache.org/job/POI/job/POI-XMLBeans-DSL-1.8/lastSuccessfulBuild/artifact/build/xmlbeans-4.0.0.jar', 'xmlbeans') + + testCompile files('../../build/dist/maven/ooxml-schemas/ooxml-schemas-1.5.jar') + testCompile files(this.project(':ooxml').sourceSets.test.runtimeClasspath) } jar { diff --git a/src/integrationtest/org/apache/poi/stress/HSSFRecordsStresser.java b/src/integrationtest/org/apache/poi/stress/HSSFRecordsStresser.java index 932fd396b1..0a02b61374 100644 --- a/src/integrationtest/org/apache/poi/stress/HSSFRecordsStresser.java +++ b/src/integrationtest/org/apache/poi/stress/HSSFRecordsStresser.java @@ -26,6 +26,7 @@ import java.util.List; import org.apache.poi.hssf.record.Record; import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.xssf.XSSFTestDataSamples; import org.junit.Test; /** @@ -67,7 +68,7 @@ public class HSSFRecordsStresser { // a test-case to test this locally without executing the full TestAllFiles @Test public void test() throws Exception { - try (InputStream stream = new FileInputStream("test-data/spreadsheet/15556.xls")) { + try (InputStream stream = new FileInputStream(XSSFTestDataSamples.getSampleFile("15556.xls"))) { HSSFWorkbook wb = new HSSFWorkbook(stream); handleWorkbook(wb); wb.close(); -- 2.39.5