2002-02-14 21:11:36 -05:00
<?xml version="1.0"?>
2015-08-07 19:33:30 -04:00
<!--
2007-01-02 07:50:54 -05:00
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
2003-04-23 20:53:41 -04:00
<!--
2014-10-20 09:54:41 -04:00
This build was tested with ant 1.9.4 although it will probably work with
2015-01-03 04:35:21 -05:00
other versions, however at least 1.8.0 is required.
2003-04-23 20:53:41 -04:00
2018-07-18 19:24:53 -04:00
updated to forrest 0.9:
2003-04-23 20:53:41 -04:00
To build the documentation you will need to install forrest and set
2018-07-21 06:28:53 -04:00
the FORREST_HOME environment variable.
2003-04-23 20:53:41 -04:00
2017-09-15 14:39:18 -04:00
Since POI 4.0 you will need JDK 1.8 or newer to build and run POI.
2008-01-21 13:00:30 -05:00
2008-03-22 14:55:14 -04:00
Some people may find the tests hang when run through Ant. If this
happens to you, try giving Ant some more memory when you run it, eg:
2017-09-17 07:07:28 -04:00
ANT_OPTS="-Xmx1024m" ant test
2008-03-22 14:55:14 -04:00
2003-04-23 20:53:41 -04:00
-->
2016-03-06 20:58:26 -05:00
<project name= "POI Build" default= "help" basedir= "."
xmlns:mvn="antlib:org.apache.maven.artifact.ant"
xmlns:openpgp="antlib:org.apache.commons.openpgp.ant"
xmlns:staging="antlib:org.sonatype.nexus.ant.staging"
xmlns:if="ant:if"
xmlns:unless="ant:unless">
2003-04-23 20:53:41 -04:00
2009-11-21 10:30:54 -05:00
<description > The Apache POI project Ant build.</description>
2022-03-19 19:09:08 -04:00
<property name= "version.id" value= "5.2.3-SNAPSHOT" />
2021-10-24 19:10:05 -04:00
<property name= "release.rc" value= "" />
2009-11-21 10:30:54 -05:00
<property environment= "env" />
<!-- the repository to download jars from -->
2020-05-06 05:56:09 -04:00
<property name= "repository.m2" value= "https://repo1.maven.org/maven2" />
2019-04-07 03:17:52 -04:00
<property name= "repository.pentaho" value= "https://nexus.pentaho.org/" />
2009-11-21 10:30:54 -05:00
2020-05-05 09:36:30 -04:00
<property name= "main.lib" location= "${basedir}/lib/main" />
2020-05-28 15:49:23 -04:00
<property name= "main-tests.lib" location= "${basedir}/lib/main-tests" />
2020-05-05 09:36:30 -04:00
<property name= "ooxml.lib" location= "${basedir}/lib/ooxml" />
<property name= "ooxml-tests.lib" location= "${basedir}/lib/ooxml-tests" />
2020-07-22 18:08:33 -04:00
<property name= "ooxml-provided.lib" location= "${basedir}/lib/ooxml-provided" />
2021-02-23 17:29:51 -05:00
<property name= "ooxml-batik.lib" location= "${basedir}/lib/ooxml-batik" />
2020-05-05 09:36:30 -04:00
<property name= "util.lib" location= "${basedir}/lib/util" />
2018-07-18 19:24:53 -04:00
2009-11-21 10:30:54 -05:00
<!-- compiler options options -->
2017-09-15 14:39:18 -04:00
<property name= "jdk.version.source" value= "1.8" description= "JDK version of source code" />
<property name= "jdk.version.class" value= "1.8" description= "JDK version of generated class files" />
2009-11-21 10:30:54 -05:00
<property name= "compile.debug" value= "true" />
2018-12-10 11:18:49 -05:00
<condition property= "isIBMVM" >
<contains string= "${java.vendor}" substring= "IBM" casesensitive= "false" />
</condition>
2021-05-14 02:41:20 -04:00
<condition property= "isJava8" else= "false" >
2020-05-05 09:36:30 -04:00
<equals arg1= "${ant.java.version}" arg2= "1.8" />
</condition>
2019-01-24 15:35:18 -05:00
<!-- add addOpens parameter for Java 9 and higher -->
<condition property= "addOpens" >
2019-03-02 04:18:15 -05:00
<not > <matches pattern= "^1\..*" string= "${java.version}" /> </not>
2019-01-24 15:35:18 -05:00
</condition>
<!-- add addOpens parameter for Java 10 -->
<condition property= "addOpens10" >
2019-03-02 04:18:15 -05:00
<matches pattern= "^10\..*" string= "${java.version}" />
2019-01-24 15:35:18 -05:00
</condition>
2010-06-13 02:26:14 -04:00
<!-- issue warnings if source code contains unmappable characters for encoding ASCII -->
2017-02-08 03:29:18 -05:00
<property name= "java.source.encoding" value= "UTF-8" />
2010-06-13 02:26:14 -04:00
2020-09-21 20:07:32 -04:00
<macrodef name= "propertyreset" >
2015-08-07 19:33:30 -04:00
<attribute name= "name" />
<attribute name= "value" />
2020-09-21 20:07:32 -04:00
<sequential >
2021-04-07 17:40:33 -04:00
<mkdir dir= "poi-excelant/build/poi-ant-contrib" />
2021-04-10 08:29:13 -04:00
<javac srcdir= "poi-excelant/src/poi-ant-contrib/java" destdir= "poi-excelant/build/poi-ant-contrib" includeantruntime= "true" excludes= "Junit5Progress.java" />
2021-04-07 17:40:33 -04:00
<taskdef name= "PropertyResetHelper" classname= "PropertyReset" classpath= "poi-excelant/build/poi-ant-contrib" />
2020-09-21 20:07:32 -04:00
<PropertyResetHelper name= "@{name}" value= "@{value}" />
</sequential>
</macrodef>
2015-08-07 19:33:30 -04:00
2009-11-21 10:30:54 -05:00
<!--
JVM system properties for running tests,
user.language and user.country are required as we have locale-sensitive formatters
-->
2016-09-20 03:55:13 -04:00
<property name= "testpattern" value= "Test*" /> <!-- note: this excludes BaseTest* -->
2018-11-18 11:03:20 -05:00
<property name= "POI.testdata.path" location= "test-data" />
2009-11-21 10:30:54 -05:00
<property name= "java.awt.headless" value= "true" />
2019-01-24 15:35:18 -05:00
<property name= "java.locale.providers" value= "JRE,CLDR" />
2014-11-10 15:37:26 -05:00
<property name= "additionaljar" value= "" />
2015-08-07 19:33:30 -04:00
<propertyreset name= "user.language" value= "en" />
<propertyreset name= "user.country" value= "US" />
<condition property= "http_proxy" value= "${env.http_proxy}" else= "" >
<isset property= "env.http_proxy" />
</condition>
<!-- Fix for strange woodstox references in gump build -->
<property name= "javax.xml.stream.XMLInputFactory" value= "com.sun.xml.internal.stream.XMLInputFactoryImpl" />
2017-11-21 12:32:48 -05:00
<property name= "tempdir" value= "build/tmp" />
2016-07-02 18:09:00 -04:00
2009-11-21 10:30:54 -05:00
<!-- Main: -->
2021-04-07 17:40:33 -04:00
<property name= "main.resources.main" value= "poi/src/main/resources" />
<property name= "main.src" location= "poi/src/main/java" />
<property name= "main.src.test" location= "poi/src/test/java" />
<property name= "main.resources.test" location= "poi/src/test/resources" />
2009-11-21 10:30:54 -05:00
<property name= "main.documentation" value= "src/documentation" />
2021-04-07 17:40:33 -04:00
<property name= "main.output.dir" location= "poi/build/classes/ant/java" />
<property name= "main.output.test.dir" location= "poi/build/test-classes" />
<property name= "main.reports.test" location= "poi/build/test-results" />
<property name= "main.testokfile" location= "poi/build/testokfile.txt" />
<property name= "main.output.gen-sources.dir" location= "poi/build/generated-sources" />
<property name= "main.version.template" location= "poi/src/main/version/Version.java.template" />
2021-03-27 10:03:16 -04:00
<property name= "main.version.java" location= "${main.output.gen-sources.dir}/org/apache/poi/Version.java" />
2009-11-21 10:30:54 -05:00
<!-- Scratchpad: -->
2021-04-07 17:40:33 -04:00
<property name= "scratchpad.resources.main" value= "poi-scratchpad/src/main/resources" />
<property name= "scratchpad.src" location= "poi-scratchpad/src/main/java" />
<property name= "scratchpad.src.test" location= "poi-scratchpad/src/test/java" />
<property name= "scratchpad.resources.test" location= "poi-scratchpad/src/main/resources" />
<property name= "scratchpad.reports.test" location= "poi-scratchpad/build/test-results" />
<property name= "scratchpad.output.dir" location= "poi-scratchpad/build/classes/ant/java" />
<property name= "scratchpad.output.test.dir" location= "poi-scratchpad/build/test-classes" />
<property name= "scratchpad.testokfile" location= "poi-scratchpad/build/testokfile.txt" />
2015-08-07 19:33:30 -04:00
2009-11-21 10:30:54 -05:00
<!-- Examples: -->
2021-04-07 17:40:33 -04:00
<property name= "examples.src" location= "poi-examples/src/main/java" />
<property name= "examples.output.dir" location= "poi-examples/build/classes/ant/java" />
2009-11-21 10:30:54 -05:00
<!-- OOXML support: -->
2021-04-07 17:40:33 -04:00
<property name= "ooxml.src" location= "poi-ooxml/src/main/java" />
<property name= "ooxml.resources.main" value= "poi-ooxml/src/main/resources" />
<property name= "ooxml.src.test" location= "poi-ooxml/src/test/java" />
<property name= "ooxml.resources.test" location= "poi-ooxml/src/test/resources" />
<property name= "ooxml.reports.test" location= "poi-ooxml/build/test-results" />
<property name= "ooxml.output.dir" location= "poi-ooxml/build/classes/ant/java" />
<property name= "ooxml.output.test.dir" location= "poi-ooxml/build/test-classes" />
<property name= "ooxml.testokfile" location= "poi-ooxml/build/testokfile.txt" />
<property name= "ooxml.lite.agent" location= "build/dist/maven/poi-ooxml-lite-agent/poi-ooxml-lite-agent-${version.id}.jar" />
2022-03-24 00:42:27 -04:00
<property name= "ooxml.lite.report" location= "src/resources/ooxml-lite-report" />
2020-12-13 10:32:43 -05:00
<property name= "ooxml.lite.jar" location= "build/dist/maven/poi-ooxml-lite/poi-ooxml-lite-${version.id}.jar" />
2020-06-20 09:57:01 -04:00
<property name= "ooxml.lite.includes" value= "^(com/microsoft/schemas|org/(etsi|openxmlformats|w3/)|org/apache/poi/schemas)" />
2021-04-07 17:40:33 -04:00
<property name= "ooxml.lite.output.dir" location= "poi-ooxml-lite-agent/build/classes/ant/java" />
2018-11-17 19:01:40 -05:00
2009-11-21 10:30:54 -05:00
2016-01-04 15:43:16 -05:00
<!-- Integration testing: -->
2021-04-07 17:40:33 -04:00
<property name= "integration.src.test" location= "poi-integration/src/test/java" />
<property name= "integration.resources.test" location= "poi-integration/src/test/resources" />
<property name= "integration.reports.test" location= "poi-integration/build/test-results" />
<property name= "integration.output.test.dir" location= "poi-integration/build/test-classes" />
<property name= "integration.testokfile" location= "poi-integration/build/testokfile.txt" />
2014-12-25 04:16:44 -05:00
2011-02-18 15:04:50 -05:00
<!-- Excelant: -->
2021-04-07 17:40:33 -04:00
<property name= "excelant.resource.main" value= "poi-excelant/src/main/resources" />
<property name= "excelant.src" location= "poi-excelant/src/main/java" />
<property name= "excelant.src.test" location= "poi-excelant/src/test/java" />
<property name= "excelant.resources.test" location= "poi-excelant/src/test/resources" />
<property name= "excelant.reports.test" location= "poi-excelant/build/test-results" />
<property name= "excelant.output.dir" location= "poi-excelant/build/classes/ant/java" />
<property name= "excelant.output.test.dir" location= "poi-excelant/build/test-classes" />
<property name= "excelant.testokfile" location= "poi-excelant/build/testokfile.txt" />
2011-02-18 15:04:50 -05:00
2020-07-22 18:08:33 -04:00
<macrodef name= "dependency" >
2020-05-05 09:36:30 -04:00
<attribute name= "prefix" />
<attribute name= "artifact" />
<attribute name= "usage" />
2020-07-22 18:08:33 -04:00
<attribute name= "packaging" default= "jar" />
<attribute name= "repo" default= "${repository.m2}" />
<attribute name= "snapshot" default= "" />
<attribute name= "query" default= "" />
<attribute name= "target" default= "" />
<attribute name= "url" default= "" />
<sequential >
<local name= "groupDir" />
<loadresource property= "groupDir" >
<string > @{artifact}</string>
<filterchain >
<replaceregex pattern= "([^:]+).*" replace= "\1" />
<replaceregex pattern= "\." replace= "/" flags= "g" />
</filterchain>
</loadresource>
<local name= "artifactId" />
<loadresource property= "artifactId" >
<string > @{artifact}</string>
<filterchain >
<replaceregex pattern= "[^:]+:([^:]+).*" replace= "\1" />
</filterchain>
</loadresource>
<local name= "versionDir" />
<loadresource property= "versionDir" >
<string > @{artifact}</string>
<filterchain >
2020-08-18 09:50:31 -04:00
<replaceregex pattern= "[^:]+:[^:]+:([^:]+).*" replace= "\1" />
2020-07-22 18:08:33 -04:00
</filterchain>
</loadresource>
2020-08-18 09:50:31 -04:00
<local name= "classifier" />
<loadresource property= "classifier" >
<string > @{artifact}</string>
<filterchain >
<replaceregex pattern= "[^:]+:[^:]+:[^:]+:?([^:]*)" replace= "\1" />
<replaceregex pattern= "(.+)" replace= "-\1" />
</filterchain>
</loadresource>
<property name= "classifier" value= "" />
2020-07-22 18:08:33 -04:00
<local name= "version" />
<property name= "version" value= "${versionDir}" if:blank= "@{snapshot}" />
<property name= "version" value= "@{snapshot}" />
<local name= "usageDir" />
<loadresource property= "usageDir" >
<string > @{usage}</string>
<filterchain >
<replaceregex pattern= "^([^/])" replace= "/lib/\1" />
<prefixlines prefix= "${basedir}" />
</filterchain>
</loadresource>
2020-08-18 09:50:31 -04:00
<local name= "jarName" />
<property name= "jarName" value= "${artifactId}-${version}${classifier}.@{packaging}" />
<!-- delete old versions -->
<delete failonerror= "false" >
<fileset dir= "${usageDir}" excludes= "${jarName}" >
<filename regex= "^${artifactId}-[0-9].*${classifier}\.@{packaging}" />
</fileset>
</delete>
2020-07-22 18:08:33 -04:00
<local name= "jarLoc" />
<property name= "jarLoc" value= "${usageDir}/@{target}" unless:blank= "@{target}" />
2020-08-18 09:50:31 -04:00
<property name= "jarLoc" value= "${usageDir}/${jarName}" />
2020-07-22 18:08:33 -04:00
<local name= "urlLoc" />
<property name= "urlLoc" value= "@{url}" unless:blank= "@{url}" />
2020-08-18 09:50:31 -04:00
<property name= "urlLoc" value= "@{repo}/${groupDir}/${artifactId}/${versionDir}/${jarName}@{query}" />
2020-07-22 18:08:33 -04:00
<property name= "@{prefix}.@{packaging}" value= "${jarLoc}" />
<property name= "@{prefix}.url" value= "${urlLoc}" />
<!-- TODO: add library to a queue for downloading ... -->
</sequential>
</macrodef>
2020-05-05 09:36:30 -04:00
2009-11-21 10:30:54 -05:00
<!-- jars in the /lib directory, see the fetch - jars target -->
2020-10-22 18:51:31 -04:00
<dependency prefix= "main.commons-codec" artifact= "commons-codec:commons-codec:1.15" usage= "main" />
2020-05-05 09:36:30 -04:00
<dependency prefix= "main.commons-collections4" artifact= "org.apache.commons:commons-collections4:4.4" usage= "main" />
<dependency prefix= "main.commons-math3" artifact= "org.apache.commons:commons-math3:3.6.1" usage= "main" />
2021-07-14 03:15:15 -04:00
<dependency prefix= "main.commons-io" artifact= "commons-io:commons-io:2.11.0" usage= "main" />
2020-05-05 09:36:30 -04:00
<dependency prefix= "main.com.zaxxer" artifact= "com.zaxxer:SparseBitSet:1.2" usage= "main" />
2022-07-03 18:52:21 -04:00
<dependency prefix= "main.log4j-api" artifact= "org.apache.logging.log4j:log4j-api:2.18.0" usage= "main" />
2020-05-05 09:36:30 -04:00
2021-11-29 10:40:16 -05:00
<dependency prefix= "main.junit-api" artifact= "org.junit.jupiter:junit-jupiter-api:5.8.2" usage= "main-tests" />
<dependency prefix= "main.junit-jengine" artifact= "org.junit.jupiter:junit-jupiter-engine:5.8.2" usage= "main-tests" />
<dependency prefix= "main.junit-params" artifact= "org.junit.jupiter:junit-jupiter-params:5.8.2" usage= "main-tests" />
2020-12-24 13:42:29 -05:00
<dependency prefix= "main.junit-opentest4j" artifact= "org.opentest4j:opentest4j:1.2.0" usage= "main-tests" />
<dependency prefix= "main.junit-apiguardian" artifact= "org.apiguardian:apiguardian-api:1.1.0" usage= "main-tests" />
2021-11-02 09:18:20 -04:00
<dependency prefix= "main.junit-pcommons" artifact= "org.junit.platform:junit-platform-commons:1.8.1" usage= "main-tests" />
<dependency prefix= "main.junit-pengine" artifact= "org.junit.platform:junit-platform-engine:1.8.1" usage= "main-tests" />
<dependency prefix= "main.junit-plauncher" artifact= "org.junit.platform:junit-platform-launcher:1.8.1" usage= "main-tests" />
2020-12-24 13:42:29 -05:00
2022-03-28 10:55:32 -04:00
<dependency prefix= "main.jmh" artifact= "org.openjdk.jmh:jmh-core:1.35" usage= "main-tests" />
<dependency prefix= "main.jmhAnnotation" artifact= "org.openjdk.jmh:jmh-generator-annprocess:1.35" usage= "main-tests" />
2020-08-18 09:50:31 -04:00
<dependency prefix= "main.hamcrest" artifact= "org.hamcrest:hamcrest:2.2" usage= "main-tests" />
2022-01-26 07:59:23 -05:00
<dependency prefix= "main.xmlunit" artifact= "org.xmlunit:xmlunit-core:2.9.0" usage= "main-tests" />
2022-06-03 05:16:40 -04:00
<dependency prefix= "main.mockito" artifact= "org.mockito:mockito-core:4.6.1" usage= "main-tests" />
2021-12-03 07:48:31 -05:00
<dependency prefix= "main.byte-buddy" artifact= "net.bytebuddy:byte-buddy:1.12.3" usage= "main-tests" />
<dependency prefix= "main.byte-buddy-agent" artifact= "net.bytebuddy:byte-buddy-agent:1.12.3" usage= "main-tests" />
2020-08-18 09:50:31 -04:00
<dependency prefix= "main.objenesis" artifact= "org.objenesis:objenesis:3.1" usage= "main-tests" />
2022-07-03 18:52:21 -04:00
<dependency prefix= "main.log4j-core" artifact= "org.apache.logging.log4j:log4j-core:2.18.0" usage= "main-tests" />
2021-02-21 15:57:25 -05:00
<dependency prefix= "main.commons-logging" artifact= "commons-logging:commons-logging:1.2" usage= "main-tests" />
2020-05-05 09:36:30 -04:00
2020-11-11 16:53:05 -05:00
<dependency prefix= "main.ant" artifact= "org.apache.ant:ant:1.10.9" usage= "excelant" />
<dependency prefix= "main.antlauncher" artifact= "org.apache.ant:ant-launcher:1.10.9" usage= "excelant" />
2020-05-05 09:36:30 -04:00
<!-- xml signature libs - not part of the distribution -->
2022-05-03 14:57:00 -04:00
<dependency prefix= "dsig.xmlsec" artifact= "org.apache.santuario:xmlsec:3.0.0" usage= "ooxml-provided" />
2021-12-01 07:53:48 -05:00
<dependency prefix= "dsig.bouncycastle-prov" artifact= "org.bouncycastle:bcprov-jdk15on:1.70" usage= "ooxml-provided" />
<dependency prefix= "dsig.bouncycastle-pkix" artifact= "org.bouncycastle:bcpkix-jdk15on:1.70" usage= "ooxml-provided" />
<dependency prefix= "dsig.bouncycastle-util" artifact= "org.bouncycastle:bcutil-jdk15on:1.70" usage= "ooxml-provided" />
2020-08-18 09:50:31 -04:00
<!-- only used for signing the release - not used with the ooxml signatures -->
2021-12-01 07:53:48 -05:00
<dependency prefix= "dsig.bouncycastle-bcpg" artifact= "org.bouncycastle:bcpg-jdk15on:1.70" usage= "util" />
2015-08-07 19:33:30 -04:00
2021-02-21 19:18:37 -05:00
<!-- 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.4" usage= "ooxml-batik" />
<dependency prefix= "svg.batik-anim" artifact= "org.apache.xmlgraphics:batik-anim:1.14" usage= "ooxml-batik" />
<dependency prefix= "svg.batik-awt-util" artifact= "org.apache.xmlgraphics:batik-awt-util:1.14" usage= "ooxml-batik" />
<dependency prefix= "svg.batik-bridge" artifact= "org.apache.xmlgraphics:batik-bridge:1.14" usage= "ooxml-batik" />
<dependency prefix= "svg.batik-codec" artifact= "org.apache.xmlgraphics:batik-codec:1.14" usage= "ooxml-batik" />
<dependency prefix= "svg.batik-constants" artifact= "org.apache.xmlgraphics:batik-constants:1.14" usage= "ooxml-batik" />
<dependency prefix= "svg.batik-css" artifact= "org.apache.xmlgraphics:batik-css:1.14" usage= "ooxml-batik" />
<dependency prefix= "svg.batik-dom" artifact= "org.apache.xmlgraphics:batik-dom:1.14" usage= "ooxml-batik" />
<dependency prefix= "svg.batik-ext" artifact= "org.apache.xmlgraphics:batik-ext:1.14" usage= "ooxml-batik" />
<dependency prefix= "svg.batik-gvt" artifact= "org.apache.xmlgraphics:batik-gvt:1.14" usage= "ooxml-batik" />
<dependency prefix= "svg.batik-i18n" artifact= "org.apache.xmlgraphics:batik-i18n:1.14" usage= "ooxml-batik" />
<dependency prefix= "svg.batik-parser" artifact= "org.apache.xmlgraphics:batik-parser:1.14" usage= "ooxml-batik" />
2021-05-14 07:38:31 -04:00
<dependency prefix= "svg.batik-script" artifact= "org.apache.xmlgraphics:batik-script:1.14" usage= "ooxml-batik" />
2021-02-21 19:18:37 -05:00
<dependency prefix= "svg.batik-shared-resources" artifact= "org.apache.xmlgraphics:batik-shared-resources:1.14" usage= "ooxml-batik" />
<dependency prefix= "svg.batik-svg-dom" artifact= "org.apache.xmlgraphics:batik-svg-dom:1.14" usage= "ooxml-batik" />
<dependency prefix= "svg.batik-svggen" artifact= "org.apache.xmlgraphics:batik-svggen:1.14" usage= "ooxml-batik" />
<dependency prefix= "svg.batik-svgrasterizer" artifact= "org.apache.xmlgraphics:batik-svgrasterizer:1.14" usage= "ooxml-batik" />
<dependency prefix= "svg.batik-transcoder" artifact= "org.apache.xmlgraphics:batik-transcoder:1.14" usage= "ooxml-batik" />
<dependency prefix= "svg.batik-util" artifact= "org.apache.xmlgraphics:batik-util:1.14" usage= "ooxml-batik" />
<dependency prefix= "svg.batik-xml" artifact= "org.apache.xmlgraphics:batik-xml:1.14" usage= "ooxml-batik" />
2022-04-22 19:43:58 -04:00
<dependency prefix= "pdf.pdfbox" artifact= "org.apache.pdfbox:pdfbox:2.0.26" usage= "ooxml-provided" />
<dependency prefix= "pdf.fontbox" artifact= "org.apache.pdfbox:fontbox:2.0.26" usage= "ooxml-provided" />
<dependency prefix= "pdf.graphics2d" artifact= "de.rototor.pdfbox:graphics2d:0.38" usage= "ooxml-provided" />
2018-12-16 09:55:23 -05:00
2018-09-18 18:09:15 -04:00
<!-- jars in the ooxml - lib directory, see the fetch - ooxml - jars target -->
2022-02-28 08:24:31 -05:00
<dependency prefix= "ooxml.curvesapi" artifact= "com.github.virtuald:curvesapi:1.07" usage= "ooxml" />
2022-06-16 20:19:12 -04:00
<dependency prefix= "ooxml.xmlbeans" artifact= "org.apache.xmlbeans:xmlbeans:5.1.0" usage= "ooxml" />
2021-07-14 14:57:24 -04:00
<dependency prefix= "ooxml.commons-compress" artifact= "org.apache.commons:commons-compress:1.21" usage= "ooxml" />
2015-08-07 19:33:30 -04:00
2018-09-18 18:09:15 -04:00
<!-- jars in the ooxml - test - lib directory, see the fetch - ooxml - jars target -->
2021-10-25 17:03:10 -04:00
<dependency prefix= "ooxml.test.reflections" artifact= "org.reflections:reflections:0.10.2" usage= "ooxml-tests" />
2022-03-01 16:43:08 -05:00
<dependency prefix= "ooxml.test.guava" artifact= "com.google.guava:guava:31.1-jre" usage= "ooxml-tests" />
2020-08-18 09:50:31 -04:00
<dependency prefix= "ooxml.test.javassist" artifact= "org.javassist:javassist:3.27.0-GA" usage= "ooxml-tests" />
2022-02-08 09:48:30 -05:00
<dependency prefix= "ooxml.test.slf4j-api" artifact= "org.slf4j:slf4j-api:1.7.36" usage= "ooxml-tests" />
2022-02-06 16:08:19 -05:00
<dependency prefix= "ooxml.test.opczip" artifact= "com.github.rzymek:opczip:1.2.0" usage= "ooxml-tests" />
2018-09-18 18:09:15 -04:00
2013-08-04 12:38:01 -04:00
<!-- coverage libs -->
2020-09-25 15:39:49 -04:00
<dependency prefix= "jacoco" artifact= "org.jacoco:jacoco:0.8.6" usage= "util" packaging= "zip" />
2020-11-11 16:53:05 -05:00
<dependency prefix= "asm" artifact= "org.ow2.asm:asm:9.0" usage= "util" />
<dependency prefix= "asm-commons" artifact= "org.ow2.asm:asm-commons:9.0" usage= "util" />
<dependency prefix= "asm-tree" artifact= "org.ow2.asm:asm-tree:9.0" usage= "util" />
2015-08-07 19:33:30 -04:00
2015-08-27 09:14:46 -04:00
<!-- license and api checks -->
2020-08-18 09:50:31 -04:00
<dependency prefix= "rat" artifact= "org.apache.rat:apache-rat:0.13" usage= "util" />
2022-04-01 17:17:07 -04:00
<dependency prefix= "forbidden" artifact= "de.thetaphi:forbiddenapis:3.3" usage= "util" />
2014-01-20 14:25:22 -05:00
2019-04-22 15:32:11 -04:00
<!-- See https://www.ecma - international.org/publications/standards/Ecma - 376.htm -->
2009-11-21 10:30:54 -05:00
<!-- "Copy these file(s), free of charge" -->
2021-04-07 17:40:33 -04:00
<property name= "ooxml-schema.output.dir" location= "poi-ooxml-full/build/classes/ant/java" />
<property name= "ooxml-schema.output.test.dir" location= "poi-ooxml-full/build/test-classes" />
<property name= "ooxml-schema.output.gen-sources.dir" location= "poi-ooxml-full/build/generated-sources" />
<property name= "ooxml-schema.output.gen-classes.dir" location= "poi-ooxml-full/build/generated-classes" />
<property name= "ooxml.xsds.izip.1" value= "${basedir}/poi-ooxml-full/src/main/xmlschema/org/apache/poi/schemas/OfficeOpenXML-XMLSchema-Transitional.zip" />
<property name= "ooxml.xsds.src.dir" location= "poi-ooxml-full/build/xsds" />
2020-12-13 10:32:43 -05:00
<property name= "ooxml.xsds.src.jar" location= "build/dist/maven/poi-ooxml-full/poi-ooxml-full-${version.id}-sources.jar" />
<property name= "ooxml.xsds.jar" location= "build/dist/maven/poi-ooxml-full/poi-ooxml-full-${version.id}.jar" />
2009-11-21 10:30:54 -05:00
2015-05-28 07:00:32 -04:00
<!-- additional schemas are packed into the poi schemas jar, -->
2020-12-12 18:15:20 -05:00
<!-- so we don't have to care about a separate versioning of the original ooxml schemas -->
2021-04-07 17:40:33 -04:00
<property name= "ooxml.xsds.izip.2" value= "${basedir}/poi-ooxml-full/src/main/xmlschema/org/apache/poi/schemas/OpenPackagingConventions-XMLSchema.zip" />
<property name= "ooxml.security.xsd.dir" location= "poi-ooxml-full/src/main/xmlschema/org/apache/poi/poifs/crypt" />
<property name= "ooxml.visio.xsd.dir" location= "poi-ooxml-full/src/main/xmlschema/org/apache/poi/xdgf" />
<property name= "ooxml.schema.xsdconfig.dir" location= "poi-ooxml-full/src/main/xmlschema/org/apache/poi/schemas" />
2015-11-21 14:37:26 -05:00
2013-08-04 12:38:01 -04:00
<!-- Coverage -->
<property name= "coverage.dir" value= "build/coverage" />
<!-- Exclude some uninteresting classes from coverage - instrumentation as we do not want to measure coverage in those packages anyway -->
2021-02-21 15:57:25 -05:00
<property name= "coverage.excludes" value= "org.openxmlformats.*:com.*:org.junit.*:junit.*:org.etsi.*:org.w3.*:org.slf4j.*:org.apache.logging.log4j.*:org.hamcrest.*:org.bouncycastle.*:org.apache.xmlbeans.*:org.apache.tools.*:org.apache.commons.*:org.apache.jcp.*:sun.*:schemaorg_apache_xmlbeans.*" />
2019-12-09 17:53:14 -05:00
2016-12-30 13:37:24 -05:00
<property name= "file.leak.detector" value= "-Dthis.is.a.dummy=true" />
2015-08-07 19:33:30 -04:00
2014-01-20 14:25:22 -05:00
<!-- Apache RAT license check properties -->
<property name= "rat.reportdir" value= "build/rat" />
2015-08-07 19:33:30 -04:00
<property name= "rat.report" value= "${rat.reportdir}/report.txt" />
2014-01-20 14:25:22 -05:00
2009-11-21 10:30:54 -05:00
<!-- build and distro settings -->
<property name= "jar.name" value= "poi" />
2018-07-18 19:24:53 -04:00
<property name= "build.site" location= "build/site" />
2018-10-30 07:00:35 -04:00
<property name= "javadocs.report.dir" location= "${build.site}/apidocs/dev" />
2009-11-21 10:30:54 -05:00
<property name= "dist.dir" location= "build/dist" />
<property name= "halt.on.test.failure" value= "true" />
2019-04-05 11:09:24 -04:00
<!-- helper jars for pgp signing, building and nexus staging -->
2020-05-05 09:36:30 -04:00
<dependency prefix= "dist.commons-openpgp" artifact= "org.apache.commons:commons-openpgp:1.0-SNAPSHOT" usage= "util"
repo="https://repository.apache.org/content/groups/snapshots" snapshot="1.0-20190121.221905-12"/>
2020-08-18 09:50:31 -04:00
<dependency prefix= "dist.nexus-staging" artifact= "org.sonatype.nexus.ant:nexus-staging-ant-tasks:1.6.3:uber" usage= "util" />
2020-05-05 09:36:30 -04:00
2019-04-07 03:17:52 -04:00
<!-- jars required for maven helper targets -->
2020-05-05 09:36:30 -04:00
<dependency prefix= "maven.ant" artifact= "org.apache.maven:maven-ant-tasks:2.1.3" usage= "util" />
2020-08-18 09:50:31 -04:00
<!-- subclipse.tigris.org is gone - left - over is hosted at https://bintray.com/openmeetings/maven/org.tigris.subclipse.svnant -->
<!-- request will be forwarded to d29vzk4ow07wi7.cloudfront.net which is an Atlassian Marketplace instance -->
2020-05-05 09:36:30 -04:00
<dependency prefix= "dist.svnant" artifact= "org.tigris.subclipse:svnant:1.3.1" usage= "util"
repo="https://dl.bintray.com/openmeetings/maven"/>
2020-08-18 09:50:31 -04:00
<!-- hosted at https://bintray.com/subclipse/maven/svnclientadapter - https://github.com/subclipse/svnclientadapter -->
<dependency prefix= "dist.svnclientadapter-base" artifact= "org.tigris.svnclientadapter:adapter-base:1.12.0" usage= "util"
repo="https://dl.bintray.com/subclipse/maven"/>
<dependency prefix= "dist.svnclientadapter-svnkit" artifact= "org.tigris.svnclientadapter:adapter-svnkit:1.12.0" usage= "util"
repo="https://dl.bintray.com/subclipse/maven"/>
<dependency prefix= "dist.svnclientadapter-javahl" artifact= "org.tigris.svnclientadapter:adapter-javahl:1.12.0" usage= "util"
repo="https://dl.bintray.com/subclipse/maven"/>
<dependency prefix= "dist.svnkit" artifact= "org.tmatesoft.svnkit:svnkit:1.10.1" usage= "util" />
<dependency prefix= "dist.svnkit-javahl16" artifact= "org.tmatesoft.svnkit:svnkit-javahl16:1.10.1" usage= "util" />
<dependency prefix= "dist.sqljet" artifact= "org.tmatesoft.sqljet:sqljet:1.1.13" usage= "util" />
2020-05-05 09:36:30 -04:00
<dependency prefix= "dist.antlr" artifact= "org.antlr:antlr-runtime:3.5.2" usage= "util" />
2020-08-18 09:50:31 -04:00
<dependency prefix= "dist.sequence-library" artifact= "de.regnis.q.sequence:sequence-library:1.0.4" usage= "util" />
2021-01-12 17:39:07 -05:00
<dependency prefix= "dist.lz4-java" artifact= "org.lz4:lz4-java:1.7.1" usage= "util" />
2020-05-06 09:48:25 -04:00
2016-06-11 17:23:01 -04:00
2009-11-21 10:30:54 -05:00
<propertyset id= "junit.properties" >
<propertyref name= "POI.testdata.path" />
<propertyref name= "java.awt.headless" />
2014-11-10 15:37:26 -05:00
<propertyref name= "http_proxy" />
2015-08-07 19:33:30 -04:00
<propertyref name= "additionaljar" />
<propertyref name= "user.language" />
<propertyref name= "user.country" />
<propertyref name= "javax.xml.stream.XMLInputFactory" />
2018-11-18 17:09:44 -05:00
<!-- required for Java 9 compilation -->
<propertyref name= "java.locale.providers" />
<!-- to detect if we are running on slow Gump VM -->
<propertyref name= "version.id" />
<propertyref name= "scratchpad.ignore" />
2009-11-21 10:30:54 -05:00
</propertyset>
2016-07-02 18:09:00 -04:00
2003-04-23 20:53:41 -04:00
<path id= "main.classpath" >
2011-05-10 06:38:17 -04:00
<pathelement location= "${main.commons-codec.jar}" />
2017-06-09 08:49:01 -04:00
<pathelement location= "${main.commons-collections4.jar}" />
2017-09-13 19:54:36 -04:00
<pathelement location= "${main.commons-math3.jar}" />
2021-05-13 20:37:50 -04:00
<pathelement location= "${main.commons-io.jar}" />
2020-01-07 10:45:07 -05:00
<pathelement location= "${main.com.zaxxer.jar}" />
2021-02-21 15:57:25 -05:00
<pathelement location= "${main.log4j-api.jar}" />
2017-06-09 08:49:01 -04:00
</path>
<!-- some libraries should only be required for compiling/running tests -->
<path id= "test.jar.classpath" >
2020-12-24 13:42:29 -05:00
<pathelement location= "${main.junit-api.jar}" />
<pathelement location= "${main.junit-jengine.jar}" />
<pathelement location= "${main.junit-params.jar}" />
<pathelement location= "${main.junit-plauncher.jar}" />
<pathelement location= "${main.junit-pengine.jar}" />
<pathelement location= "${main.junit-pcommons.jar}" />
<pathelement location= "${main.junit-opentest4j.jar}" />
<pathelement location= "${main.junit-apiguardian.jar}" />
2017-05-15 19:27:21 -04:00
<pathelement location= "${main.jmh.jar}" />
<pathelement location= "${main.jmhAnnotation.jar}" />
2013-06-30 16:49:51 -04:00
<pathelement location= "${main.hamcrest.jar}" />
2018-03-04 07:24:44 -05:00
<pathelement location= "${main.xmlunit.jar}" />
2018-01-29 10:21:59 -05:00
<pathelement location= "${main.mockito.jar}" />
2018-01-30 07:57:47 -05:00
<pathelement location= "${main.byte-buddy.jar}" />
<pathelement location= "${main.byte-buddy-agent.jar}" />
<pathelement location= "${main.objenesis.jar}" />
2021-02-21 15:57:25 -05:00
<pathelement location= "${main.log4j-core.jar}" />
<pathelement location= "${main.commons-logging.jar}" />
2008-01-21 13:00:30 -05:00
</path>
2003-04-23 20:53:41 -04:00
<path id= "scratchpad.classpath" >
<path refid= "main.classpath" />
<pathelement location= "${main.output.dir}" />
</path>
2014-09-29 19:39:45 -04:00
<path id= "ooxml.xmlsec.classpath" >
<pathelement location= "${dsig.xmlsec.jar}" />
<pathelement location= "${dsig.bouncycastle-prov.jar}" />
<pathelement location= "${dsig.bouncycastle-pkix.jar}" />
2021-06-28 15:52:52 -04:00
<pathelement location= "${dsig.bouncycastle-util.jar}" />
2014-09-29 19:39:45 -04:00
</path>
2018-07-13 13:51:55 -04:00
<path id= "ooxml.base.classpath" >
2015-10-19 01:59:42 -04:00
<pathelement location= "${ooxml.curvesapi.jar}" />
2018-06-10 12:39:24 -04:00
<pathelement location= "${ooxml.xmlbeans.jar}" />
2018-06-03 18:09:11 -04:00
<pathelement location= "${ooxml.commons-compress.jar}" />
2007-12-26 12:39:15 -05:00
<path refid= "main.classpath" />
2008-11-08 08:21:42 -05:00
<pathelement location= "${main.output.dir}" />
2019-02-13 13:37:20 -05:00
<pathelement location= "${ooxml.test.guava.jar}" />
2022-02-06 16:08:19 -05:00
<pathelement location= "${ooxml.test.opczip.jar}" />
2015-05-28 07:00:32 -04:00
<!-- classes are omitted on test cases outside the xml - dsign area to avoid classpath poisioning -->
2014-10-18 19:19:49 -04:00
<!-- path refid="ooxml.xmlsec.classpath"/ -->
2015-05-28 07:17:41 -04:00
<!-- Used only for ExtractorFactory, see #57963 -->
2016-11-28 19:46:39 -05:00
<pathelement location= "${scratchpad.output.dir}" unless:true= "${scratchpad.ignore}" />
2007-12-26 12:39:15 -05:00
</path>
2018-12-16 09:55:23 -05:00
<path id= "batik.classpath" >
2021-02-21 19:18:37 -05:00
<pathelement location= "${svg.batik-anim.jar}" />
<pathelement location= "${svg.batik-awt-util.jar}" />
<pathelement location= "${svg.batik-bridge.jar}" />
<pathelement location= "${svg.batik-codec.jar}" />
<pathelement location= "${svg.batik-constants.jar}" />
<pathelement location= "${svg.batik-css.jar}" />
<pathelement location= "${svg.batik-dom.jar}" />
<pathelement location= "${svg.batik-ext.jar}" />
<pathelement location= "${svg.batik-gvt.jar}" />
<pathelement location= "${svg.batik-i18n.jar}" />
<pathelement location= "${svg.batik-parser.jar}" />
2021-05-14 07:38:31 -04:00
<pathelement location= "${svg.batik-script.jar}" />
2021-02-21 19:18:37 -05:00
<pathelement location= "${svg.batik-shared-resources.jar}" />
<pathelement location= "${svg.batik-svg-dom.jar}" />
<pathelement location= "${svg.batik-svggen.jar}" />
<pathelement location= "${svg.batik-svgrasterizer.jar}" />
<pathelement location= "${svg.batik-transcoder.jar}" />
<pathelement location= "${svg.batik-util.jar}" />
<pathelement location= "${svg.batik-xml.jar}" />
2018-12-16 09:55:23 -05:00
<pathelement location= "${svg.xml-apis-ext.jar}" />
<pathelement location= "${svg.xmlgraphics-commons.jar}" />
</path>
2020-11-02 18:56:27 -05:00
<path id= "pdfbox.classpath" >
<pathelement location= "${pdf.pdfbox.jar}" />
<pathelement location= "${pdf.fontbox.jar}" />
<pathelement location= "${pdf.graphics2d.jar}" />
</path>
2018-07-13 13:51:55 -04:00
<path id= "ooxml.classpath" >
2020-07-22 18:08:33 -04:00
<pathelement location= "${ooxml.xsds.jar}" />
2018-07-13 13:51:55 -04:00
<path refid= "ooxml.base.classpath" />
2018-12-16 09:55:23 -05:00
<path refid= "batik.classpath" />
2020-11-02 18:56:27 -05:00
<path refid= "pdfbox.classpath" />
2018-07-13 13:51:55 -04:00
</path>
<path id= "ooxml.lite.verify.classpath" >
2020-12-13 10:32:43 -05:00
<pathelement location= "build/dist/maven/poi-ooxml-lite/poi-ooxml-lite-${version.id}.jar" />
2018-07-13 13:51:55 -04:00
<path refid= "ooxml.base.classpath" />
</path>
2018-09-18 19:25:49 -04:00
<path id= "test.ooxml.reflections.classpath" >
<pathelement location= "${ooxml.test.reflections.jar}" />
<pathelement location= "${ooxml.test.guava.jar}" />
<pathelement location= "${ooxml.test.javassist.jar}" />
</path>
2018-07-13 13:51:55 -04:00
<path id= "test.ooxml.lite.verify.classpath" >
<path refid= "ooxml.lite.verify.classpath" />
<path refid= "ooxml.xmlsec.classpath" />
<path refid= "test.jar.classpath" />
<pathelement location= "${ooxml.output.dir}" />
<pathelement location= "${ooxml.output.test.dir}" />
<pathelement location= "${main.output.test.dir}" />
<pathelement location= "${additionaljar}" />
</path>
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642566,642568-642574,642576 via svnmerge from
https://svn.apache.org/repos/asf/poi/trunk
........
r642566 | nick | 2008-03-29 17:45:28 +0000 (Sat, 29 Mar 2008) | 1 line
Move the missing record aware eventusermodel code out of scratchpad
........
r642571 | nick | 2008-03-29 18:11:48 +0000 (Sat, 29 Mar 2008) | 1 line
Merge several bug tests into one file
........
r642574 | nick | 2008-03-29 18:23:33 +0000 (Sat, 29 Mar 2008) | 1 line
Move the FormulaEvaluator code out of scratchpad
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642591 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 15:36:53 -04:00
<path id= "examples.classpath" >
<path refid= "main.classpath" />
<pathelement location= "${main.output.dir}" />
2016-11-29 17:41:26 -05:00
<pathelement location= "${scratchpad.output.dir}" unless:true= "${scratchpad.ignore}" />
Merged revisions 638786-638802,638805-638811,638813-638814,638816-639230,639233-639241,639243-639253,639255-639486,639488-639601,639603-639835,639837-639917,639919-640056,640058-640710,640712-641156,641158-641184,641186-641795,641797-641798,641800-641933,641935-641963,641965-641966,641968-641995,641997-642230,642232-642562,642564-642566,642568-642574,642576 via svnmerge from
https://svn.apache.org/repos/asf/poi/trunk
........
r642566 | nick | 2008-03-29 17:45:28 +0000 (Sat, 29 Mar 2008) | 1 line
Move the missing record aware eventusermodel code out of scratchpad
........
r642571 | nick | 2008-03-29 18:11:48 +0000 (Sat, 29 Mar 2008) | 1 line
Merge several bug tests into one file
........
r642574 | nick | 2008-03-29 18:23:33 +0000 (Sat, 29 Mar 2008) | 1 line
Move the FormulaEvaluator code out of scratchpad
........
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@642591 13f79535-47bb-0310-9956-ffa450edef68
2008-03-29 15:36:53 -04:00
</path>
2005-01-25 15:08:18 -05:00
2011-02-18 15:04:50 -05:00
<path id= "excelant.classpath" >
<path refid= "ooxml.classpath" />
<pathelement location= "${main.ant.jar}" />
<pathelement location= "${ooxml.output.dir}" />
</path>
2015-08-07 19:33:30 -04:00
2014-11-10 07:29:08 -05:00
<path id= "javadoc.classpath" >
<path refid= "main.classpath" />
<path refid= "scratchpad.classpath" />
<path refid= "ooxml.classpath" />
<path refid= "ooxml.xmlsec.classpath" />
2017-06-10 11:01:14 -04:00
<path refid= "test.jar.classpath" />
2021-02-21 15:57:25 -05:00
<pathelement location= "${main.log4j-api.jar}" />
2014-11-10 07:29:08 -05:00
<path path= "${env.CLASSPATH}" />
</path>
2016-11-29 17:41:26 -05:00
<patternset id= "exclude-scratchpad-test" >
2020-12-24 13:42:29 -05:00
<exclude name= "**/TestExtractorFactory.class" />
<exclude name= "**/TestEmbedOLEPackage.class" />
<exclude name= "**/TestHxxFEncryption.class" />
2016-11-29 17:41:26 -05:00
</patternset>
2009-11-21 10:30:54 -05:00
<!-- Prints POI's Ant usage help -->
<target name= "help" description= "Prints Apache POI's Ant usage help" >
2009-11-23 03:43:04 -05:00
<echo >
This is POI ${version.id}
2021-05-13 08:11:40 -04:00
Java Version ${ant.java.version}/${java.version}, isJava8: ${isJava8}
2009-11-23 03:43:04 -05:00
Timestamp ${DSTAMP}
The main targets of interest are:
- clean Erase all build work products (ie. everything in the build directory)
2010-10-06 03:58:51 -04:00
- compile Compile all files from main, ooxml and scratchpad
- test Run all unit tests from main, ooxml and scratchpad
2009-11-23 03:43:04 -05:00
- jar Produce jar files
2015-05-31 16:11:20 -04:00
- assemble Produce the zipped distribution files
2009-11-23 03:43:04 -05:00
- site Generate all documentation (Requires Apache Forrest)
- dist Create a distribution (Requires Apache Forrest)
2009-11-21 10:30:54 -05:00
</echo>
</target>
2005-01-01 18:39:42 -05:00
2009-11-21 10:30:54 -05:00
<tstamp >
<format property= "tstamp.year" pattern= "yyyy" />
</tstamp>
2005-01-01 18:39:42 -05:00
2015-10-05 08:23:07 -04:00
<target name= "init" depends= "fetch-jars,fetch-ooxml-jars" description= "Initialization run before other targets." >
2003-04-23 20:53:41 -04:00
<mkdir dir= "build" />
<mkdir dir= "${main.output.dir}" />
<mkdir dir= "${main.output.test.dir}" />
<mkdir dir= "${main.reports.test}" />
2009-11-21 10:30:54 -05:00
<mkdir dir= "${scratchpad.output.dir}" />
<mkdir dir= "${scratchpad.output.test.dir}" />
2003-04-23 20:53:41 -04:00
<mkdir dir= "${scratchpad.reports.test}" />
2009-11-21 10:30:54 -05:00
<mkdir dir= "${ooxml.output.dir}" />
<mkdir dir= "${ooxml.output.test.dir}" />
2021-03-27 10:03:16 -04:00
<mkdir dir= "${ooxml-schema.output.dir}" />
<mkdir dir= "${ooxml-schema.output.test.dir}" />
<mkdir dir= "${ooxml-schema.output.gen-sources.dir}" />
<mkdir dir= "${ooxml-schema.output.gen-classes.dir}" />
2007-12-27 06:52:12 -05:00
<mkdir dir= "${ooxml.reports.test}" />
2011-02-18 15:04:50 -05:00
<mkdir dir= "${excelant.output.dir}" />
<mkdir dir= "${excelant.output.test.dir}" />
<mkdir dir= "${excelant.reports.test}" />
2009-11-21 10:30:54 -05:00
<mkdir dir= "${examples.output.dir}" />
2014-12-25 04:16:44 -05:00
<mkdir dir= "${integration.output.test.dir}" />
<mkdir dir= "${integration.reports.test}" />
2003-04-23 20:53:41 -04:00
<mkdir dir= "${dist.dir}" />
2009-11-23 03:43:04 -05:00
<mkdir dir= "${build.site}" />
2014-10-06 09:20:12 -04:00
2016-08-11 08:00:53 -04:00
<echo message= "Using Ant: ${ant.version} from ${ant.home}, Ant detected Java ${ant.java.version} (may be different than actual Java sometimes...)" />
2015-08-07 19:33:30 -04:00
<echo message= "Using Java: ${java.version}/${java.runtime.version}/${java.vm.version}/${java.vm.name} from ${java.vm.vendor} on ${os.name}: ${os.version}" />
2021-05-13 08:11:40 -04:00
<echo message= "Building Apache POI version ${version.id} and RC: ${release.rc}, isJava8: ${isJava8}" />
2021-12-08 12:21:21 -05:00
<echo if:true= "${isJava8}" > Compiling for Java 8</echo>
<echo unless:true= "${isJava8}" > Compiling for Java 9+</echo>
2016-04-03 18:19:44 -04:00
2020-09-21 20:07:32 -04:00
<loadresource property= "RELEASE_TAG" >
<string > REL_${version.id}</string>
<filterchain >
<replaceregex pattern= "\W" replace= "_" flags= "g" />
</filterchain>
</loadresource>
2016-03-30 17:27:03 -04:00
</target>
2003-04-23 20:53:41 -04:00
2015-10-05 08:23:07 -04:00
<target name= "clean" description= "Remove generated artefacts" >
2003-04-23 20:53:41 -04:00
<delete dir= "build" />
2021-04-07 17:40:33 -04:00
<delete dir= "poi-examples/build" />
<delete dir= "poi-excelant/build" />
<delete dir= "poi-integration/build" />
<delete dir= "poi/build" />
<delete dir= "poi-ooxml/build" />
<delete dir= "poi-ooxml-full/build" />
<delete dir= "poi-scratchpad/build" />
2003-04-23 20:53:41 -04:00
</target>
2016-03-06 20:58:26 -05:00
<macrodef name= "downloadfile" >
<attribute name= "src" />
<attribute name= "dest" />
<sequential >
2020-05-05 09:36:30 -04:00
<local name= "destdir" />
<dirname property= "destdir" file= "@{dest}" />
<mkdir dir= "${destdir}" />
2016-07-31 13:19:05 -04:00
<get src= "@{src}" dest= "@{dest}" skipexisting= "true" />
2016-03-06 20:58:26 -05:00
</sequential>
</macrodef>
2008-11-07 04:29:54 -05:00
2003-04-23 20:53:41 -04:00
<target name= "check-jars" >
2015-08-07 19:33:30 -04:00
<!-- remove previous versions of third - party jars to prevent them from lingering around,
we often had hard-to-find build/CI-problems because of these! -->
<mkdir dir= "${main.lib}" />
2015-10-14 15:27:14 -04:00
<mkdir dir= "${ooxml.lib}" />
2020-05-05 09:36:30 -04:00
<mkdir dir= "${ooxml-tests.lib}" />
2020-05-05 10:07:24 -04:00
<!-- remove jars from previous versions, but not the current version -->
2020-05-06 15:09:44 -04:00
<delete dir= "compile-lib" failonerror= "false" />
<delete dir= "ooxml-lib" failonerror= "false" />
<delete dir= "ooxml-testlib" failonerror= "false" />
2020-09-25 15:39:49 -04:00
<delete verbose= "true" failonerror= "false" >
<fileset dir= "${basedir}/lib" includes= "*.jar" />
<fileset dir= "${basedir}/lib/excelant" >
<include name= "ant*-1.10.1.jar" />
</fileset>
2020-12-16 14:09:00 -05:00
<fileset dir= "${basedir}/lib/main" >
2020-12-16 14:44:54 -05:00
<include name= "log4j-1.2*.jar" />
2021-12-13 02:44:03 -05:00
<include name= "log4j-api-2.14*.jar" />
2021-12-13 18:59:38 -05:00
<include name= "log4j-api-2.15*.jar" />
2022-01-01 11:12:02 -05:00
<include name= "log4j-api-2.16*.jar" />
<include name= "log4j-api-2.17.0.jar" />
2020-12-28 09:03:36 -05:00
<include name= "commons-logging-1.2.jar" />
2021-02-21 19:18:37 -05:00
<include name= "*slf4j*.jar" />
2020-12-16 14:09:00 -05:00
</fileset>
2020-09-25 15:39:49 -04:00
<fileset dir= "${basedir}/lib/main-tests" >
2021-10-08 03:53:00 -04:00
<include name= "mockito-core-3*.jar" />
2021-11-22 08:41:58 -05:00
<include name= "mockito-core-4.0*.jar" />
2022-01-24 08:17:26 -05:00
<include name= "mockito-core-4.2*.jar" />
2022-06-01 11:47:59 -04:00
<include name= "mockito-core-4.5*.jar" />
2020-09-25 15:39:49 -04:00
<include name= "hamcrest-core*" />
2020-12-24 13:42:29 -05:00
<include name= "junit-4*.jar" />
2021-02-21 19:18:37 -05:00
<include name= "*slf4j*.jar" />
2021-12-08 12:21:21 -05:00
<include name= "junit-jupiter-*-5.8.0.jar" />
<include name= "junit-jupiter-*-5.7.*.jar" />
<include name= "junit-platform-*-1.7.*.jar" />
2021-12-13 02:44:03 -05:00
<include name= "log4j-core-2.14*.jar" />
2022-01-01 11:12:02 -05:00
<include name= "log4j-core-2.15*.jar" />
<include name= "log4j-core-2.16*.jar" />
<include name= "log4j-core-2.17.0.jar" />
2021-12-08 12:21:21 -05:00
</fileset>
2020-09-25 15:39:49 -04:00
<fileset dir= "${basedir}/lib/ooxml" >
2021-07-12 04:11:30 -04:00
<include name= "xmlbeans-3*.jar" />
<include name= "xmlbeans-4*.jar" />
2022-06-16 20:19:12 -04:00
<include name= "xmlbeans-5.0*.jar" />
2020-09-25 15:39:49 -04:00
</fileset>
<fileset dir= "${basedir}/lib/ooxml-provided" >
2021-12-10 03:00:11 -05:00
<include name= "bc*-1.6*.jar" />
2021-03-08 17:29:26 -05:00
<include name= "batik*.jar" />
2021-06-28 12:28:21 -04:00
<include name= "slf4j*-1.7.30.jar" />
2022-05-03 14:57:00 -04:00
<include name= "xmlsec-2*.jar" />
2020-09-25 15:39:49 -04:00
</fileset>
<fileset dir= "${basedir}/lib/ooxml-tests" >
<include name= "guava-20.0.jar" />
</fileset>
<fileset dir= "${basedir}/lib/util" >
<include name= "asm*7.2.jar" />
2020-12-28 09:49:29 -05:00
<include name= "org.jacoco.*-0.8.5.*.jar" />
2022-04-01 17:17:07 -04:00
<include name= "forbiddenapis-3.1.jar" />
2020-09-25 15:39:49 -04:00
</fileset>
<fileset dir= "${basedir}/lib/util" >
<include name= "jacoco-0.8.5.zip" />
</fileset>
<fileset dir= "${basedir}/lib/excelant" >
<include name= "ant*1.10.1.jar" />
</fileset>
2015-08-07 19:33:30 -04:00
</delete>
2014-08-03 17:30:30 -04:00
2014-08-10 14:25:10 -04:00
<condition property= "jars.present" >
2003-07-14 08:11:12 -04:00
<or >
<and >
2011-05-10 06:38:17 -04:00
<available file= "${main.commons-codec.jar}" />
2020-12-24 13:42:29 -05:00
<available file= "${main.junit-api.jar}" />
<available file= "${main.junit-jengine.jar}" />
<available file= "${main.junit-params.jar}" />
<available file= "${main.junit-plauncher.jar}" />
<available file= "${main.junit-pengine.jar}" />
<available file= "${main.junit-pcommons.jar}" />
<available file= "${main.junit-opentest4j.jar}" />
<available file= "${main.junit-apiguardian.jar}" />
2017-05-15 19:27:21 -04:00
<available file= "${main.jmh.jar}" />
<available file= "${main.jmhAnnotation.jar}" />
2013-06-30 16:49:51 -04:00
<available file= "${main.hamcrest.jar}" />
2018-03-04 07:24:44 -05:00
<available file= "${main.xmlunit.jar}" />
2018-01-29 10:21:59 -05:00
<available file= "${main.mockito.jar}" />
2018-01-30 07:57:47 -05:00
<available file= "${main.byte-buddy.jar}" />
<available file= "${main.byte-buddy-agent.jar}" />
<available file= "${main.objenesis.jar}" />
2011-02-18 15:04:50 -05:00
<available file= "${main.ant.jar}" />
2014-05-29 05:16:29 -04:00
<available file= "${main.antlauncher.jar}" />
2021-02-21 15:57:25 -05:00
<available file= "${main.log4j-api.jar}" />
<available file= "${main.log4j-core.jar}" />
2013-08-04 12:38:01 -04:00
<available file= "${asm.jar}" />
2020-05-06 09:48:25 -04:00
<available file= "${asm-commons.jar}" />
<available file= "${asm-tree.jar}" />
2013-08-04 12:38:01 -04:00
<available file= "${jacoco.zip}" />
2014-01-20 14:25:22 -05:00
<available file= "${rat.jar}" />
2015-08-27 09:14:46 -04:00
<available file= "${forbidden.jar}" />
2014-09-29 19:39:45 -04:00
<available file= "${dsig.bouncycastle-prov.jar}" />
<available file= "${dsig.bouncycastle-pkix.jar}" />
2021-06-28 15:52:52 -04:00
<available file= "${dsig.bouncycastle-util.jar}" />
2014-09-29 19:39:45 -04:00
<available file= "${dsig.xmlsec.jar}" />
2016-07-30 04:54:50 -04:00
<available file= "${main.commons-collections4.jar}" />
2017-09-13 19:54:36 -04:00
<available file= "${main.commons-math3.jar}" />
2021-05-13 20:37:50 -04:00
<available file= "${main.commons-io.jar}" />
2020-01-07 10:45:07 -05:00
<available file= "${main.com.zaxxer.jar}" />
2017-11-19 14:53:44 -05:00
<!-- we had some CI failures when the extracted files for JaCoCo were missing somehow... -->
2020-05-05 09:36:30 -04:00
<available file= "${util.lib}/jacocoagent.jar" />
2003-07-14 08:11:12 -04:00
</and>
<isset property= "disconnected" />
</or>
2003-04-23 20:53:41 -04:00
</condition>
</target>
2008-11-07 04:29:54 -05:00
<target name= "fetch-jars" depends= "check-jars" unless= "jars.present"
2009-11-21 10:30:54 -05:00
description="Fetches needed JAR files from the Internet">
<mkdir dir= "${main.lib}" />
2016-03-06 20:58:26 -05:00
<downloadfile src= "${main.commons-logging.url}" dest= "${main.commons-logging.jar}" />
<downloadfile src= "${main.commons-codec.url}" dest= "${main.commons-codec.jar}" />
2020-12-24 13:42:29 -05:00
<downloadfile src= "${main.junit-api.url}" dest= "${main.junit-api.jar}" />
<downloadfile src= "${main.junit-jengine.url}" dest= "${main.junit-jengine.jar}" />
<downloadfile src= "${main.junit-params.url}" dest= "${main.junit-params.jar}" />
<downloadfile src= "${main.junit-plauncher.url}" dest= "${main.junit-plauncher.jar}" />
<downloadfile src= "${main.junit-pengine.url}" dest= "${main.junit-pengine.jar}" />
<downloadfile src= "${main.junit-pcommons.url}" dest= "${main.junit-pcommons.jar}" />
<downloadfile src= "${main.junit-opentest4j.url}" dest= "${main.junit-opentest4j.jar}" />
<downloadfile src= "${main.junit-apiguardian.url}" dest= "${main.junit-apiguardian.jar}" />
2017-05-15 19:27:21 -04:00
<downloadfile src= "${main.jmh.url}" dest= "${main.jmh.jar}" />
<downloadfile src= "${main.jmhAnnotation.url}" dest= "${main.jmhAnnotation.jar}" />
2016-03-06 20:58:26 -05:00
<downloadfile src= "${main.hamcrest.url}" dest= "${main.hamcrest.jar}" />
2018-03-04 07:24:44 -05:00
<downloadfile src= "${main.xmlunit.url}" dest= "${main.xmlunit.jar}" />
2018-01-29 10:21:59 -05:00
<downloadfile src= "${main.mockito.url}" dest= "${main.mockito.jar}" />
2018-01-30 07:57:47 -05:00
<downloadfile src= "${main.byte-buddy.url}" dest= "${main.byte-buddy.jar}" />
<downloadfile src= "${main.byte-buddy-agent.url}" dest= "${main.byte-buddy-agent.jar}" />
<downloadfile src= "${main.objenesis.url}" dest= "${main.objenesis.jar}" />
2016-03-06 20:58:26 -05:00
<downloadfile src= "${main.ant.url}" dest= "${main.ant.jar}" />
<downloadfile src= "${main.antlauncher.url}" dest= "${main.antlauncher.jar}" />
2021-02-21 15:57:25 -05:00
<downloadfile src= "${main.log4j-api.url}" dest= "${main.log4j-api.jar}" />
<downloadfile src= "${main.log4j-core.url}" dest= "${main.log4j-core.jar}" />
2016-03-06 20:58:26 -05:00
<downloadfile src= "${asm.url}" dest= "${asm.jar}" />
2020-05-06 09:48:25 -04:00
<downloadfile src= "${asm-commons.url}" dest= "${asm-commons.jar}" />
<downloadfile src= "${asm-tree.url}" dest= "${asm-tree.jar}" />
2016-03-06 20:58:26 -05:00
<downloadfile src= "${jacoco.url}" dest= "${jacoco.zip}" />
2016-07-30 04:54:50 -04:00
<downloadfile src= "${main.commons-collections4.url}" dest= "${main.commons-collections4.jar}" />
2017-09-13 19:54:36 -04:00
<downloadfile src= "${main.commons-math3.url}" dest= "${main.commons-math3.jar}" />
2021-05-13 20:37:50 -04:00
<downloadfile src= "${main.commons-io.url}" dest= "${main.commons-io.jar}" />
2020-01-07 10:45:07 -05:00
<downloadfile src= "${main.com.zaxxer.url}" dest= "${main.com.zaxxer.jar}" />
2020-05-05 09:36:30 -04:00
<unzip src= "${jacoco.zip}" dest= "${util.lib}" >
2013-08-04 12:38:01 -04:00
<patternset >
<include name= "lib/*.jar" />
</patternset>
2020-05-05 09:36:30 -04:00
<mapper type= "flatten" />
2013-08-04 12:38:01 -04:00
</unzip>
2016-03-06 20:58:26 -05:00
<downloadfile src= "${rat.url}" dest= "${rat.jar}" />
<downloadfile src= "${forbidden.url}" dest= "${forbidden.jar}" />
<downloadfile src= "${dsig.bouncycastle-prov.url}" dest= "${dsig.bouncycastle-prov.jar}" />
<downloadfile src= "${dsig.bouncycastle-pkix.url}" dest= "${dsig.bouncycastle-pkix.jar}" />
2021-06-28 15:52:52 -04:00
<downloadfile src= "${dsig.bouncycastle-util.url}" dest= "${dsig.bouncycastle-util.jar}" />
2016-03-06 20:58:26 -05:00
<downloadfile src= "${dsig.xmlsec.url}" dest= "${dsig.xmlsec.jar}" />
2008-11-07 04:29:54 -05:00
</target>
<target name= "check-ooxml-jars" >
<condition property= "ooxml.jars.present" >
<or >
<and >
2015-10-19 01:59:42 -04:00
<available file= "${ooxml.curvesapi.jar}" />
2018-06-10 12:39:24 -04:00
<available file= "${ooxml.xmlbeans.jar}" />
2018-06-03 18:09:11 -04:00
<available file= "${ooxml.commons-compress.jar}" />
2018-09-18 18:09:15 -04:00
<available file= "${ooxml.test.reflections.jar}" />
<available file= "${ooxml.test.guava.jar}" />
<available file= "${ooxml.test.javassist.jar}" />
2021-02-22 13:27:14 -05:00
<available file= "${ooxml.test.slf4j-api.jar}" />
2022-02-06 16:08:19 -05:00
<available file= "${ooxml.test.opczip.jar}" />
2018-12-16 09:55:23 -05:00
<available file= "${svg.xml-apis-ext.jar}" />
2021-02-21 19:18:37 -05:00
<available file= "${svg.batik-anim.jar}" />
<available file= "${svg.batik-awt-util.jar}" />
<available file= "${svg.batik-bridge.jar}" />
<available file= "${svg.batik-codec.jar}" />
<available file= "${svg.batik-constants.jar}" />
<available file= "${svg.batik-css.jar}" />
<available file= "${svg.batik-dom.jar}" />
<available file= "${svg.batik-ext.jar}" />
<available file= "${svg.batik-gvt.jar}" />
<available file= "${svg.batik-i18n.jar}" />
<available file= "${svg.batik-parser.jar}" />
2021-05-14 07:38:31 -04:00
<available file= "${svg.batik-script.jar}" />
2021-02-21 19:18:37 -05:00
<available file= "${svg.batik-shared-resources.jar}" />
<available file= "${svg.batik-svg-dom.jar}" />
<available file= "${svg.batik-svggen.jar}" />
<available file= "${svg.batik-svgrasterizer.jar}" />
<available file= "${svg.batik-transcoder.jar}" />
<available file= "${svg.batik-util.jar}" />
<available file= "${svg.batik-xml.jar}" />
2018-12-16 09:55:23 -05:00
<available file= "${svg.xmlgraphics-commons.jar}" />
2020-11-02 18:56:27 -05:00
<available file= "${pdf.pdfbox.jar}" />
<available file= "${pdf.fontbox.jar}" />
<available file= "${pdf.graphics2d.jar}" />
2008-11-07 04:29:54 -05:00
</and>
<isset property= "disconnected" />
</or>
</condition>
</target>
<target name= "fetch-ooxml-jars" depends= "check-ooxml-jars" unless= "ooxml.jars.present" >
2009-11-21 10:30:54 -05:00
<mkdir dir= "${ooxml.lib}" />
2020-05-05 09:36:30 -04:00
<mkdir dir= "${ooxml-tests.lib}" />
2016-03-06 20:58:26 -05:00
<downloadfile src= "${ooxml.curvesapi.url}" dest= "${ooxml.curvesapi.jar}" />
2018-06-22 17:25:00 -04:00
<downloadfile src= "${ooxml.xmlbeans.url}" dest= "${ooxml.xmlbeans.jar}" />
2018-06-03 18:09:11 -04:00
<downloadfile src= "${ooxml.commons-compress.url}" dest= "${ooxml.commons-compress.jar}" />
2018-09-18 18:09:15 -04:00
<downloadfile src= "${ooxml.test.reflections.url}" dest= "${ooxml.test.reflections.jar}" />
<downloadfile src= "${ooxml.test.guava.url}" dest= "${ooxml.test.guava.jar}" />
<downloadfile src= "${ooxml.test.javassist.url}" dest= "${ooxml.test.javassist.jar}" />
2021-02-22 13:27:14 -05:00
<downloadfile src= "${ooxml.test.slf4j-api.url}" dest= "${ooxml.test.slf4j-api.jar}" />
2022-02-06 16:08:19 -05:00
<downloadfile src= "${ooxml.test.opczip.url}" dest= "${ooxml.test.opczip.jar}" />
2021-02-21 19:18:37 -05:00
<downloadfile src= "${svg.batik-anim.url}" dest= "${svg.batik-anim.jar}" />
<downloadfile src= "${svg.batik-awt-util.url}" dest= "${svg.batik-awt-util.jar}" />
<downloadfile src= "${svg.batik-bridge.url}" dest= "${svg.batik-bridge.jar}" />
<downloadfile src= "${svg.batik-codec.url}" dest= "${svg.batik-codec.jar}" />
<downloadfile src= "${svg.batik-constants.url}" dest= "${svg.batik-constants.jar}" />
<downloadfile src= "${svg.batik-css.url}" dest= "${svg.batik-css.jar}" />
<downloadfile src= "${svg.batik-dom.url}" dest= "${svg.batik-dom.jar}" />
<downloadfile src= "${svg.batik-ext.url}" dest= "${svg.batik-ext.jar}" />
<downloadfile src= "${svg.batik-gvt.url}" dest= "${svg.batik-gvt.jar}" />
<downloadfile src= "${svg.batik-i18n.url}" dest= "${svg.batik-i18n.jar}" />
<downloadfile src= "${svg.batik-parser.url}" dest= "${svg.batik-parser.jar}" />
2021-05-14 07:38:31 -04:00
<downloadfile src= "${svg.batik-script.url}" dest= "${svg.batik-script.jar}" />
2021-02-21 19:18:37 -05:00
<downloadfile src= "${svg.batik-shared-resources.url}" dest= "${svg.batik-shared-resources.jar}" />
<downloadfile src= "${svg.batik-svg-dom.url}" dest= "${svg.batik-svg-dom.jar}" />
<downloadfile src= "${svg.batik-svggen.url}" dest= "${svg.batik-svggen.jar}" />
<downloadfile src= "${svg.batik-svgrasterizer.url}" dest= "${svg.batik-svgrasterizer.jar}" />
<downloadfile src= "${svg.batik-transcoder.url}" dest= "${svg.batik-transcoder.jar}" />
<downloadfile src= "${svg.batik-util.url}" dest= "${svg.batik-util.jar}" />
<downloadfile src= "${svg.batik-xml.url}" dest= "${svg.batik-xml.jar}" />
2018-12-16 09:55:23 -05:00
<downloadfile src= "${svg.xml-apis-ext.url}" dest= "${svg.xml-apis-ext.jar}" />
<downloadfile src= "${svg.xmlgraphics-commons.url}" dest= "${svg.xmlgraphics-commons.jar}" />
2020-11-02 18:56:27 -05:00
<downloadfile src= "${pdf.pdfbox.url}" dest= "${pdf.pdfbox.jar}" />
<downloadfile src= "${pdf.fontbox.url}" dest= "${pdf.fontbox.jar}" />
<downloadfile src= "${pdf.graphics2d.url}" dest= "${pdf.graphics2d.jar}" />
2003-04-23 20:53:41 -04:00
</target>
2020-08-18 09:50:31 -04:00
2016-03-30 17:27:03 -04:00
<target name= "check-svn-jars" >
<condition property= "svn.jars.present" >
<or >
<and >
2019-05-21 08:21:41 -04:00
<available file= "${dist.svnant.jar}" />
2020-08-18 09:50:31 -04:00
<available file= "${dist.svnclientadapter-base.jar}" />
<available file= "${dist.svnclientadapter-svnkit.jar}" />
<available file= "${dist.svnclientadapter-javahl.jar}" />
2016-03-30 17:27:03 -04:00
<available file= "${dist.svnkit.jar}" />
2016-04-03 18:19:44 -04:00
<available file= "${dist.svnkit-javahl16.jar}" />
<available file= "${dist.sqljet.jar}" />
<available file= "${dist.antlr.jar}" />
<available file= "${dist.sequence-library.jar}" />
2021-01-12 17:39:07 -05:00
<available file= "${dist.lz4-java.jar}" />
2016-03-30 17:27:03 -04:00
</and>
<isset property= "disconnected" />
</or>
</condition>
</target>
<target name= "fetch-svn-jars" depends= "check-svn-jars" unless= "svn.jars.present" >
2021-12-08 12:21:21 -05:00
<!-- some jars are gone since bintray.dl is shutting down, so we started to include them in the sources for now -->
<copy todir= "lib/util" >
<fileset dir= "lib.stored/" includes= "*.jar" />
</copy>
2016-03-30 17:27:03 -04:00
<downloadfile src= "${dist.svnkit.url}" dest= "${dist.svnkit.jar}" />
2016-04-03 18:19:44 -04:00
<downloadfile src= "${dist.svnkit-javahl16.url}" dest= "${dist.svnkit-javahl16.jar}" />
<downloadfile src= "${dist.sqljet.url}" dest= "${dist.sqljet.jar}" />
<downloadfile src= "${dist.antlr.url}" dest= "${dist.antlr.jar}" />
<downloadfile src= "${dist.sequence-library.url}" dest= "${dist.sequence-library.jar}" />
2021-01-12 17:39:07 -05:00
<downloadfile src= "${dist.lz4-java.url}" dest= "${dist.lz4-java.jar}" />
2016-03-30 17:27:03 -04:00
</target>
2003-04-23 20:53:41 -04:00
2020-05-05 09:36:30 -04:00
<target name= "check-compiled-ooxml-xsds" >
2007-12-27 04:12:57 -05:00
<condition property= "ooxml-compiled-xsds.present" >
2020-05-05 09:36:30 -04:00
<and >
<available file= "${ooxml.xsds.jar}" />
<available file= "${ooxml.xsds.src.jar}" />
</and>
2013-12-24 18:13:21 -05:00
</condition>
2009-11-21 10:30:54 -05:00
</target>
2015-11-21 14:37:26 -05:00
2020-07-22 18:08:33 -04:00
<target name= "compile-ooxml-xsds"
depends="init,check-compiled-ooxml-xsds"
unless="ooxml-compiled-xsds.present"
description="Unpacks the OOXML xsd files, and compiles them into XmlBeans">
2015-11-21 14:37:26 -05:00
2020-07-22 18:08:33 -04:00
<local name= "ooxml.memory" />
<!-- We need a fair amount of memory to compile the xml schema, -->
<!-- but limit it in case it goes wrong! -->
<!-- Pick the right amount based on 32 vs 64 bit jvm -->
<condition property= "ooxml.memory" value= "1536m" else= "1024m" >
<equals arg1= "${sun.arch.data.model}" arg2= "64" />
</condition>
2021-03-27 10:03:16 -04:00
<mkdir dir= "${ooxml.xsds.src.dir}" />
2020-07-22 18:08:33 -04:00
2021-03-27 10:03:16 -04:00
<copy todir= "${ooxml.xsds.src.dir}" >
2020-07-22 18:08:33 -04:00
<zipfileset src= "${ooxml.xsds.izip.1}" />
<fileset dir= "${ooxml.visio.xsd.dir}" />
2020-10-10 19:33:26 -04:00
<fileset dir= "${ooxml.schema.xsdconfig.dir}" includes= "ooxmlSchemas.xsdconfig,markup-compatibility.xsd,vmlDrawing.xsd" />
2020-07-22 18:08:33 -04:00
<zipfileset src= "${ooxml.xsds.izip.2}" includes= "opc-digSig.xsd,opc-relationships.xsd" />
<fileset dir= "${ooxml.security.xsd.dir}" includes= "signatureInfo.xsd" />
<fileset dir= "${ooxml.schema.xsdconfig.dir}" includes= "XAdES*.xsd,*.xsdconfig,xmldsig*.xsd" />
</copy>
2021-02-21 19:18:37 -05:00
<taskdef name= "xmlbean" classname= "org.apache.xmlbeans.impl.tool.XMLBean" >
<classpath >
<path location= "${ooxml.xmlbeans.jar}" />
<path location= "${main.log4j-api.jar}" />
<path location= "${main.log4j-core.jar}" />
</classpath>
</taskdef>
2020-07-22 18:08:33 -04:00
<xmlbean
2021-03-27 10:03:16 -04:00
schema="${ooxml.xsds.src.dir}"
srcgendir="${ooxml-schema.output.gen-sources.dir}"
classgendir="${ooxml-schema.output.gen-classes.dir}"
destfile="${ooxml.xsds.src.dir}.jar"
2020-07-22 18:08:33 -04:00
srconly="true"
failonerror="true"
fork="true"
memoryMaximumSize="${ooxml.memory}"
typesystemname="ooxml"
repackage="org.apache.xmlbeans.metadata:org.apache.poi.schemas.ooxml">
<classpath >
<path location= "${ooxml.xmlbeans.jar}" />
</classpath>
</xmlbean>
<javac release= "8"
target="${jdk.version.class}"
source="${jdk.version.source}"
2021-03-27 10:03:16 -04:00
srcdir="${ooxml-schema.output.gen-sources.dir}"
destdir="${ooxml-schema.output.dir}"
2020-07-22 18:08:33 -04:00
encoding="${java.source.encoding}"
fork="yes"
debug="${compile.debug}"
memoryMaximumSize="${ooxml.memory}"
includeantruntime="false">
<classpath refid= "ooxml.classpath" />
2021-03-27 10:03:16 -04:00
<classpath >
<pathelement path= "${ooxml-schema.output.gen-classes.dir}" />
</classpath>
2020-07-22 18:08:33 -04:00
</javac>
<javac release= "9"
2021-04-07 17:40:33 -04:00
srcdir="${basedir}/poi-ooxml-full/src/main/java9"
destdir="${basedir}/poi-ooxml-full/src/main/java9"
2020-07-22 18:08:33 -04:00
includeantruntime="false"
fork="true"
modulepath="lib/ooxml"
unless:true="${isJava8}">
2021-05-14 02:41:22 -04:00
<compilerarg line= "--patch-module org.apache.poi.ooxml.schemas=${ooxml-schema.output.dir}${path.separator}${ooxml-schema.output.gen-classes.dir}" />
2020-07-22 18:08:33 -04:00
</javac>
2020-12-13 10:32:43 -05:00
<mkdir dir= "build/dist/maven/poi-ooxml-full" />
2020-07-22 18:08:33 -04:00
<jar destfile= "${ooxml.xsds.jar}" >
2021-03-27 10:03:16 -04:00
<fileset dir= "${ooxml-schema.output.dir}" />
<fileset dir= "${ooxml-schema.output.gen-classes.dir}" />
2021-04-07 17:40:33 -04:00
<zipfileset dir= "${basedir}/poi-ooxml-full/src/main/java9" prefix= "META-INF/versions/9" excludes= "*.java" />
<metainf dir= "legal/" excludes= "HEADER" />
2020-07-22 18:08:33 -04:00
<manifest >
<attribute name= "Multi-Release" value= "true" />
<attribute name= "Automatic-Module-Name" value= "org.apache.poi.ooxml.schemas" />
<attribute name= "Built-By" value= "${user.name}" />
<attribute name= "Specification-Title" value= "Apache POI OOXML Schemas" />
2020-12-28 09:49:29 -05:00
<attribute name= "Specification-Version" value= "${version.id}" />
2020-07-22 18:08:33 -04:00
<attribute name= "Specification-Vendor" value= "The Apache Software Foundation" />
<attribute name= "Implementation-Title" value= "Apache POI OOXML Schemas" />
<attribute name= "Implementation-Version" value= "${version.id}" />
<attribute name= "Implementation-Vendor-Id" value= "org.apache.poi" />
<attribute name= "Implementation-Vendor" value= "The Apache Software Foundation" />
</manifest>
</jar>
<jar destfile= "${ooxml.xsds.src.jar}" >
2021-03-27 10:03:16 -04:00
<fileset dir= "${ooxml-schema.output.gen-sources.dir}" />
2021-04-07 17:40:33 -04:00
<zipfileset dir= "${basedir}/poi-ooxml-full/src/main/java9" prefix= "META-INF/versions/9/" excludes= "*.class" />
<metainf dir= "legal" excludes= "HEADER" />
2020-07-22 18:08:33 -04:00
</jar>
</target>
<target name= "compile" depends= "init, c o m p i l e - m a i n ,
compile-scratchpad, compile-examples, compile-excelant"
description="Compiles the POI main classes, scratchpad and examples"/>
<macrodef name= "compile-jar" >
<attribute name= "module" />
<attribute name= "java" />
<attribute name= "classes" />
<attribute name= "test" default= "" />
<attribute name= "test-classes" default= "" />
<attribute name= "version" default= "${version.id}" />
<element name= "lib" />
<element name= "resources" optional= "true" />
<element name= "test-resources" optional= "true" />
<sequential >
<local name= "cp_java" />
<pathconvert property= "cp_java" pathsep= "," >
<path > <lib /> </path>
2020-08-05 18:41:36 -04:00
<filtermapper >
<replacestring from= "${basedir}" to= "" />
<replaceregex pattern= "^." replace= "" />
<suffixlines suffix= "${file.separator}*.jar" />
</filtermapper>
2020-07-22 18:08:33 -04:00
</pathconvert>
2015-12-05 16:58:20 -05:00
2020-07-22 18:08:33 -04:00
<local name= "maven-name" />
<loadresource property= "maven-name" >
<string > @{module}</string>
<filterchain >
<prefixlines prefix= "poi-" />
2021-04-07 17:40:33 -04:00
<replacestring from= "poi-poi" to= "poi" />
2020-07-22 18:08:33 -04:00
</filterchain>
</loadresource>
2015-11-21 14:37:26 -05:00
2020-07-22 18:08:33 -04:00
<!-- compile the sources -->
<javac release= "8"
target="${jdk.version.class}"
2015-11-21 14:37:26 -05:00
source="${jdk.version.source}"
2020-07-22 18:08:33 -04:00
destdir="@{classes}"
srcdir="@{java}"
debug="${compile.debug}"
2015-11-21 14:37:26 -05:00
encoding="${java.source.encoding}"
fork="yes"
includeantruntime="false">
2020-07-22 18:08:33 -04:00
<classpath >
<fileset dir= "${basedir}" includes= "${cp_java}" />
</classpath>
2015-11-21 14:37:26 -05:00
</javac>
2021-12-08 12:21:21 -05:00
<local name= "module-name" />
<loadresource property= "module-name" >
<string > @{module}</string>
<filterchain >
<replacestring from= "poi-" to= "" />
</filterchain>
</loadresource>
2021-05-13 08:11:38 -04:00
2021-12-08 12:21:21 -05:00
<!-- compile jigsaw files to sources, so we don't forget to update/provide them for Java 8 builds -->
2020-05-05 09:36:30 -04:00
<javac release= "9"
2021-03-27 10:03:16 -04:00
srcdir="${basedir}/@{module}/src/main/java9"
destdir="${basedir}/@{module}/src/main/java9"
2020-05-05 09:36:30 -04:00
includeantruntime="false"
fork="true"
unless:true="${isJava8}">
2021-05-13 08:11:38 -04:00
<compilerarg line= "--patch-module org.apache.poi.${module-name}=@{classes}" />
2020-07-22 18:08:33 -04:00
<modulepath >
<lib />
</modulepath>
2020-05-05 09:36:30 -04:00
</javac>
2020-07-22 18:08:33 -04:00
<mkdir dir= "build/dist/maven/${maven-name}" />
2020-05-05 09:36:30 -04:00
2021-12-08 12:21:21 -05:00
<echo message= "Building jar for @{module}, module-name: ${module-name} with isJava8: ${isJava8}" />
2021-05-13 08:11:40 -04:00
2020-07-22 18:08:33 -04:00
<!-- create classes jar -->
<jar destfile= "build/dist/maven/${maven-name}/${maven-name}-@{version}.jar" >
<fileset dir= "@{classes}" />
<resources />
2021-03-27 10:03:16 -04:00
<zipfileset dir= "${basedir}/@{module}/src/main/java9"
2020-07-22 18:08:33 -04:00
prefix="META-INF/versions/9"
excludes="*.java"/>
2021-04-07 17:40:33 -04:00
<metainf dir= "legal/" excludes= "HEADER" />
2020-05-05 09:36:30 -04:00
<manifest >
<attribute name= "Multi-Release" value= "true" />
2020-07-22 18:08:33 -04:00
<attribute name= "Automatic-Module-Name" value= "org.apache.poi.@{module}" />
<attribute name= "Built-By" value= "${user.name}" />
<attribute name= "Specification-Title" value= "Apache POI" />
<attribute name= "Specification-Version" value= "${version.id}" />
<attribute name= "Specification-Vendor" value= "The Apache Software Foundation" />
<attribute name= "Implementation-Title" value= "Apache POI" />
<attribute name= "Implementation-Version" value= "${version.id}" />
<attribute name= "Implementation-Vendor-Id" value= "org.apache.poi" />
<attribute name= "Implementation-Vendor" value= "The Apache Software Foundation" />
2020-05-05 09:36:30 -04:00
</manifest>
2018-09-01 18:58:51 -04:00
</jar>
2015-11-21 14:37:26 -05:00
2020-07-22 18:08:33 -04:00
<!-- compile the tests -->
<javac release= "8"
target="${jdk.version.class}"
source="${jdk.version.source}"
destdir="@{test-classes}"
srcdir="@{test}"
debug="${compile.debug}"
encoding="${java.source.encoding}"
fork="yes"
includeantruntime="false" unless:blank="@{test}">
<classpath >
<fileset dir= "${basedir}" includes= "${cp_java}" />
<pathelement path= "build/dist/maven/${maven-name}/${maven-name}-@{version}.jar" />
</classpath>
</javac>
2013-12-24 18:13:21 -05:00
2020-07-22 18:08:33 -04:00
<!-- again, generate jigsaw files to sources ... -->
<local name= "merged" />
<pathconvert property= "merged" >
<path location= "@{classes}" />
<path location= "@{test-classes}" />
</pathconvert>
2009-11-21 10:30:54 -05:00
2020-07-22 18:08:33 -04:00
<javac release= "9"
2021-03-27 10:03:16 -04:00
srcdir="${basedir}/@{module}/src/test/java9"
destdir="${basedir}/@{module}/src/test/java9"
2020-07-22 18:08:33 -04:00
includeantruntime="false"
fork="true"
unless:true="${isJava8}" unless:blank="@{test}">
2021-05-13 08:11:38 -04:00
<compilerarg line= "--patch-module org.apache.poi.${module-name}=${merged}" />
2020-07-22 18:08:33 -04:00
<modulepath >
<lib />
</modulepath>
</javac>
2009-11-21 10:30:54 -05:00
2021-12-08 12:21:21 -05:00
<echo message= "Building test-jar for @{module}, module-name: ${module-name} with isJava8: ${isJava8}" />
2021-05-13 08:11:40 -04:00
2020-07-22 18:08:33 -04:00
<!-- create test classes jar - using the module - info of the tests -->
<jar destfile= "build/dist/maven/${maven-name}-tests/${maven-name}-@{version}-tests.jar" unless:blank= "@{test}" >
<fileset dir= "@{classes}" />
<fileset dir= "@{test-classes}" >
<exclude name= "org/apache/poi/ooxml/lite/**" />
</fileset>
<resources />
<test-resources />
2021-03-27 10:03:16 -04:00
<zipfileset dir= "${basedir}/@{module}/src/test/java9" prefix= "META-INF/versions/9" excludes= "*.java" />
2021-04-07 17:40:33 -04:00
<metainf dir= "legal/" excludes= "HEADER" />
2020-07-22 18:08:33 -04:00
<manifest >
<attribute name= "Multi-Release" value= "true" />
<attribute name= "Automatic-Module-Name" value= "org.apache.poi.@{module}" />
<attribute name= "Built-By" value= "${user.name}" />
<attribute name= "Specification-Title" value= "Apache POI" />
<attribute name= "Specification-Version" value= "${version.id}" />
<attribute name= "Specification-Vendor" value= "The Apache Software Foundation" />
<attribute name= "Implementation-Title" value= "Apache POI" />
<attribute name= "Implementation-Version" value= "${version.id}" />
<attribute name= "Implementation-Vendor-Id" value= "org.apache.poi" />
<attribute name= "Implementation-Vendor" value= "The Apache Software Foundation" />
</manifest>
</jar>
2020-05-05 09:36:30 -04:00
2020-07-22 18:08:33 -04:00
<!-- create the sources jar -->
<jar destfile= "build/dist/maven/${maven-name}/${maven-name}-@{version}-sources.jar" >
<fileset dir= "@{java}" />
2021-04-07 17:40:33 -04:00
<metainf dir= "legal/" excludes= "HEADER" />
2020-07-22 18:08:33 -04:00
<manifest >
<attribute name= "Built-By" value= "${user.name}" />
<attribute name= "Specification-Title" value= "Apache POI" />
<attribute name= "Specification-Version" value= "${version.id}" />
<attribute name= "Specification-Vendor" value= "The Apache Software Foundation" />
<attribute name= "Implementation-Title" value= "Apache POI" />
<attribute name= "Implementation-Version" value= "${version.id}" />
<attribute name= "Implementation-Vendor-Id" value= "org.apache.poi" />
<attribute name= "Implementation-Vendor" value= "The Apache Software Foundation" />
</manifest>
</jar>
</sequential>
</macrodef>
2020-05-05 09:36:30 -04:00
2020-07-22 18:08:33 -04:00
<target name= "compile-main" depends= "init, compile-version" >
2021-04-07 17:40:33 -04:00
<compile-jar module= "poi"
2020-07-22 18:08:33 -04:00
java="${main.src}" classes="${main.output.dir}"
test="${main.src.test}" test-classes="${main.output.test.dir}">
<lib >
<pathelement path= "lib/main" />
<pathelement path= "lib/main-tests" />
2021-04-07 17:40:33 -04:00
<pathelement path= "lib/excelant" />
2020-07-22 18:08:33 -04:00
</lib>
<resources >
2021-03-27 10:03:16 -04:00
<fileset dir= "${main.resources.main}" />
2020-07-22 18:08:33 -04:00
</resources>
2021-02-21 15:57:25 -05:00
<test-resources >
<fileset dir= "${main.resources.test}" />
</test-resources>
2020-07-22 18:08:33 -04:00
</compile-jar>
2015-08-07 19:33:30 -04:00
</target>
2020-05-05 09:36:30 -04:00
<target name= "compile-scratchpad" depends= "compile-main" >
2021-04-07 17:40:33 -04:00
<compile-jar module= "poi-scratchpad"
2020-07-22 18:08:33 -04:00
java="${scratchpad.src}" classes="${scratchpad.output.dir}"
test="${scratchpad.src.test}" test-classes="${scratchpad.output.test.dir}">
<lib >
<pathelement path= "build/dist/maven/poi-tests" />
<pathelement path= "lib/main" />
<pathelement path= "lib/main-tests" />
</lib>
<resources >
2021-03-27 10:03:16 -04:00
<fileset dir= "${scratchpad.resources.main}" />
2020-07-22 18:08:33 -04:00
</resources>
2021-02-21 15:57:25 -05:00
<test-resources >
<fileset dir= "${scratchpad.resources.test}" />
</test-resources>
2020-07-22 18:08:33 -04:00
</compile-jar>
2009-11-21 10:30:54 -05:00
</target>
<target name= "compile-examples" depends= "compile-main,compile-scratchpad,compile-ooxml" >
2021-04-07 17:40:33 -04:00
<compile-jar module= "poi-examples"
2020-07-22 18:08:33 -04:00
java="${examples.src}" classes="${examples.output.dir}">
<lib >
2020-12-13 10:32:43 -05:00
<pathelement path= "build/dist/maven/poi-ooxml-full" />
2020-07-22 18:08:33 -04:00
<pathelement path= "build/dist/maven/poi-tests" />
<pathelement path= "build/dist/maven/poi-scratchpad-tests" />
<pathelement path= "build/dist/maven/poi-ooxml-tests" />
<pathelement path= "lib/main" />
<pathelement path= "lib/ooxml" />
</lib>
</compile-jar>
2009-11-21 10:30:54 -05:00
</target>
2014-08-10 14:25:10 -04:00
<target name= "compile-ooxml" depends= "compile-main,compile-scratchpad,compile-ooxml-xsds" >
2021-04-07 17:40:33 -04:00
<compile-jar module= "poi-ooxml"
2020-07-22 18:08:33 -04:00
java="${ooxml.src}" classes="${ooxml.output.dir}"
test="${ooxml.src.test}" test-classes="${ooxml.output.test.dir}">
<lib >
<pathelement path= "build/dist/maven/poi-tests" />
<pathelement path= "build/dist/maven/poi-scratchpad-tests" />
2020-12-13 10:32:43 -05:00
<pathelement path= "build/dist/maven/poi-ooxml-full" />
2020-07-22 18:08:33 -04:00
<pathelement path= "lib/main" />
<pathelement path= "lib/main-tests" />
<pathelement path= "lib/ooxml" />
<pathelement path= "lib/ooxml-provided" />
<pathelement path= "lib/ooxml-tests" />
2021-02-21 19:18:37 -05:00
<pathelement path= "lib/ooxml-batik" />
2020-07-22 18:08:33 -04:00
</lib>
<resources >
2021-03-27 10:03:16 -04:00
<fileset dir= "${ooxml.resources.main}" />
2020-07-22 18:08:33 -04:00
</resources>
</compile-jar>
<!-- create ooxml - lite - agent jar -->
2021-04-07 17:40:33 -04:00
<mkdir dir= "${ooxml.lite.output.dir}" />
<javac release= "8"
srcdir="${basedir}/poi-ooxml-lite-agent/src/main/java"
destdir="${ooxml.lite.output.dir}"
includeantruntime="false"
fork="true">
<classpath >
<fileset dir= "${basedir}/lib/main-tests" includes= "*.jar" />
<fileset dir= "${basedir}/lib/ooxml" includes= "*.jar" />
</classpath>
</javac>
2020-07-22 18:08:33 -04:00
<javac release= "9"
2021-04-07 17:40:33 -04:00
srcdir="${basedir}/poi-ooxml-lite-agent/src/main/java9"
destdir="${basedir}/poi-ooxml-lite-agent/src/main/java9"
2020-07-22 18:08:33 -04:00
includeantruntime="false"
fork="true"
2020-12-27 19:47:23 -05:00
modulepath="${basedir}/lib/main-tests"
2020-07-22 18:08:33 -04:00
unless:true="${isJava8}">
2021-05-14 08:14:13 -04:00
<compilerarg line= "--patch-module org.apache.poi.ooxml_lite=${ooxml.output.test.dir}${path.separator}${ooxml.lite.output.dir}" />
2016-04-17 20:16:28 -04:00
</javac>
2020-07-22 18:08:33 -04:00
<jar destfile= "${ooxml.lite.agent}" >
2021-04-07 17:40:33 -04:00
<fileset dir= "${ooxml.lite.output.dir}" />
<zipfileset dir= "${basedir}/poi-ooxml-lite-agent/src/main/java9" prefix= "META-INF/versions/9" excludes= "*.java" />
2020-07-22 18:08:33 -04:00
<manifest >
<attribute name= "Multi-Release" value= "true" />
<attribute name= "Automatic-Module-Name" value= "org.apache.poi.ooxml_lite" />
<attribute name= "Premain-Class" value= "org.apache.poi.ooxml.lite.OOXMLLiteAgent" />
2020-12-27 19:47:23 -05:00
<!-- attribute name="Can - Retransform - Classes" value="true"/ -->
2020-07-22 18:08:33 -04:00
</manifest>
</jar>
2016-04-17 20:16:28 -04:00
</target>
2018-12-10 19:01:32 -05:00
<macrodef name= "poiunit" xmlns:jacoco= "antlib:org.jacoco.ant" >
<attribute name= "failureproperty" />
<attribute name= "heap" default= "512" />
<attribute name= "showoutput" default= "false" />
<attribute name= "jacocodest" default= "build/jacoco-dest.exec" />
2020-07-22 18:08:33 -04:00
<attribute name= "modulepath-ref" />
2020-12-24 13:42:29 -05:00
<attribute name= "module1" default= "" />
<attribute name= "module2" default= "" />
<attribute name= "outputDir" />
2018-12-10 19:01:32 -05:00
<element name= "elements" implicit= "true" />
<sequential >
<local name= "no.jit.sherlock" />
<!-- see http://www - 01.ibm.com/support/docview.wss?uid=swg21294023 on how to determine the method strings -->
2020-07-22 18:08:33 -04:00
<loadresource property= "no.jit.sherlock" >
<string >
sun/java2d/pipe/AAShapePipe.renderTiles(Lsun/java2d/SunGraphics2D;Ljava/awt/Shape;Lsun/java2d/pipe/AATileGenerator;[I)V
sun/java2d/pipe/AlphaPaintPipe.renderPathTile(Ljava/lang/Object;[BIIIIII)V
java/awt/TexturePaintContext.getRaster(IIII)Ljava/awt/image/Raster;
</string>
<filterchain >
<trim />
<ignoreblank />
<prefixlines prefix= ",exclude={" />
<suffixlines suffix= "}" />
<striplinebreaks />
</filterchain>
</loadresource>
2018-12-10 19:01:32 -05:00
2020-12-24 13:42:29 -05:00
<path id= "junit-jars" >
<pathelement location= "${main.junit-api.jar}" />
<pathelement location= "${main.junit-jengine.jar}" />
<pathelement location= "${main.junit-params.jar}" />
<pathelement location= "${main.junit-opentest4j.jar}" />
<pathelement location= "${main.junit-apiguardian.jar}" />
<pathelement location= "${main.junit-pcommons.jar}" />
<pathelement location= "${main.junit-pengine.jar}" />
<pathelement location= "${main.junit-plauncher.jar}" />
</path>
2021-04-07 17:40:33 -04:00
<mkdir dir= "poi-excelant/build/poi-ant-contrib" />
<javac srcdir= "poi-excelant/src/poi-ant-contrib/java" destdir= "poi-excelant/build/poi-ant-contrib"
2020-12-24 13:42:29 -05:00
includeantruntime="true" includes="Junit5Progress.java" classpathref="junit-jars"/>
2018-12-11 02:29:28 -05:00
<local name= "ooxml.lite.agent.exists" />
<available property= "ooxml.lite.agent.exists" file= "${ooxml.lite.agent}" />
2020-07-22 18:08:33 -04:00
<local name= "cp_java" />
<pathconvert property= "cp_java" pathsep= "," >
<path refid= "@{modulepath-ref}" />
2020-08-05 18:41:36 -04:00
<filtermapper >
<replacestring from= "${basedir}" to= "" />
<replaceregex pattern= "^." replace= "" />
<suffixlines suffix= "${file.separator}*.jar" />
</filtermapper>
2020-07-22 18:08:33 -04:00
</pathconvert>
2020-12-24 13:42:29 -05:00
<local name= "use_module1" />
<local name= "use_module2" />
<condition property= "use_module1" value= "true" unless:true= "${isJava8}" >
<length string= "@{module1}" when= "greater" length= "0" />
</condition>
<condition property= "use_module2" value= "true" unless:true= "${isJava8}" >
<length string= "@{module2}" when= "greater" length= "0" />
</condition>
<!-- As of 2018, JaCoCo is managing expectations and stay on Java 5 and therefore don't support junitlauncher -->
<!-- https://github.com/jacoco/jacoco/issues/673 ... m( -->
<jacoco:agent property= "jacocoagent" enabled= "${coverage.enabled}" excludes= "${coverage.excludes}" destfile= "@{jacocodest}" />
<junitlauncher printsummary= "false" haltonfailure= "${halt.on.test.failure}" failureproperty= "@{failureproperty}" >
<classpath >
<path refid= "junit-jars" if:true= "${isJava8}" />
<fileset dir= "${basedir}" includes= "${cp_java}" if:true= "${isJava8}" />
2021-04-07 17:40:33 -04:00
<pathelement location= "poi-excelant/build/poi-ant-contrib" />
2020-12-24 13:42:29 -05:00
</classpath>
<testclasses outputDir= "@{outputDir}" >
<fork >
<syspropertyset refid= "junit.properties" />
<sysproperty key= "java.io.tmpdir" value= "${tempdir}" />
<jvmarg value= "-Xmx@{heap}M" />
<jvmarg value= "-ea" />
<!-- some "add - opens" and other properties are needed when running with Java 9 or newer -->
<sysproperty key= "sun.reflect.debugModuleAccessChecks" value= "true" if:true= "${addOpens}" />
<sysproperty key= "com.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize" value= "true" if:true= "${addOpens}" />
<jvmarg value= "--illegal-access=warn" if:true= "${addOpens}" />
<jvmarg value= "-javaagent:${ooxml.lite.agent}=${ooxml.lite.report}|${ooxml.lite.includes}" if:true= "${ooxml.lite.agent.exists}" />
<jvmarg line= "${jacocoagent}" />
<!-- jvmarg value=" - Duser.timezone=UTC"/ -->
<jvmarg value= "${file.leak.detector}" />
2021-01-15 18:50:42 -05:00
<jvmarg value= "-Djunit.jupiter.execution.parallel.enabled=true" />
2021-01-19 16:35:40 -05:00
<jvmarg value= "-Djunit.jupiter.execution.parallel.config.strategy=fixed" />
<jvmarg value= "-Djunit.jupiter.execution.parallel.config.fixed.parallelism=3" />
2020-12-24 13:42:29 -05:00
<jvmarg value= "-Xjit:verbose={compileStart|compileEnd},vlog=build/jit.log${no.jit.sherlock}" if:true= "${isIBMVM}" />
2021-02-21 19:18:37 -05:00
<!-- <jvmarg value=" - agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5000"/> -->
<!-- <jvmarg value="--show - module - resolution"/> -->
2020-12-24 13:42:29 -05:00
<modulepath refid= "@{modulepath-ref}" unless:true= "${isJava8}" />
<jvmarg line= "--add-modules org.junit.platform.launcher" unless:true= "${isJava8}" />
<jvmarg line= "--add-modules org.junit.jupiter.params" unless:true= "${isJava8}" />
<jvmarg line= "--add-modules org.apache.poi.@{module1}" if:set= "use_module1" />
<jvmarg line= "--add-modules org.apache.poi.@{module2}" if:set= "use_module2" />
</fork>
2021-01-23 18:04:31 -05:00
<listener classname= "Junit5Progress" />
2020-12-24 13:42:29 -05:00
<listener type= "legacy-plain" sendSysOut= "true" outputDir= "@{outputDir}" />
<listener type= "legacy-xml" sendSysOut= "true" sendSysErr= "true" outputDir= "@{outputDir}" />
2018-12-10 19:01:32 -05:00
<elements />
2020-12-24 13:42:29 -05:00
</testclasses>
</junitlauncher>
2018-12-10 19:01:32 -05:00
</sequential>
</macrodef>
2020-07-22 18:08:33 -04:00
<target name= "retest-ooxml" depends= "jar"
2020-12-13 10:32:43 -05:00
description="run ooxml tests with poi-ooxml-lite">
2020-07-22 18:08:33 -04:00
<path id= "restest.modules" >
<pathelement path= "build/dist/maven/poi-tests" />
<pathelement path= "build/dist/maven/poi-scratchpad-tests" />
<pathelement path= "build/dist/maven/poi-ooxml-tests" />
2020-12-13 10:32:43 -05:00
<pathelement path= "build/dist/maven/poi-ooxml-lite" />
2020-07-22 18:08:33 -04:00
<pathelement path= "lib/main" />
<pathelement path= "lib/main-tests" />
<pathelement path= "lib/ooxml" />
<pathelement path= "lib/ooxml-provided" />
<pathelement path= "lib/ooxml-tests" />
</path>
2018-12-10 19:01:32 -05:00
2020-12-24 13:42:29 -05:00
<poiunit failureproperty= "ooxml.test.failed" heap= "768" modulepath-ref= "restest.modules"
module1="ooxml" module2="scratchpad" outputDir="${ooxml.reports.test}">
<zipfileset src= "build/dist/maven/poi-ooxml-tests/poi-ooxml-${version.id}-tests.jar" >
<include name= "**/${testpattern}.class" />
2021-01-10 08:34:04 -05:00
<exclude name= "**/*$*.class" />
2020-12-24 13:42:29 -05:00
<exclude name= "**/TestUnfixedBugs.class" />
<exclude name= "**/All*Tests.class" />
<exclude name= "**/TestSignatureInfo.class" />
<exclude name= "**/${testexcludepattern}.class" />
<patternset refid= "exclude-scratchpad-test" if:true= "${scratchpad.ignore}" />
</zipfileset>
2018-12-10 19:01:32 -05:00
</poiunit>
2018-07-13 13:51:55 -04:00
</target>
2011-02-18 15:04:50 -05:00
<target name= "compile-excelant" depends= "compile-main,compile-ooxml" >
2021-04-07 17:40:33 -04:00
<compile-jar module= "poi-excelant"
2020-07-22 18:08:33 -04:00
java="${excelant.src}" classes="${excelant.output.dir}"
test="${excelant.src.test}" test-classes="${excelant.output.test.dir}">
<lib >
<pathelement path= "build/dist/maven/poi-tests" />
<pathelement path= "build/dist/maven/poi-scratchpad-tests" />
<pathelement path= "build/dist/maven/poi-ooxml-tests" />
<pathelement path= "lib/main" />
<pathelement path= "lib/main-tests" />
<pathelement path= "lib/excelant" />
</lib>
<resources >
2021-03-27 10:03:16 -04:00
<fileset dir= "${excelant.resource.main}" />
2020-07-22 18:08:33 -04:00
</resources>
</compile-jar>
2011-02-18 15:04:50 -05:00
</target>
2016-09-14 13:55:51 -04:00
<target name= "compile-integration" depends= "compile-scratchpad, compile-main, compile-ooxml, compile-examples" >
2020-07-22 18:08:33 -04:00
<javac release= "8"
target="${jdk.version.class}"
2014-12-25 04:16:44 -05:00
source="${jdk.version.source}"
destdir="${integration.output.test.dir}"
srcdir="${integration.src.test}"
debug="${compile.debug}"
encoding="${java.source.encoding}"
fork="yes"
includeantruntime="false">
<classpath >
<path refid= "scratchpad.classpath" />
<path refid= "ooxml.classpath" />
2017-06-09 08:49:01 -04:00
<path refid= "test.jar.classpath" />
2015-08-07 19:33:30 -04:00
<pathelement location= "${ooxml.output.dir}" />
2021-09-10 02:14:42 -04:00
<pathelement location= "${ooxml.output.test.dir}" />
2014-12-25 04:16:44 -05:00
<pathelement location= "${main.output.test.dir}" />
2016-04-01 02:25:49 -04:00
<pathelement location= "${examples.output.dir}" />
2015-08-07 19:33:30 -04:00
<pathelement location= "${main.ant.jar}" />
2018-11-19 13:00:42 -05:00
<pathelement location= "${scratchpad.output.dir}" />
2021-02-21 15:57:25 -05:00
<pathelement location= "${integration.resources.test}" />
2014-12-25 04:16:44 -05:00
</classpath>
2018-12-10 11:18:49 -05:00
<exclude name= "**/HeapDump**" if:true= "${isIBMVM}" />
2014-12-25 04:16:44 -05:00
</javac>
2020-07-22 18:08:33 -04:00
<mkdir dir= "${integration.output.test.dir}/META-INF/versions/9" />
<javac release= "9"
2021-04-07 17:40:33 -04:00
srcdir="${basedir}/poi-integration/src/test/java9"
2020-07-22 18:08:33 -04:00
destdir="${integration.output.test.dir}/META-INF/versions/9"
includeantruntime="false"
fork="true"
unless:true="${isJava8}">
<compilerarg line= "--patch-module org.apache.poi.stress=${integration.output.test.dir}" />
<modulepath >
2020-12-13 10:32:43 -05:00
<pathelement path= "build/dist/maven/poi-ooxml-full" />
2020-07-22 18:08:33 -04:00
<pathelement path= "build/dist/maven/poi" />
<pathelement path= "build/dist/maven/poi-ooxml" />
<pathelement path= "build/dist/maven/poi-scratchpad" />
<pathelement path= "build/dist/maven/poi-examples" />
<pathelement path= "${main.lib}" />
<pathelement path= "${main-tests.lib}" />
<pathelement path= "${ooxml.lib}" />
<pathelement path= "${ooxml-provided.lib}" />
</modulepath>
</javac>
2021-04-07 17:40:33 -04:00
<manifest file= "poi-integration/build/poi-manifest.mf" >
2020-07-22 18:08:33 -04:00
<attribute name= "Multi-Release" value= "true" />
<attribute name= "Automatic-Module-Name" value= "org.apache.poi.stress" />
</manifest>
2020-07-23 19:28:59 -04:00
<jar destfile= "build/dist/maven/poi-integration/poi-integration-${version.id}.jar"
2020-07-22 18:08:33 -04:00
basedir="${integration.output.test.dir}"
2021-04-07 17:40:33 -04:00
manifest="poi-integration/build/poi-manifest.mf"/>
2014-12-25 04:16:44 -05:00
</target>
2020-03-06 10:22:16 -05:00
<target name= "-version-java-check" >
2021-12-08 12:21:21 -05:00
<!-- recompile Version.java from the template whenever source or the version in build.xml changes -->
2020-03-06 10:22:16 -05:00
<uptodate property= "version.java.notRequired" targetfile= "${main.output.dir}/org/apache/poi/Version.class" >
2021-04-07 17:40:33 -04:00
<srcfiles file= "poi/src/main/version/Version.java.template" />
2020-03-06 10:22:16 -05:00
<srcfiles file= "build.xml" />
</uptodate>
</target>
2020-03-08 04:28:04 -04:00
<target name= "compile-version"
2021-12-08 12:21:21 -05:00
unless="version.java.notRequired"
depends="init, -version-java-check"
2009-11-21 10:30:54 -05:00
description="Compiles the version class">
<!-- Generate the .java file -->
2021-03-27 10:03:16 -04:00
<local name= "version.dir" />
<dirname property= "version.dir" file= "${main.version.java}" />
<mkdir dir= "${version.dir}" />
<delete file= "${main.version.java}" />
<copy file= "${main.version.template}" tofile= "${main.version.java}" overwrite= "true" >
2009-11-21 10:30:54 -05:00
<filterset >
<filter token= "VERSION" value= "${version.id}" />
<filter token= "DSTAMP" value= "${DSTAMP}" />
</filterset>
</copy>
<!-- Compile -->
<javac target= "${jdk.version.class}" source= "${jdk.version.source}"
failonerror="true" destdir="${main.output.dir}" debug="on" fork="yes"
2021-03-27 10:03:16 -04:00
srcdir="${main.output.gen-sources.dir}"
2010-11-25 05:28:02 -05:00
encoding="${java.source.encoding}" includeantruntime="false">
2010-06-13 02:26:14 -04:00
</javac>
2009-11-21 10:30:54 -05:00
</target>
2013-08-04 12:38:01 -04:00
<target name= "jacocotask" depends= "" >
2013-08-12 15:43:40 -04:00
<echo message= "Coverage reporting: ${coverage.enabled}" />
2013-08-04 12:38:01 -04:00
<taskdef uri= "antlib:org.jacoco.ant" resource= "org/jacoco/ant/antlib.xml" >
2020-07-22 18:08:33 -04:00
<classpath >
<fileset dir= "${util.lib}" >
<include name= "org.jacoco*.jar" />
<include name= "asm-*.jar" />
</fileset>
</classpath>
2013-08-04 12:38:01 -04:00
</taskdef>
</target>
2016-04-17 21:23:26 -04:00
<!-- Section: test (execute junit tests on test suites) -->
2013-08-04 12:38:01 -04:00
<target name= "test" depends= "compile,jacocotask,test-main,test-scratchpad,test-ooxml,test-excelant"
2010-10-06 03:58:51 -04:00
description="Tests main, scratchpad and ooxml"/>
2018-11-17 19:01:40 -05:00
<target name= "test-all" depends= "test,test-integration,test-ooxml-lite,testcoveragereport"
2016-04-17 21:23:26 -04:00
description="Tests main, scratchpad, ooxml, ooxml-lite, and coveragereport"/>
2013-08-04 12:38:01 -04:00
2018-08-24 02:48:39 -04:00
<target name= "testcoveragereport" depends= "init,jacocotask" description= "create test-report" xmlns:jacoco= "antlib:org.jacoco.ant" if= "coverage.enabled" >
2013-08-04 12:38:01 -04:00
<delete dir= "${coverage.dir}" />
<mkdir dir= "${coverage.dir}" />
2018-04-04 15:41:03 -04:00
<mkdir dir= "${main.output.dir}" />
<mkdir dir= "${scratchpad.output.dir}" />
<mkdir dir= "${ooxml.output.dir}" />
<mkdir dir= "${excelant.output.dir}" />
2013-08-04 12:38:01 -04:00
<jacoco:report >
<executiondata >
<fileset dir= "build" >
<include name= "*.exec" />
</fileset>
</executiondata>
2015-08-07 19:33:30 -04:00
2013-08-04 12:38:01 -04:00
<structure name= "Apache POI" >
<group name= "Main" >
<classfiles >
<fileset dir= "${main.output.dir}" >
2016-07-31 13:19:37 -04:00
<!-- exclude some generated classes -->
<exclude name= "org/apache/poi/sl/draw/binding/*.class" />
2015-08-07 19:33:30 -04:00
<!-- exclude large test - class -->
2013-10-30 18:26:13 -04:00
<exclude name= "org/apache/poi/hssf/usermodel/DummyGraphics2d.class" />
2013-08-04 12:38:01 -04:00
</fileset>
</classfiles>
<sourcefiles encoding= "UTF-8" >
<fileset dir= "${main.src}" />
</sourcefiles>
</group>
<group name= "Scratchpad" >
<classfiles >
2014-03-16 15:46:46 -04:00
<fileset dir= "${scratchpad.output.dir}" >
2015-08-07 19:33:30 -04:00
<!-- exclude some generated classes -->
<exclude name= "org/apache/poi/hwpf/model/types/*.class" />
<exclude name= "org/apache/poi/hdf/model/hdftypes/definitions/*.class" />
</fileset>
2013-08-04 12:38:01 -04:00
</classfiles>
<sourcefiles encoding= "UTF-8" >
<fileset dir= "${scratchpad.src}" />
</sourcefiles>
</group>
<group name= "OOXML" >
<classfiles >
2015-01-03 04:34:25 -05:00
<fileset dir= "${ooxml.output.dir}" />
2018-11-17 19:01:40 -05:00
<!-- there are no actual POI classes in build/ooxml - lite - classes, only generated code... -->
2013-08-04 12:38:01 -04:00
</classfiles>
<sourcefiles encoding= "UTF-8" >
<fileset dir= "${ooxml.src}" />
<!-- fileset dir="${ooxml.lite.src}"/ -->
</sourcefiles>
</group>
<group name= "Excelant" >
<classfiles >
<fileset dir= "${excelant.output.dir}" />
</classfiles>
<sourcefiles encoding= "UTF-8" >
<fileset dir= "${excelant.src}" />
</sourcefiles>
</group>
2015-01-03 04:34:25 -05:00
<!-- group name="Examples">
<classfiles >
<fileset dir= "${examples.output.dir}" />
</classfiles>
<sourcefiles encoding= "UTF-8" >
<fileset dir= "${examples.src}" />
</sourcefiles>
</group-->
2013-08-04 12:38:01 -04:00
</structure>
2015-08-07 19:33:30 -04:00
2013-08-04 12:38:01 -04:00
<html destdir= "${coverage.dir}" />
<xml destfile= "${coverage.dir}/coverage.xml" />
2015-08-07 19:33:30 -04:00
</jacoco:report>
2015-05-19 06:16:57 -04:00
<echo message= "Coverage results are available at ${coverage.dir}/index.html, ${coverage.dir}/coverage.xml" />
2013-08-04 12:38:01 -04:00
</target>
2003-04-23 20:53:41 -04:00
2016-04-17 20:16:28 -04:00
<!-- Section: test - main -->
2003-04-23 20:53:41 -04:00
<target name= "-test-main-check" >
<uptodate property= "main.test.notRequired" targetfile= "${main.testokfile}" >
<srcfiles dir= "${main.src}" />
<srcfiles dir= "${main.src.test}" />
</uptodate>
</target>
2009-11-21 10:30:54 -05:00
<target name= "test-main" unless= "main.test.notRequired"
2018-12-19 04:40:34 -05:00
depends="compile-main, -test-main-check,jacocotask"
2016-04-17 21:23:26 -04:00
description="tests POI classes that deal with the Microsoft Office binary (BIFF8) file formats (excludes OOXML)">
2020-07-22 18:08:33 -04:00
<path id= "test-main.modules" >
<pathelement path= "build/dist/maven/poi-tests" />
<pathelement path= "lib/main" />
<pathelement path= "lib/main-tests" />
</path>
<poiunit failureproperty= "main.test.failed" heap= "256" showoutput= "true" jacocodest= "build/jacoco-main.exec"
2020-12-24 13:42:29 -05:00
modulepath-ref="test-main.modules" module1="poi" outputDir="${main.reports.test}">
<zipfileset src= "build/dist/maven/poi-tests/poi-${version.id}-tests.jar" >
<include name= "**/${testpattern}.class" />
2021-01-10 08:34:04 -05:00
<exclude name= "**/*$*.class" />
2020-12-24 13:42:29 -05:00
<exclude name= "**/All*Tests.class" />
<exclude name= "**/TestUnfixedBugs.class" />
<exclude name= "**/TestcaseRecordInputStream.class" />
<exclude name= "**/${testexcludepattern}.class" />
<patternset refid= "exclude-scratchpad-test" if:true= "${scratchpad.ignore}" />
</zipfileset>
2018-12-10 19:01:32 -05:00
</poiunit>
2020-07-22 18:08:33 -04:00
2009-11-21 10:30:54 -05:00
<delete file= "${main.testokfile}" />
<antcall target= "-test-main-write-testfile" />
2003-07-14 08:11:12 -04:00
</target>
2016-11-29 17:41:26 -05:00
<target name= "test-report" depends= "init" >
<mkdir dir= "build/report" />
<junitreport todir= "build/report" >
2021-03-27 10:03:16 -04:00
<fileset dir= "." >
<include name= "**/build/test-results/**/TEST-*.xml" />
2016-11-29 17:41:26 -05:00
</fileset>
<report format= "frames" todir= "build/report" />
</junitreport>
2019-06-05 16:28:00 -04:00
<echo message= "Published results from tests at build/report/index.html" />
2016-11-29 17:41:26 -05:00
</target>
2016-07-31 17:23:25 -04:00
2003-07-14 08:11:12 -04:00
<target name= "-test-property-check" unless= "testcase" >
<echo message= "Please use -Dtestcase=org.your.testcase to run a single test" />
<fail />
2003-05-04 05:17:06 -04:00
</target>
2003-04-23 20:53:41 -04:00
<target name= "-test-main-write-testfile" unless= "main.test.failed" >
<echo file= "${main.testokfile}" append= "false" message= "testok" />
</target>
2016-04-17 20:16:28 -04:00
<!-- Section: test - scratchpad -->
2003-04-23 20:53:41 -04:00
<target name= "-test-scratchpad-check" >
<uptodate property= "scratchpad.test.notRequired" targetfile= "${scratchpad.testokfile}" >
<srcfiles dir= "${scratchpad.src}" />
<srcfiles dir= "${scratchpad.src.test}" />
</uptodate>
</target>
2020-07-22 18:08:33 -04:00
<target name= "test-scratchpad" depends= "jacocotask,compile-scratchpad,-test-scratchpad-check,test-scratchpad-download-resources"
2018-12-19 04:40:34 -05:00
unless="scratchpad.test.notRequired"
2016-04-17 21:23:26 -04:00
description="test non-OOXML scratchpad classes">
2020-07-22 18:08:33 -04:00
<path id= "test-scratchpad.modules" >
<pathelement path= "build/dist/maven/poi-tests" />
<pathelement path= "build/dist/maven/poi-scratchpad-tests" />
<pathelement path= "lib/main" />
<pathelement path= "lib/main-tests" />
</path>
<poiunit failureproperty= "scratchpad.test.failed" heap= "512" jacocodest= "build/jacoco-scratchpad.exec"
2020-12-24 13:42:29 -05:00
modulepath-ref="test-scratchpad.modules" module1="scratchpad" outputDir="${scratchpad.reports.test}">
<zipfileset src= "build/dist/maven/poi-scratchpad-tests/poi-scratchpad-${version.id}-tests.jar" >
<include name= "**/${testpattern}.class" />
2021-01-10 08:34:04 -05:00
<exclude name= "**/*$*.class" />
2020-12-24 13:42:29 -05:00
<exclude name= "**/All*Tests.class" />
<exclude name= "**/${testexcludepattern}.class" />
<patternset refid= "exclude-scratchpad-test" if:true= "${scratchpad.ignore}" />
</zipfileset>
2018-12-10 19:01:32 -05:00
</poiunit>
2003-04-23 20:53:41 -04:00
<delete file= "${scratchpad.testokfile}" />
<antcall target= "-test-scratchpad-write-testfile" />
</target>
<target name= "-test-scratchpad-write-testfile" unless= "scratchpad.test.failed" >
<echo file= "${scratchpad.testokfile}" append= "false" message= "testok" />
</target>
2016-04-17 20:16:28 -04:00
<!-- Section: test - ooxml -->
2007-12-27 06:52:12 -05:00
<target name= "-test-ooxml-check" >
<uptodate property= "ooxml.test.notRequired" targetfile= "${ooxml.testokfile}" >
<srcfiles dir= "${ooxml.src}" />
<srcfiles dir= "${ooxml.src.test}" />
</uptodate>
</target>
2015-08-07 19:33:30 -04:00
<macrodef name= "ooxml-test-runner" xmlns:jacoco= "antlib:org.jacoco.ant" >
2020-07-22 18:08:33 -04:00
<attribute name= "modulepath-ref" />
2013-08-04 12:38:01 -04:00
<attribute name= "type" />
2009-11-21 10:30:54 -05:00
<sequential >
2020-07-22 18:08:33 -04:00
<poiunit failureproperty= "ooxml.test.failed" heap= "768" jacocodest= "build/jacoco-@{type}.exec"
2020-12-24 13:42:29 -05:00
modulepath-ref="@{modulepath-ref}" module1="ooxml" module2="scratchpad" outputDir="${ooxml.reports.test}">
<zipfileset src= "build/dist/maven/poi-ooxml-tests/poi-ooxml-${version.id}-tests.jar" >
<include name= "**/${testpattern}.class" />
2021-01-10 08:34:04 -05:00
<exclude name= "**/*$*.class" />
2020-12-24 13:42:29 -05:00
<exclude name= "**/All*Tests.class" />
<exclude name= "**/TestUnfixedBugs.class" />
<exclude name= "**/${testexcludepattern}.class" />
<patternset refid= "exclude-scratchpad-test" if:true= "${scratchpad.ignore}" />
</zipfileset>
2018-12-10 19:01:32 -05:00
</poiunit>
2009-11-21 10:30:54 -05:00
</sequential>
2015-08-07 19:33:30 -04:00
</macrodef>
2009-11-21 10:30:54 -05:00
2020-07-22 18:08:33 -04:00
<target name= "test-ooxml" depends= "compile-main,compile-ooxml,-test-ooxml-check,jacocotask" unless= "ooxml.test.notRequired"
2016-04-17 21:23:26 -04:00
description="test OOXML classes">
2020-07-22 18:08:33 -04:00
<path id= "test-ooxml.modules" >
<!-- full schema -->
2020-12-13 10:32:43 -05:00
<pathelement path= "build/dist/maven/poi-ooxml-full" />
2020-07-22 18:08:33 -04:00
<pathelement path= "build/dist/maven/poi-tests" />
<pathelement path= "build/dist/maven/poi-ooxml-tests" />
<pathelement path= "build/dist/maven/poi-scratchpad-tests" />
<pathelement path= "lib/main" />
<pathelement path= "lib/main-tests" />
<pathelement path= "lib/ooxml" />
<pathelement path= "lib/ooxml-provided" />
<pathelement path= "lib/ooxml-tests" />
</path>
<ooxml-test-runner modulepath-ref= "test-ooxml.modules" type= "ooxml" />
2007-12-27 06:52:12 -05:00
<delete file= "${ooxml.testokfile}" />
<antcall target= "-test-ooxml-write-testfile" />
</target>
<target name= "-test-ooxml-write-testfile" unless= "ooxml.test.failed" >
<echo file= "${ooxml.testokfile}" append= "false" message= "testok" />
</target>
2016-04-17 20:16:28 -04:00
<!-- Section: test - integration -->
2014-12-25 04:16:44 -05:00
<target name= "-test-integration-check" >
<uptodate property= "integration.test.notRequired" targetfile= "${integration.testokfile}" >
<srcfiles dir= "${integration.src.test}" />
</uptodate>
</target>
2020-07-22 18:08:33 -04:00
<target name= "test-integration" depends= "compile-integration,-test-integration-check,jacocotask"
2018-12-19 04:40:34 -05:00
unless="integration.test.notRequired">
2016-11-29 17:41:26 -05:00
<delete dir= "build" includes= "test-integration.log*" />
2020-07-22 18:08:33 -04:00
<path id= "test-integration.modules" >
2020-08-17 16:25:08 -04:00
<pathelement path= "build/dist/maven/poi-tests" />
2020-07-22 18:08:33 -04:00
<pathelement path= "build/dist/maven/poi-ooxml" />
<pathelement path= "build/dist/maven/poi-scratchpad" />
<pathelement path= "build/dist/maven/poi-examples" />
2020-12-13 10:32:43 -05:00
<pathelement path= "build/dist/maven/poi-ooxml-full" />
2020-07-23 19:28:59 -04:00
<pathelement path= "build/dist/maven/poi-integration" />
2020-07-22 18:08:33 -04:00
<pathelement path= "lib/main" />
<pathelement path= "lib/main-tests" />
<pathelement path= "lib/ooxml" />
<pathelement path= "lib/ooxml-provided" />
<pathelement path= "lib/ooxml-tests" />
</path>
<poiunit failureproperty= "integration.test.failed" heap= "1512" showoutput= "true" jacocodest= "build/jacoco-integration.exec"
2020-12-24 13:42:29 -05:00
modulepath-ref="test-integration.modules" module1="stress" outputDir="${integration.reports.test}">
<zipfileset src= "build/dist/maven/poi-integration/poi-integration-${version.id}.jar" >
<include name= "**/${testpattern}.class" />
2021-01-10 08:34:04 -05:00
<exclude name= "**/*$*.class" />
2020-12-24 13:42:29 -05:00
<exclude name= "**/${testexcludepattern}.class" />
<patternset refid= "exclude-scratchpad-test" if:true= "${scratchpad.ignore}" />
</zipfileset>
2018-12-10 19:01:32 -05:00
</poiunit>
2014-12-25 04:16:44 -05:00
<delete file= "${integration.testokfile}" />
<antcall target= "-test-integration-write-testfile" />
</target>
<target name= "-test-integration-write-testfile" unless= "integration.test.failed" >
<echo file= "${integration.testokfile}" append= "false" message= "testok" />
</target>
2015-08-07 19:33:30 -04:00
2018-11-17 19:01:40 -05:00
<!-- the ooxml lite agent collects referenced schema files while other junit tests are run, -->
<!-- therefore its best to compile the ooxml lite jar after all usual tests are done -->
2020-07-22 18:08:33 -04:00
<target name= "compile-ooxml-lite" depends= "test-ooxml" >
2018-11-17 19:01:40 -05:00
<echo message= "Create ooxml-lite schemas" />
2020-07-22 18:08:33 -04:00
<local name= "lite.exports" />
<loadresource property= "lite.exports" >
2020-12-27 19:47:23 -05:00
<file file= "${ooxml.lite.report}.clazz" />
2020-07-22 18:08:33 -04:00
<filterchain >
<tokenfilter >
<replaceregex pattern= "[/\\][^/\\]+$" replace= "" />
<replaceregex pattern= "[/\\]" replace= "." flags= "g" />
</tokenfilter>
<linecontainsregexp negate= "true" regexp= "\.impl$" />
<sortfilter />
<uniqfilter />
<prefixlines prefix= " exports " />
<suffixlines suffix= ";" />
</filterchain>
</loadresource>
2018-11-17 19:01:40 -05:00
2020-07-22 18:08:33 -04:00
<local name= "full.schema" />
<loadresource property= "full.schema" >
2021-04-07 17:40:33 -04:00
<file file= "${basedir}/poi-ooxml-full/src/main/java9/module-info.java" />
2020-07-22 18:08:33 -04:00
<filterchain >
<linecontains negate= "true" matchany= "true" >
<contains value= "exports" />
<contains value= "}" />
</linecontains>
</filterchain>
</loadresource>
2018-11-17 19:01:40 -05:00
2021-04-07 17:40:33 -04:00
<echo output= "${basedir}/poi-ooxml-lite/src/main/java9/module-info.java" > ${full.schema}${lite.exports}}</echo>
2020-07-22 18:08:33 -04:00
<javac release= "9"
2021-04-07 17:40:33 -04:00
srcdir="${basedir}/poi-ooxml-lite/src/main/java9"
destdir="${basedir}/poi-ooxml-lite/src/main/java9"
2020-07-22 18:08:33 -04:00
includeantruntime="false"
fork="true"
unless:true="${isJava8}">
<compilerarg line= "--patch-module org.apache.poi.ooxml.schemas=${ooxml.xsds.jar}" />
<modulepath >
<pathelement path= "lib/ooxml" />
</modulepath>
</javac>
2020-12-30 17:56:36 -05:00
<copy file= "${ooxml.lite.report}.clazz" tofile= "${ooxml.lite.report}.clazz1" overwrite= "true" >
<filterchain >
<sortfilter />
<suffixlines suffix= "$*.class" />
</filterchain>
</copy>
2020-12-27 19:47:23 -05:00
<copy file= "${ooxml.lite.report}.clazz" tofile= "${ooxml.lite.report}.clazz2" overwrite= "true" >
2020-07-22 18:08:33 -04:00
<filterchain >
2020-12-30 17:56:36 -05:00
<sortfilter />
<suffixlines suffix= ".class" />
2020-12-05 16:30:19 -05:00
</filterchain>
</copy>
2021-08-06 16:45:09 -04:00
<copy file= "${ooxml.lite.report}.xsb" tofile= "${ooxml.lite.report}.xsb2" overwrite= "true" >
2020-12-05 16:30:19 -05:00
<filterchain >
2020-12-30 17:56:36 -05:00
<sortfilter />
2020-12-27 19:47:23 -05:00
<prefixlines prefix= "org/apache/poi/schemas/ooxml/system/ooxml/" />
<suffixlines suffix= ".xsb" />
2020-07-22 18:08:33 -04:00
</filterchain>
2020-12-27 19:47:23 -05:00
</copy>
2020-12-05 19:26:44 -05:00
2020-12-13 10:32:43 -05:00
<mkdir dir= "build/dist/maven/poi-ooxml-lite" />
2018-11-17 19:01:40 -05:00
2020-12-30 17:56:36 -05:00
<jar destfile= "${ooxml.lite.jar}" duplicate= "fail" >
2021-04-07 17:40:33 -04:00
<zipfileset dir= "${basedir}/poi-ooxml-lite/src/main/java9" prefix= "META-INF/versions/9" excludes= "*.java" />
2018-11-17 19:01:40 -05:00
<zipfileset src= "${ooxml.xsds.jar}" >
2020-12-30 17:56:36 -05:00
<patternset >
<includesfile name= "${ooxml.lite.report}.clazz1" />
<includesfile name= "${ooxml.lite.report}.clazz2" />
<includesfile name= "${ooxml.lite.report}.xsb2" />
<!-- <include name="org/apache/poi/schemas/ooxml/system/ooxml/*.xsb"/> -->
2020-12-05 16:30:19 -05:00
<include name= "org/apache/poi/schemas/ooxml/element/**/*.xsb" />
2020-07-22 18:08:33 -04:00
</patternset>
2018-11-17 19:01:40 -05:00
</zipfileset>
2020-07-22 18:08:33 -04:00
<manifest >
<attribute name= "Multi-Release" value= "true" />
<attribute name= "Automatic-Module-Name" value= "org.apache.poi.ooxml.schemas" />
</manifest>
2013-12-24 18:13:21 -05:00
</jar>
2008-03-11 08:52:46 -04:00
</target>
2020-07-22 18:08:33 -04:00
<target name= "test-ooxml-lite" depends= "jacocotask,compile-ooxml-lite" >
2009-11-21 10:30:54 -05:00
<delete file= "${ooxml.testokfile}" />
2020-12-13 10:32:43 -05:00
<echo message= "Running ooxml tests against 'poi-ooxml-lite'" />
2015-08-07 19:33:30 -04:00
2020-07-22 18:08:33 -04:00
<path id= "test-ooxml-lite.modules" >
<!-- lite schema -->
2020-12-13 10:32:43 -05:00
<pathelement path= "build/dist/maven/poi-ooxml-lite" />
2020-07-22 18:08:33 -04:00
<pathelement path= "build/dist/maven/poi-tests" />
<pathelement path= "build/dist/maven/poi-ooxml-tests" />
<pathelement path= "build/dist/maven/poi-scratchpad-tests" />
<pathelement path= "lib/main" />
<pathelement path= "lib/main-tests" />
<pathelement path= "lib/ooxml" />
<pathelement path= "lib/ooxml-provided" />
<pathelement path= "lib/ooxml-tests" />
</path>
<ooxml-test-runner modulepath-ref= "test-ooxml-lite.modules" type= "ooxml-lite" />
2018-11-17 19:01:40 -05:00
</target>
2016-04-17 20:16:28 -04:00
<!-- Section: test - excelant -->
2011-02-18 15:04:50 -05:00
<target name= "-test-excelant-check" >
<uptodate property= "excelant.test.notRequired" targetfile= "${excelant.testokfile}" >
<srcfiles dir= "${excelant.src}" />
<srcfiles dir= "${excelant.src.test}" />
</uptodate>
</target>
<target name= "-test-excelant-write-testfile" unless= "excelant.test.failed" >
<echo file= "${excelant.testokfile}" append= "false" message= "testok" />
</target>
2020-07-22 18:08:33 -04:00
<target name= "test-excelant" depends= "compile-excelant,compile-ooxml-lite,-test-excelant-check,jacocotask"
2018-12-19 04:40:34 -05:00
unless="excelant.test.notRequired">
2020-07-22 18:08:33 -04:00
<path id= "test-excelant.modules" >
<pathelement path= "lib/main" />
<pathelement path= "lib/main-tests" />
<pathelement path= "lib/ooxml" />
<pathelement path= "lib/ooxml-tests" />
<pathelement path= "lib/ooxml-provided" />
<pathelement path= "lib/excelant" />
<pathelement path= "build/dist/maven/poi-tests" />
<pathelement path= "build/dist/maven/poi-ooxml-tests" />
2020-12-13 10:32:43 -05:00
<pathelement path= "build/dist/maven/poi-ooxml-lite" />
2020-07-22 18:08:33 -04:00
<pathelement path= "build/dist/maven/poi-scratchpad-tests" />
<pathelement path= "build/dist/maven/poi-excelant-tests" />
</path>
<poiunit failureproperty= "excelant.test.failed" jacocodest= "build/jacoco-excelant.exec"
2020-12-24 13:42:29 -05:00
modulepath-ref="test-excelant.modules" module1="excelant" outputDir="${excelant.reports.test}">
<zipfileset src= "build/dist/maven/poi-excelant-tests/poi-excelant-${version.id}-tests.jar" >
<include name= "**/${testpattern}.class" />
2021-01-10 08:34:04 -05:00
<exclude name= "**/*$*.class" />
2020-12-24 13:42:29 -05:00
<exclude name= "**/${testexcludepattern}.class" />
<patternset refid= "exclude-scratchpad-test" if:true= "${scratchpad.ignore}" />
</zipfileset>
2018-12-10 19:01:32 -05:00
</poiunit>
2011-02-18 15:04:50 -05:00
<delete file= "${excelant.testokfile}" />
<antcall target= "-test-excelant-write-testfile" />
</target>
2016-04-17 20:16:28 -04:00
<!-- GENERATE DOCUMENTATION -->
2011-02-18 15:04:50 -05:00
2016-04-17 20:16:28 -04:00
<!-- Section: docs -->
2003-04-23 20:53:41 -04:00
<target name= "-check-docs" >
2015-10-06 09:36:30 -04:00
<echo message= "Checking if documentation recreation is necessary, i.e. if any file at ${main.documentation} is newer than ${build.site}/index.html" />
2003-04-23 20:53:41 -04:00
<uptodate property= "main.docs.notRequired" targetfile= "${build.site}/index.html" >
2011-03-04 06:59:23 -05:00
<srcfiles dir= "${main.documentation}" />
2003-04-23 20:53:41 -04:00
</uptodate>
2021-10-15 03:58:20 -04:00
<echo message= "Had result: ${main.docs.notRequired}" />
2003-04-23 20:53:41 -04:00
</target>
<target name= "-check-forrest-installed" unless= "env.FORREST_HOME" >
2003-08-02 15:48:57 -04:00
<echo > Please install Apache Forrest (see
2016-04-12 05:52:42 -04:00
< https://forrest.apache.org/index.html> ) and set the
2009-11-21 10:30:54 -05:00
FORREST_HOME environment variable!
</echo>
2003-08-02 15:48:57 -04:00
<fail message= "Apache Forrest is not installed." />
2003-04-23 20:53:41 -04:00
</target>
2018-10-31 12:26:52 -04:00
<target name= "docs" depends= "init, -check-forrest-installed, -check-docs, javadocs, -forrest-docs"
2019-12-09 17:53:14 -05:00
unless="main.docs.notRequired"
2018-10-31 12:26:52 -04:00
description="Builds the POI website" />
2018-11-30 18:08:18 -05:00
<target name= "site" depends= "-forrest-docs" />
2018-10-31 12:26:52 -04:00
<target name= "-forrest-docs" depends= "-check-forrest-installed, -check-docs"
unless="main.docs.notRequired" description="Builds the HTML pages of the POI website">
2021-10-15 03:58:20 -04:00
<echo message= "Using Apache Forrest from ${env.FORREST_HOME}" />
2018-08-23 05:06:34 -04:00
<exec executable= "${env.FORREST_HOME}/bin/forrest" osfamily= "unix" />
<exec executable= "cmd" osfamily= "windows" >
<arg value= "/c" />
<arg value= "${env.FORREST_HOME}/bin/forrest.bat" />
</exec>
2018-07-21 06:28:53 -04:00
2003-04-23 20:53:41 -04:00
<echo > Broken links:</echo>
2018-07-18 19:24:53 -04:00
<echo file= "${build.site}/../tmp/brokenlinks.xml" />
2003-04-23 20:53:41 -04:00
2020-03-08 16:17:11 -04:00
<!-- Apache Forrest is dead, so we cannot expect fixes there
however it does not handle "https" in "credits" currently
if the *.xml file is in a sub-directory, see Apache Forrest
code at main/webapp/skins/pelt/xslt/html/site-to-xhtml.xsl:350
So we need to replace the links afterwards to have a fully "https"
website and avoid browser warning about a "mixed content"
website -->
<echo > Fix https in ${build.site}</echo>
<replace dir= "${build.site}"
token="http://www.apache.org/events/current-event-125x125.png"
value="https://www.apache.org/events/current-event-125x125.png"
summary="true"
includes="**/*.html"/>
<replace dir= "${build.site}"
token="http://www.google.com/search"
value="https://www.google.com/search"
summary="true"
includes="**/*.html"/>
2016-04-17 18:01:48 -04:00
<fixcrlf srcdir= "${build.site}" includes= "**/*.html,**/*.css" eol= "unix" eof= "remove" />
2016-03-11 19:34:26 -05:00
2016-04-17 18:01:48 -04:00
<touch >
2003-04-23 20:53:41 -04:00
<fileset dir= "${build.site}" />
</touch>
</target>
2018-10-30 07:00:35 -04:00
<!-- Generates the latest/development API documentation. -->
2009-11-21 10:30:54 -05:00
<target name= "javadocs"
description="Generates the API documentation">
2018-10-31 12:26:52 -04:00
<echo message= "Generating latest Javadocs in ${javadocs.report.dir}" />
2018-07-18 19:24:53 -04:00
<javadoc verbose= "false" author= "true" destdir= "${javadocs.report.dir}"
2015-08-07 19:33:30 -04:00
windowtitle="POI API Documentation" use="true" version="true"
maxmemory="384M" additionalparam="-notimestamp" locale="en_US"
2014-11-10 07:29:08 -05:00
classpathref="javadoc.classpath">
2009-11-21 10:30:54 -05:00
<packageset dir= "${main.src}" defaultexcludes= "yes" >
<include name= "org/apache/poi/**" />
</packageset>
<packageset dir= "${scratchpad.src}" defaultexcludes= "yes" >
<include name= "org/apache/poi/**" />
<exclude name= "org/apache/poi/hdf/**" />
</packageset>
<packageset dir= "${ooxml.src}" defaultexcludes= "yes" >
<include name= "org/apache/poi/**" />
</packageset>
2019-12-09 17:53:14 -05:00
2019-01-24 15:35:18 -05:00
<arg value= "--add-modules=java.xml.bind" if:true= "${addOpens10}" />
2009-11-21 10:30:54 -05:00
<doctitle > <![CDATA[<h1>POI API Documentation</h1>]]> </doctitle>
<bottom >
<![CDATA[<i> Copyright ${tstamp.year} The Apache Software Foundation or
2005-01-25 15:08:18 -05:00
its licensors, as applicable.</i> ]]>
2009-11-21 10:30:54 -05:00
</bottom>
<group >
<title > DDF - Dreadful Drawing Format</title>
<package name= "org.apache.poi.ddf*" />
</group>
<group >
<title > HPSF - Horrible Property Set Format</title>
<package name= "org.apache.poi.hpsf*" />
</group>
2016-04-17 20:28:13 -04:00
<group >
<title > SS - Common Spreadsheet Format</title>
<package name= "org.apache.poi.ss*" />
</group>
2009-11-21 10:30:54 -05:00
<group >
<title > HSSF - Horrible Spreadsheet Format</title>
<package name= "org.apache.poi.hssf*" />
</group>
2016-04-17 20:28:13 -04:00
<group >
<title > XSSF - Open Office XML Spreadsheet Format</title>
<package name= "org.apache.poi.xssf*" />
</group>
<group >
<title > SL - Common Slideshow Format</title>
<package name= "org.apache.poi.sl*" />
</group>
<group >
<title > HSLF - Horrible Slideshow Format</title>
<package name= "org.apache.poi.hslf*" />
</group>
<group >
<title > XSLF - Open Office XML Slideshow Format</title>
<package name= "org.apache.poi.xslf*" />
</group>
2009-11-21 10:30:54 -05:00
<group >
<title > HWPF - Horrible Word Processor Format</title>
<package name= "org.apache.poi.hwpf*" />
</group>
2016-04-17 20:28:13 -04:00
<group >
<title > XWPF - Open Office XML Word Processor Format</title>
<package name= "org.apache.poi.xwpf*" />
</group>
<group >
<title > HDGF - Horrible Diagram Format</title>
<package name= "org.apache.poi.hdgf*" />
</group>
<group >
<title > XDGF - Open Office XML Diagram Format</title>
<package name= "org.apache.poi.xdgf*" />
</group>
2009-11-21 10:30:54 -05:00
<group >
<title > POIFS - POI File System</title>
<package name= "org.apache.poi.poifs*" />
</group>
<group >
<title > Utilities</title>
<package name= "org.apache.poi.util*" />
</group>
<group >
<title > Examples</title>
<package name= "org.apache.poi.hpsf.examples*" />
<package name= "org.apache.poi.hssf.usermodel.examples*" />
</group>
</javadoc>
</target>
2003-09-04 15:52:11 -04:00
2016-03-06 20:58:26 -05:00
<macrodef name= "maven-jar" >
2018-11-17 19:01:40 -05:00
<attribute name= "src" />
2020-07-22 18:08:33 -04:00
<attribute name= "module" />
<element name= "elements" implicit= "true" optional= "true" />
2016-03-06 20:58:26 -05:00
<sequential >
<local name= "destfile" />
<pathconvert property= "destfile" targetos= "unix" >
2018-11-17 19:01:40 -05:00
<path > <pathelement path= "@{src}" /> </path>
2016-03-06 20:58:26 -05:00
<mapper >
<chainedmapper >
<filtermapper >
2018-11-20 17:11:58 -05:00
<replaceregex pattern= ".jar" replace= "" flags= "g" />
2020-12-13 10:32:43 -05:00
<!-- <replaceregex pattern="ooxml - lite" replace="ooxml - schemas" flags="g"/> -->
2016-03-06 20:58:26 -05:00
<replaceregex pattern= "(.java|.src)$$" replace= "-sources" />
<replaceregex pattern= ".*(?:build|src).?(.*)?" replace= "\1" />
<replaceregex pattern= "(.*)(-classes|-sources)" replace= "poi-\1/poi-\1-${version.id}\2" />
<replaceregex pattern= "^(classes|sources)$$" replace= "poi/poi-${version.id}-\1" />
<replaceregex pattern= "-classes" replace= "" />
</filtermapper>
</chainedmapper>
</mapper>
</pathconvert>
2020-07-22 18:08:33 -04:00
2018-11-17 19:01:40 -05:00
<local name= "isjar" />
<condition property= "isjar" >
<contains string= "@{src}" substring= ".jar" />
</condition>
2020-07-22 18:08:33 -04:00
<mkdir dir= "@{src}/META-INF/versions/9" />
2021-12-08 12:21:21 -05:00
<local name= "module-name" />
<loadresource property= "module-name" >
<string > @{module}</string>
<filterchain >
<replacestring from= "poi-" to= "" />
</filterchain>
</loadresource>
2021-05-13 08:11:38 -04:00
2021-12-08 12:21:21 -05:00
<echo message= "Building maven-jar for @{module}, module-name: ${module-name} with isJava8: ${isJava8} and src: @{src}" />
2021-05-13 08:11:40 -04:00
2020-07-22 18:08:33 -04:00
<javac release= "9"
2021-03-27 10:03:16 -04:00
srcdir="${basedir}/@{module}/src/main/java9"
2020-07-22 18:08:33 -04:00
destdir="@{src}/META-INF/versions/9"
includeantruntime="false"
fork="true"
modulepath="${main.lib}"
unless:true="${isJava8}">
2021-05-13 08:11:38 -04:00
<compilerarg line= "--patch-module org.apache.poi.${module-name}=@{src}" />
2020-07-22 18:08:33 -04:00
<elements />
</javac>
<jar destfile= "build/dist/maven/${destfile}.jar" >
2018-11-17 19:01:40 -05:00
<fileset dir= "@{src}" unless:true= "${isjar}" />
<zipfileset src= "@{src}" if:true= "${isjar}" />
2021-04-07 17:40:33 -04:00
<metainf dir= "legal/" excludes= "HEADER" />
2020-07-22 18:08:33 -04:00
<manifest >
<attribute name= "Multi-Release" value= "true" />
<attribute name= "Automatic-Module-Name" value= "org.apache.poi.@{module}" />
<attribute name= "Built-By" value= "${user.name}" />
<attribute name= "Specification-Title" value= "Apache POI" />
<attribute name= "Specification-Version" value= "${version.id}" />
<attribute name= "Specification-Vendor" value= "The Apache Software Foundation" />
<attribute name= "Implementation-Title" value= "Apache POI" />
<attribute name= "Implementation-Version" value= "${version.id}" />
<attribute name= "Implementation-Vendor-Id" value= "org.apache.poi" />
<attribute name= "Implementation-Vendor" value= "The Apache Software Foundation" />
</manifest>
2016-03-06 20:58:26 -05:00
</jar>
</sequential>
</macrodef>
2020-07-22 18:08:33 -04:00
<target name= "jar" depends= "compile, compile-ooxml-lite" description= "Creates jar files for distribution" >
2009-11-21 10:30:54 -05:00
</target>
2014-11-14 19:00:30 -05:00
<target name= "-do-jar-check-javadocs-package-list" >
<condition property= "javadocs.package-list.present" >
2018-07-18 19:24:53 -04:00
<available file= "${javadocs.report.dir}/package-list" />
2014-11-14 19:00:30 -05:00
</condition>
</target>
<target name= "-do-jar-create-javadocs-package-list"
2015-08-07 19:33:30 -04:00
depends="-do-jar-check-javadocs-package-list"
unless="javadocs.package-list.present">
<antcall target= "javadocs" />
2014-11-14 19:00:30 -05:00
</target>
2015-08-07 19:33:30 -04:00
2021-03-27 10:03:16 -04:00
<target name= "jar-javadocs" description= "JavaDocs for Maven" depends= "compile,-do-jar-create-javadocs-package-list" >
2014-11-10 07:29:08 -05:00
<property name= "build.maven.javadocs" location= "build/tmp/maven-javadocs" />
2021-03-27 10:03:16 -04:00
<manifest file= "build/poi-manifest.mf" >
<attribute name= "Multi-Release" value= "true" />
<attribute name= "Built-By" value= "${user.name}" />
<attribute name= "Specification-Title" value= "Apache POI" />
<attribute name= "Specification-Version" value= "${version.id}" />
<attribute name= "Specification-Vendor" value= "The Apache Software Foundation" />
<attribute name= "Implementation-Title" value= "Apache POI" />
<attribute name= "Implementation-Version" value= "${version.id}" />
<attribute name= "Implementation-Vendor-Id" value= "org.apache.poi" />
<attribute name= "Implementation-Vendor" value= "The Apache Software Foundation" />
</manifest>
2014-11-10 07:29:08 -05:00
<!-- Build and package the main javadocs -->
2016-04-17 18:01:48 -04:00
<maven-javadocs src= "${main.src}" dest= "${jar.name}" />
2014-11-10 07:29:08 -05:00
<!-- Build and package the scratchpad javadocs -->
2016-04-17 18:01:48 -04:00
<maven-javadocs src= "${scratchpad.src}" dest= "${jar.name}-scratchpad" />
2014-11-10 07:29:08 -05:00
<!-- Build and package the ooxml javadocs -->
2016-04-17 18:01:48 -04:00
<maven-javadocs src= "${ooxml.src}" dest= "${jar.name}-ooxml" />
2014-11-10 06:20:48 -05:00
</target>
2016-03-06 20:58:26 -05:00
<macrodef name= "maven-javadocs" >
<attribute name= "src" />
<attribute name= "dest" />
<sequential >
<echo message= "Building @{dest} javadocs from @{src}" />
<local name= "build.maven.javadocs" />
<property name= "build.maven.javadocs" location= "build/tmp/maven-javadocs" />
<delete dir= "${build.maven.javadocs}" />
<mkdir dir= "${build.maven.javadocs}" />
<javadoc verbose= "false" author= "false" destdir= "${build.maven.javadocs}"
windowtitle="POI API Documentation" use="false" version="false"
maxmemory="384M" additionalparam="-notimestamp -quiet" locale="en_US"
classpathref="javadoc.classpath">
<packageset dir= "@{src}" defaultexcludes= "yes" >
<include name= "org/apache/poi/**" />
</packageset>
2018-10-30 07:55:11 -04:00
<link offline= "true" href= "https://poi.apache.org/apidocs/dev" packagelistLoc= "${javadocs.report.dir}" />
2016-03-06 20:58:26 -05:00
</javadoc>
<jar destfile= "${dist.dir}/maven/@{dest}/@{dest}-${version.id}-javadoc.jar"
manifest="build/poi-manifest.mf">
<fileset dir= "${build.maven.javadocs}" />
2021-04-07 17:40:33 -04:00
<metainf dir= "legal/" excludes= "HEADER" />
2016-03-06 20:58:26 -05:00
</jar>
</sequential>
</macrodef>
2016-04-03 18:19:44 -04:00
2014-07-30 03:32:21 -04:00
<target name= "release-notes" depends= "init" >
2016-04-17 18:01:48 -04:00
<copy file= "src/documentation/RELEASE-NOTES.txt" todir= "build/dist/" overwrite= "true" >
2014-07-30 03:32:21 -04:00
<filterset >
<filter token= "VERSION" value= "${version.id}" />
<filter token= "DSTAMP" value= "${DSTAMP}" />
2016-04-03 18:19:44 -04:00
<filter token= "RELEASE_TAG" value= "${RELEASE_TAG}" />
2014-07-30 03:32:21 -04:00
</filterset>
</copy>
</target>
2020-07-22 18:08:33 -04:00
<target name= "assemble" depends= "jar,jar-javadocs" description= "Produce the zipped distribution files" >
2016-04-07 19:11:22 -04:00
<property name= "zipdir" value= "${jar.name}-${version.id}" />
<mappedresources id= "legal-files" cache= "true" >
2021-04-07 17:40:33 -04:00
<fileset dir= "legal" excludes= "HEADER" />
2016-04-07 19:11:22 -04:00
<globmapper from= "*" to= "${zipdir}/*" />
</mappedresources>
<!-- jars to include in binary assemblies -->
<union id= "bin-files" cache= "true" >
<mappedresources refid= "legal-files" />
<mappedresources cache= "true" >
<fileset dir= "${main.lib}" >
<include name= "commons-codec-*.jar" />
2016-07-31 17:23:34 -04:00
<include name= "commons-collections4-*.jar" />
2017-09-13 19:54:36 -04:00
<include name= "commons-math3-*.jar" />
2021-05-13 20:37:50 -04:00
<include name= "commons-io-*.jar" />
2021-02-21 15:57:25 -05:00
<include name= "log4j-api-*.jar" />
2020-01-07 10:45:07 -05:00
<include name= "SparseBitSet-*.jar" />
2016-04-07 19:11:22 -04:00
</fileset>
<globmapper from= "*" to= "${zipdir}/lib/*" />
</mappedresources>
<mappedresources cache= "true" >
2020-09-03 15:13:16 -04:00
<fileset dir= "${ooxml.lib}" />
2018-06-22 17:25:00 -04:00
<regexpmapper from= "^(.*\.jar)$$" to= "${zipdir}/ooxml-lib/\1" />
2016-04-07 19:11:22 -04:00
</mappedresources>
<mappedresources cache= "true" >
2020-09-03 15:13:16 -04:00
<fileset dir= "${ooxml-provided.lib}" />
<regexpmapper from= "^(.*\.jar)$$" to= "${zipdir}/auxiliary/\1" />
</mappedresources>
2021-02-23 17:29:51 -05:00
<mappedresources cache= "true" >
<fileset dir= "${ooxml-batik.lib}" />
<regexpmapper from= "^(.*\.jar)$$" to= "${zipdir}/auxiliary/\1" />
</mappedresources>
2020-09-03 15:13:16 -04:00
<mappedresources cache= "true" >
<fileset dir= "${dist.dir}/maven" includes= "**/*.jar" excludes= "**/*-javadoc.jar,**/*-sources.jar,**/*-tests.jar" />
2016-04-07 19:11:22 -04:00
<chainedmapper >
<flattenmapper />
<globmapper from= "*" to= "${zipdir}/*" />
</chainedmapper>
</mappedresources>
<mappedresources cache= "true" >
<fileset dir= "${build.site}" />
<globmapper from= "*" to= "${zipdir}/docs/*" />
</mappedresources>
</union>
2009-11-23 03:43:04 -05:00
2015-08-07 19:33:30 -04:00
<!-- patterns to exclude from source assemblies -->
2016-04-07 19:11:22 -04:00
<union id= "src-files" cache= "true" >
<mappedresources refid= "legal-files" />
<mappedresources cache= "true" >
2021-03-27 10:03:16 -04:00
<fileset dir= "." excludes= "*/build/**,build/**,
2014-11-08 08:40:53 -05:00
dist*/**,
2009-11-23 03:43:04 -05:00
lib/**,
2016-11-14 14:50:39 -05:00
bin/**,
out/**,
2018-11-17 19:01:40 -05:00
tmp/**,
2021-05-22 16:16:21 -04:00
gradle/**,
2014-11-08 08:40:53 -05:00
compile-lib/**,
2009-11-23 03:43:04 -05:00
ooxml-lib/**,
2018-11-25 16:56:26 -05:00
ooxml-testlib/**,
2009-11-23 03:43:04 -05:00
scripts/**,
TEST*,
2021-05-24 12:17:05 -04:00
gradlew,
gradlew.bat
2009-11-23 03:43:04 -05:00
*.ipr,
2021-04-07 17:40:33 -04:00
**/*.iml,
2009-11-23 03:43:04 -05:00
*.iws,
*.lnk,
*.rdf,
*.swp,
2016-11-14 14:50:39 -05:00
*.launch,
*.log,
.gradle/**,
.idea/**,
2010-08-05 07:20:25 -04:00
.settings/**,
2009-11-23 03:43:04 -05:00
.classpath,
2010-09-21 07:55:17 -04:00
.settings/**,
2009-11-23 03:43:04 -05:00
.project"/>
2016-04-07 19:11:22 -04:00
<globmapper from= "*" to= "${zipdir}/*" />
</mappedresources>
</union>
2009-11-21 10:30:54 -05:00
<zip destfile= "${dist.dir}/${jar.name}-bin-${version.id}-${DSTAMP}.zip" >
2016-04-07 19:11:22 -04:00
<union refid= "bin-files" />
2009-11-21 10:30:54 -05:00
</zip>
2016-04-07 19:11:22 -04:00
<tar destfile= "${dist.dir}/${jar.name}-bin-${version.id}-${DSTAMP}.tar.gz" longfile= "gnu" compression= "gzip" >
<union refid= "bin-files" />
</tar>
2009-11-21 10:30:54 -05:00
<zip destfile= "${dist.dir}/${jar.name}-src-${version.id}-${DSTAMP}.zip" >
2016-04-07 19:11:22 -04:00
<union refid= "src-files" />
2009-11-21 10:30:54 -05:00
</zip>
2015-08-07 19:33:30 -04:00
2016-04-07 19:11:22 -04:00
<tar destfile= "${dist.dir}/${jar.name}-src-${version.id}-${DSTAMP}.tar.gz" longfile= "gnu" compression= "gzip" >
<union refid= "src-files" />
2009-11-21 10:30:54 -05:00
</tar>
2015-08-07 19:33:30 -04:00
2009-11-23 03:43:04 -05:00
<echo > Distribution located in ${dist.dir}</echo>
2018-09-01 18:58:51 -04:00
<echo > Use "ant dist-checksum" to create sha256/sha512 checksums and GPG signatures</echo>
2007-12-30 13:11:55 -05:00
</target>
2003-04-23 20:53:41 -04:00
2021-11-30 01:19:59 -05:00
<target name= "osgi" >
2015-04-24 21:53:30 -04:00
<echo message= "Building OSGi bundle via Maven" />
2015-04-24 22:18:06 -04:00
<mvn:mvn pom= "osgi/pom.xml" >
2015-04-24 21:53:30 -04:00
<arg value= "-Dpoi.version=${version.id}" />
<arg value= "install" />
</mvn:mvn>
</target>
2018-11-17 19:01:40 -05:00
<target name= "dist" depends= "clean, compile, test-all, rat-check, forbidden-apis-check, docs, jar, release-notes, assemble"
2009-11-21 10:30:54 -05:00
description="Creates the entire distribution into build/dist, from scratch">
</target>
2016-06-13 03:15:47 -04:00
<!-- continuous integration targets -->
2019-04-07 03:17:52 -04:00
<target name= "jenkins"
2021-12-05 12:34:58 -05:00
depends="replaceVersion, compile, test-all, jar, javadocs, assemble, findbugs, release-notes, rat-check, forbidden-apis-check, help, fetch-svn-jars, maventask"
2016-06-13 03:15:47 -04:00
description="Target run by Jenkins on a continuous basis. Builds and tests POI, generates artifacts and documentation, and searches for problems."/>
2014-08-10 14:25:10 -04:00
2019-04-07 03:17:52 -04:00
<target name= "maventask" depends= "init" >
<downloadfile src= "${maven.ant.url}" dest= "${maven.ant.jar}" />
2015-08-07 19:33:30 -04:00
2019-04-07 03:17:52 -04:00
<path id= "maven-ant-tasks.classpath" >
<pathelement location= "${maven.ant.jar}" />
</path>
<taskdef uri= "antlib:org.apache.maven.artifact.ant" resource= "org/apache/maven/artifact/ant/antlib.xml" >
<classpath refid= "maven-ant-tasks.classpath" />
</taskdef>
2010-01-24 08:05:48 -05:00
</target>
2015-10-05 08:23:07 -04:00
<target name= "rat-check" depends= "init" description= "Runs the Apache Creadur Rat check against the source code, to spot any files which are missing the correct license headers" >
2018-02-28 05:30:05 -05:00
<mkdir dir= "${rat.reportdir}" />
2014-01-20 14:25:22 -05:00
2018-02-28 05:30:05 -05:00
<typedef resource= "org/apache/rat/anttasks/antlib.xml"
2014-01-20 14:25:22 -05:00
uri="antlib:org.apache.rat.anttasks"
2014-10-10 02:48:29 -04:00
classpath="${rat.jar}" />
2018-02-28 05:30:05 -05:00
<rat:report xmlns:rat= "antlib:org.apache.rat.anttasks" reportFile= "${rat.report}" >
2021-04-07 17:40:33 -04:00
<fileset dir= "poi-examples/src" excludes= "main/java/org/apache/poi/**/*-chart-data.txt" />
<fileset dir= "poi-excelant/src" />
<fileset dir= "poi-integration/src" />
<fileset dir= "poi/src" >
2021-03-27 10:03:16 -04:00
<exclude name= "main/resources/org/apache/poi/sl/draw/geom/presetShapeDefinitions.xml" />
</fileset>
2021-04-07 17:40:33 -04:00
<fileset dir= "poi-ooxml/src" >
2021-03-27 10:03:16 -04:00
<exclude name= "main/resources/org/apache/poi/xslf/usermodel/notesMaster.xml" />
<exclude name= "main/resources/org/apache/poi/xslf/usermodel/empty.pptx" />
<exclude name= "main/resources/org/apache/poi/xssf/usermodel/presetTableStyles.xml" />
</fileset>
2021-04-07 17:40:33 -04:00
<fileset dir= "poi-ooxml-full/src" >
2021-03-27 10:03:16 -04:00
<exclude name= "main/xmlschema/org/apache/poi/xdgf/visio.xsd" />
2022-07-10 17:55:06 -04:00
<exclude name= "main/xmlschema/org/apache/poi/schemas/*.xsd" />
2021-03-27 10:03:16 -04:00
<exclude name= "main/xmlschema/org/apache/poi/schemas/*.zip" />
</fileset>
2021-04-07 17:40:33 -04:00
<fileset dir= "poi-scratchpad/src" />
2021-03-27 10:03:16 -04:00
<fileset dir= "src" >
2018-02-28 05:30:05 -05:00
<exclude name= "documentation/*.txt" />
<exclude name= "documentation/content/xdocs/dtd/" />
<exclude name= "documentation/content/xdocs/entity/" />
<exclude name= "documentation/resources/images/pb-poi.cdr" />
2022-04-01 17:32:03 -04:00
<exclude name= "resources/ooxml-lite-report.*" />
2018-02-28 05:30:05 -05:00
</fileset>
</rat:report>
<!-- remove clutter to compact build output -->
<!-- replaceregexp doesn't work within loadfile ... -->
<replaceregexp file= "${rat.report}" match= "\s+Printing headers for files without AL header.++" replace= "" flags= "s" />
<loadfile property= "rat.reportcontent" srcFile= "${rat.report}" >
2015-12-20 12:01:46 -05:00
<filterchain >
2016-04-17 18:01:48 -04:00
<linecontainsregexp negate= "true" >
<regexp pattern= "^\s+(AL|B|N)\s+" />
</linecontainsregexp>
2015-12-20 12:01:46 -05:00
</filterchain>
2018-02-28 05:30:05 -05:00
</loadfile>
<echo > ${rat.reportcontent}</echo>
2015-08-07 19:33:30 -04:00
2018-02-28 05:30:05 -05:00
<!-- fail the build if at least one note is in the report -->
<fail > <condition > <matches pattern= "[1-9][0-9]* Unknown Licens" string= "${rat.reportcontent}" /> </condition> </fail>
2010-05-24 10:16:15 -04:00
</target>
2015-08-07 19:33:30 -04:00
2015-08-27 09:07:36 -04:00
<!-- Runs the Forbiddens APIs checker against the source code, to -->
<!-- spot any cases where we've accidently used methods we shouldn't -->
<!-- See https://github.com/policeman - tools/forbidden - apis for details -->
<!-- of the checks that this can do -->
2017-09-16 04:20:50 -04:00
<target name= "forbidden-apis-check" depends= "init, compile, compile-integration" >
2016-03-06 20:58:26 -05:00
<taskdef name= "forbiddenapis"
classname="de.thetaphi.forbiddenapis.ant.AntTask"
2015-08-27 09:23:44 -04:00
classpath="${forbidden.jar}"/>
2015-12-02 16:47:52 -05:00
2020-07-22 18:08:33 -04:00
<path id= "forbiddenapis.classpath" >
<fileset dir= "lib/main" includes= "*.jar" />
<fileset dir= "lib/main-tests" includes= "*.jar" />
<fileset dir= "lib/ooxml" includes= "*.jar" />
<fileset dir= "lib/ooxml-tests" includes= "*.jar" />
<fileset dir= "lib/ooxml-provided" includes= "*.jar" />
<fileset dir= "lib/excelant" includes= "*.jar" />
<pathelement location= "${ooxml.xsds.jar}" />
2020-08-17 16:25:08 -04:00
<pathelement location= "build/dist/maven/poi-tests/poi-${version.id}-tests.jar" />
2020-07-22 18:08:33 -04:00
<pathelement location= "build/dist/maven/poi-examples/poi-examples-${version.id}.jar" />
<path path= "${env.CLASSPATH}" />
2021-02-23 16:59:56 -05:00
<path refid= "batik.classpath" />
2020-07-22 18:08:33 -04:00
</path>
2020-08-17 16:25:08 -04:00
<!-- forbiddenapis bundled signatures max supported version is 14 -->
<condition property= "forbiddenVersion" value= "14" >
<javaversion atleast= "15" />
</condition>
<property name= "forbiddenVersion" value= "${ant.java.version}" />
2020-07-22 18:08:33 -04:00
2015-12-02 16:47:52 -05:00
<!-- first check rules that apply to all the source code -->
2016-03-06 20:58:26 -05:00
<forbiddenapis
2015-11-08 06:57:58 -05:00
classpathref="forbiddenapis.classpath"
2015-11-08 05:01:48 -05:00
suppressAnnotation="org.apache.poi.util.SuppressForbidden"
2020-08-17 16:25:08 -04:00
targetVersion="${forbiddenVersion}"
2015-11-08 05:01:48 -05:00
>
2016-05-24 10:17:52 -04:00
<bundledsignatures name= "jdk-unsafe" />
<bundledsignatures name= "jdk-deprecated" />
<bundledsignatures name= "jdk-internal" />
<bundledsignatures name= "jdk-non-portable" />
<bundledsignatures name= "jdk-reflection" />
2016-03-06 20:58:26 -05:00
<!--
2015-11-08 05:01:48 -05:00
<bundledsignatures name= "jdk-system-out" />
-->
<signaturesFileset file= "src/resources/devtools/forbidden-signatures.txt" />
2021-03-27 10:03:16 -04:00
<!-- use the plain test - /classes instead of the dist - zips, otherwise forbidden - apis is soo slow ... -->
<fileset dir= "${main.output.dir}" />
<fileset dir= "${main.output.test.dir}" />
<fileset dir= "${scratchpad.output.dir}" />
<fileset dir= "${scratchpad.output.test.dir}" />
<fileset dir= "${examples.output.dir}" />
<fileset dir= "${ooxml.output.dir}" />
<fileset dir= "${ooxml.output.test.dir}" />
<fileset dir= "${excelant.output.dir}" />
<fileset dir= "${excelant.output.test.dir}" />
<fileset dir= "${integration.output.test.dir}" />
2015-08-27 09:23:44 -04:00
</forbiddenapis>
2015-12-02 16:47:52 -05:00
<!-- then check some advanced rules which we only apply to the core code and not tests or examples -->
2016-03-06 20:58:26 -05:00
<forbiddenapis
2015-12-02 16:47:52 -05:00
classpathref="forbiddenapis.classpath"
suppressAnnotation="org.apache.poi.util.SuppressForbidden"
2020-08-17 16:25:08 -04:00
targetVersion="${forbiddenVersion}"
2015-12-02 16:47:52 -05:00
>
<signaturesFileset file= "src/resources/devtools/forbidden-signatures-prod.txt" />
<!-- sources -->
2021-03-27 10:03:16 -04:00
<fileset dir= "${main.output.dir}" />
<fileset dir= "${ooxml.output.dir}" />
<fileset dir= "${scratchpad.output.dir}" />
<fileset dir= "${excelant.output.dir}" />
2015-12-02 16:47:52 -05:00
</forbiddenapis>
2015-08-27 09:07:36 -04:00
</target>
2018-12-12 18:25:07 -05:00
<!-- disabling findbugs until jenkins is updated to a current IBM JDK
see https://stackoverflow.com/a/48561534/2066598
this should be replaced by spotbugs when available in the jenkins warnings plugin -->
2018-12-12 19:06:36 -05:00
<target name= "findbugs" depends= "jar" unless= "${isIBMVM}" >
2020-05-06 09:48:25 -04:00
<property name= "spotbugs.home" value= "build/findbugs" />
<property name= "spotbugs.lib" value= "/build/findbugs/lib" />
<!-- findbugs successor, spotbugs ... need to use the dependencies used in the spotbugs release. -->
<!-- compare with the entries found in the MANIFEST.MF of spotbugs.jar -->
2020-12-28 09:49:29 -05:00
<dependency prefix= "spotbugs" artifact= "com.github.spotbugs:spotbugs:4.2.0" usage= "${spotbugs.lib}" target= "spotbugs.jar" />
<dependency prefix= "spotbugs-ant" artifact= "com.github.spotbugs:spotbugs-ant:4.2.0" usage= "${spotbugs.lib}" target= "spotbugs-ant.jar" />
<dependency prefix= "spotbugs-anno" artifact= "com.github.spotbugs:spotbugs-annotations:4.2.0" usage= "${spotbugs.lib}" target= "spotbugs-annotations.jar" />
2020-10-25 08:51:34 -04:00
<dependency prefix= "spotbugs.asm" artifact= "org.ow2.asm:asm:9.0" usage= "${spotbugs.lib}" />
<dependency prefix= "spotbugs.asm-analysis" artifact= "org.ow2.asm:asm-analysis:9.0" usage= "${spotbugs.lib}" />
<dependency prefix= "spotbugs.asm-commons" artifact= "org.ow2.asm:asm-commons:9.0" usage= "${spotbugs.lib}" />
<dependency prefix= "spotbugs.asm-tree" artifact= "org.ow2.asm:asm-tree:9.0" usage= "${spotbugs.lib}" />
<dependency prefix= "spotbugs.asm-util" artifact= "org.ow2.asm:asm-util:9.0" usage= "${spotbugs.lib}" />
2020-05-06 09:48:25 -04:00
<dependency prefix= "spotbugs.jsr305" artifact= "com.google.code.findbugs:jsr305:3.0.2" usage= "${spotbugs.lib}" />
2020-11-11 16:53:05 -05:00
<dependency prefix= "spotbugs.dom4j" artifact= "org.dom4j:dom4j:2.1.3" usage= "${spotbugs.lib}" />
<dependency prefix= "spotbugs.jaxen" artifact= "jaxen:jaxen:1.2.0" usage= "${spotbugs.lib}" />
<dependency prefix= "spotbugs.bcel" artifact= "org.apache.bcel:bcel:6.5.0" usage= "${spotbugs.lib}" />
2020-05-06 09:48:25 -04:00
<dependency prefix= "spotbugs.slf4j-api" artifact= "org.slf4j:slf4j-api:1.8.0-beta4" usage= "${spotbugs.lib}" />
2020-11-11 16:53:05 -05:00
<dependency prefix= "spotbugs.commons-lang3" artifact= "org.apache.commons:commons-lang3:3.11" usage= "${spotbugs.lib}" />
<dependency prefix= "spotbugs.commons-text" artifact= "org.apache.commons:commons-text:1.9" usage= "${spotbugs.lib}" />
2020-05-06 09:48:25 -04:00
<dependency prefix= "spotbugs.jcip-annotations" artifact= "net.jcip:jcip-annotations:1.0" usage= "${spotbugs.lib}" />
2020-12-28 09:49:29 -05:00
<dependency prefix= "spotbugs.icu4j" artifact= "com.ibm.icu:icu4j:68.2" usage= "${spotbugs.lib}" target= "icu4j-63.1.jar" />
2022-07-03 18:52:21 -04:00
<dependency prefix= "spotbugs.log4j-api" artifact= "org.apache.logging.log4j:log4j-api:2.18.0" usage= "${spotbugs.lib}" />
<dependency prefix= "spotbugs.log4j-core" artifact= "org.apache.logging.log4j:log4j-core:2.18.0" usage= "${spotbugs.lib}" />
<dependency prefix= "spotbugs.log4j-slf4j18-impl" artifact= "org.apache.logging.log4j:log4j-slf4j18-impl:2.18.0" usage= "${spotbugs.lib}" />
2020-12-28 09:49:29 -05:00
<dependency prefix= "spotbugs.saxon" artifact= "net.sf.saxon:Saxon-HE:9.9.1-8" usage= "${spotbugs.lib}" />
2020-05-06 09:48:25 -04:00
<mkdir dir= "${basedir}${spotbugs.lib}/config" />
<downloadfile src= "${spotbugs.url}" dest= "${spotbugs.jar}" />
<downloadfile src= "${spotbugs-ant.url}" dest= "${spotbugs-ant.jar}" />
<downloadfile src= "${spotbugs-anno.url}" dest= "${spotbugs-anno.jar}" />
<downloadfile src= "${spotbugs.dom4j.url}" dest= "${spotbugs.dom4j.jar}" />
<downloadfile src= "${spotbugs.jaxen.url}" dest= "${spotbugs.jaxen.jar}" />
<downloadfile src= "${spotbugs.bcel.url}" dest= "${spotbugs.bcel.jar}" />
<downloadfile src= "${spotbugs.slf4j-api.url}" dest= "${spotbugs.slf4j-api.jar}" />
<downloadfile src= "${spotbugs.commons-lang3.url}" dest= "${spotbugs.commons-lang3.jar}" />
<downloadfile src= "${spotbugs.commons-text.url}" dest= "${spotbugs.commons-text.jar}" />
<downloadfile src= "${spotbugs.jcip-annotations.url}" dest= "${spotbugs.jcip-annotations.jar}" />
<downloadfile src= "${spotbugs.jsr305.url}" dest= "${spotbugs.jsr305.jar}" />
<downloadfile src= "${spotbugs.asm.url}" dest= "${spotbugs.asm.jar}" />
<downloadfile src= "${spotbugs.asm-analysis.url}" dest= "${spotbugs.asm-analysis.jar}" />
<downloadfile src= "${spotbugs.asm-commons.url}" dest= "${spotbugs.asm-commons.jar}" />
<downloadfile src= "${spotbugs.asm-tree.url}" dest= "${spotbugs.asm-tree.jar}" />
<downloadfile src= "${spotbugs.asm-util.url}" dest= "${spotbugs.asm-util.jar}" />
<downloadfile src= "${spotbugs.log4j-api.url}" dest= "${spotbugs.log4j-api.jar}" />
<downloadfile src= "${spotbugs.log4j-core.url}" dest= "${spotbugs.log4j-core.jar}" />
<downloadfile src= "${spotbugs.log4j-slf4j18-impl.url}" dest= "${spotbugs.log4j-slf4j18-impl.jar}" />
<downloadfile src= "${spotbugs.saxon.url}" dest= "${spotbugs.saxon.jar}" />
<downloadfile src= "${spotbugs.icu4j.url}" dest= "${spotbugs.icu4j.jar}" />
<taskdef resource= "edu/umd/cs/findbugs/anttask/tasks.properties" >
2015-08-07 19:33:30 -04:00
<classpath >
2020-05-06 09:48:25 -04:00
<pathelement location= "${spotbugs-ant.jar}" />
2015-08-07 19:33:30 -04:00
</classpath>
</taskdef>
2016-06-11 17:23:01 -04:00
2020-05-06 09:48:25 -04:00
<echo file= "${basedir}${spotbugs.lib}/config/log4j2.xml" > <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<Configuration status= "WARN" >
<Appenders >
<Console name= "Console" target= "SYSTEM_OUT" >
<PatternLayout pattern= "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
</Console>
</Appenders>
<Loggers >
<Root level= "error" >
<AppenderRef ref= "Console" />
</Root>
</Loggers>
</Configuration>
]]></echo>
<spotbugs home= "${spotbugs.home}"
2016-11-29 17:41:26 -05:00
output="xml:withMessages"
outputFile="build/findbugs.xml"
effort="max"
2016-07-31 17:23:34 -04:00
failOnError="true"
2016-06-11 17:23:01 -04:00
excludeFilter="src/resources/devtools/findbugs-filters.xml">
2016-03-09 16:36:26 -05:00
<fileset dir= "${dist.dir}/maven" >
<include name= "poi/poi-${version.id}.jar" />
<include name= "poi-scratchpad/poi-scratchpad-${version.id}.jar" />
<include name= "poi-ooxml/poi-ooxml-${version.id}.jar" />
2016-07-31 13:19:05 -04:00
<include name= "poi-excelant/poi-excelant-${version.id}.jar" />
2015-08-07 19:33:30 -04:00
</fileset>
2015-10-22 11:21:25 -04:00
<auxClasspath path= "${dsig.bouncycastle-pkix.jar}" />
<auxClasspath path= "${dsig.bouncycastle-prov.jar}" />
2021-06-28 15:52:52 -04:00
<auxClasspath path= "${dsig.bouncycastle-util.jar}" />
2015-10-22 11:21:25 -04:00
<auxClasspath path= "${dsig.xmlsec.jar}" />
2015-10-06 22:41:30 -04:00
<auxClasspath path= "${ooxml.xsds.jar}" />
2016-01-29 17:08:55 -05:00
<auxClasspath path= "${ooxml.curvesapi.jar}" />
2018-06-10 12:39:24 -04:00
<auxClasspath path= "${ooxml.xmlbeans.jar}" />
2018-06-03 18:09:11 -04:00
<auxClasspath path= "${ooxml.commons-compress.jar}" />
2016-07-31 17:23:34 -04:00
<auxClasspath path= "${main.commons-collections4.jar}" />
2017-09-13 19:54:36 -04:00
<auxClasspath path= "${main.commons-math3.jar}" />
2021-05-13 20:37:50 -04:00
<auxClasspath path= "${main.commons-io.jar}" />
2015-10-13 12:37:22 -04:00
<auxClasspath path= "${main.commons-codec.jar}" />
<auxClasspath path= "${main.commons-logging.jar}" />
2021-02-21 15:57:25 -05:00
<auxClasspath path= "${main.log4j-api.jar}" />
<auxClasspath path= "${main.log4j-core.jar}" />
2020-12-24 13:42:29 -05:00
<auxClasspath path= "${main.junit-api.jar}" />
<auxClasspath path= "${main.junit-jengine.jar}" />
<auxClasspath path= "${main.junit-params.jar}" />
<auxClasspath path= "${main.junit-plauncher.jar}" />
<auxClasspath path= "${main.junit-pengine.jar}" />
<auxClasspath path= "${main.junit-pcommons.jar}" />
<auxClasspath path= "${main.junit-opentest4j.jar}" />
<auxClasspath path= "${main.junit-apiguardian.jar}" />
2017-05-15 19:27:21 -04:00
<auxClasspath path= "${main.jmh.jar}" />
<auxClasspath path= "${main.jmhAnnotation.jar}" />
2016-07-31 17:23:34 -04:00
<auxClasspath path= "${main.ant.jar}" />
2020-01-07 10:45:07 -05:00
<auxClasspath path= "${main.com.zaxxer.jar}" />
2021-02-21 19:18:37 -05:00
<auxClasspath path= "${svg.batik-anim.jar}" />
<auxClasspath path= "${svg.batik-awt-util.jar}" />
<auxClasspath path= "${svg.batik-bridge.jar}" />
<auxClasspath path= "${svg.batik-codec.jar}" />
<auxClasspath path= "${svg.batik-constants.jar}" />
<auxClasspath path= "${svg.batik-css.jar}" />
<auxClasspath path= "${svg.batik-dom.jar}" />
<auxClasspath path= "${svg.batik-ext.jar}" />
<auxClasspath path= "${svg.batik-gvt.jar}" />
<auxClasspath path= "${svg.batik-i18n.jar}" />
<auxClasspath path= "${svg.batik-parser.jar}" />
2021-05-14 07:38:31 -04:00
<auxClasspath path= "${svg.batik-script.jar}" />
2021-02-21 19:18:37 -05:00
<auxClasspath path= "${svg.batik-shared-resources.jar}" />
<auxClasspath path= "${svg.batik-svg-dom.jar}" />
<auxClasspath path= "${svg.batik-svggen.jar}" />
<auxClasspath path= "${svg.batik-svgrasterizer.jar}" />
<auxClasspath path= "${svg.batik-transcoder.jar}" />
<auxClasspath path= "${svg.batik-util.jar}" />
<auxClasspath path= "${svg.batik-xml.jar}" />
2019-02-23 02:52:29 -05:00
<auxClasspath path= "${svg.xml-apis-ext.jar}" />
<auxClasspath path= "${svg.xmlgraphics-commons.jar}" />
2020-11-02 19:22:10 -05:00
<auxClasspath path= "${pdf.pdfbox.jar}" />
<auxClasspath path= "${pdf.fontbox.jar}" />
<auxClasspath path= "${pdf.graphics2d.jar}" />
2021-04-07 17:40:33 -04:00
<sourcePath path= "poi/src/main/java" />
<sourcePath path= "poi-excelant/src/main/java" />
<sourcePath path= "poi-examples/src/main/java" />
<sourcePath path= "poi-ooxml/src/main/java" />
<sourcePath path= "poi-scratchpad/src/main/java" />
2020-05-06 09:48:25 -04:00
</spotbugs>
2016-07-02 18:09:00 -04:00
2016-11-29 17:41:26 -05:00
<!-- instead of calling findbugs again, we simply transform the xml -->
2020-05-06 09:48:25 -04:00
<makeurl file= "${basedir}${spotbugs.lib}/spotbugs.jar" property= "findbugs.jarurl" />
2016-06-11 17:23:01 -04:00
<!-- although there's a findbugs history task too, it doesn't make much sense to provide it, -->
<!-- as the build directory (i.e. the old findbugs.xml) is deleted regularly -->
2016-11-29 17:41:26 -05:00
<xslt basedir= "build" destdir= "build" includes= "findbugs.xml" force= "true" >
<style >
2020-05-06 09:48:25 -04:00
<url url= "jar:${findbugs.jarurl}!/fancy.xsl" />
2016-11-29 17:41:26 -05:00
</style>
2020-05-06 09:48:25 -04:00
<classpath >
<pathelement location= "${spotbugs.saxon.jar}" />
</classpath>
<factory name= "net.sf.saxon.TransformerFactoryImpl" />
2016-11-29 17:41:26 -05:00
</xslt>
2015-08-07 19:33:30 -04:00
</target>
2020-05-06 09:48:25 -04:00
2015-08-07 19:33:30 -04:00
<target name= "test-scratchpad-download-resources" >
<!-- disable font downloading until TestFontRendering works on all plattforms -->
<!-- ... eventually copy the files into the resource dirs ... -->
<!--
<mkdir dir= "build/scratchpad-test-resources" />
2014-02-11 18:16:54 -05:00
<antcall target= "downloadfile" >
2016-04-12 05:52:42 -04:00
<param name= "sourcefile" value= "https://sourceforge.net/projects/monafont/files/monafont/monafont-2.90/monafont-ttf-2.90.zip/download" />
2014-02-11 18:16:54 -05:00
<param name= "destfile" value= "build/scratchpad-test-resources/monafont-ttf-2.90.zip" />
</antcall>
2015-08-07 19:33:30 -04:00
<unzip src= "build/scratchpad-test-resources/monafont-ttf-2.90.zip"
dest="build/scratchpad-test-resources">
<patternset >
<include name= "mona.ttf" />
</patternset>
</unzip>
2014-02-11 18:16:54 -05:00
<antcall target= "downloadfile" >
<param name= "sourcefile" value= "https://googlefontdirectory.googlecode.com/hg-history/c5955de4df3e40f6ab705bbccbd1f5ad93998287/cabin/Cabin-Regular.ttf" />
<param name= "destfile" value= "build/scratchpad-test-resources/Cabin-Regular.ttf" />
</antcall>
2014-03-04 17:23:29 -05:00
-->
2015-08-07 19:33:30 -04:00
</target>
2016-03-06 20:58:26 -05:00
<target name= "dist-checksum" depends= "load-maven-server-settings" >
<fileset id= "dist-archives" dir= "${dist.dir}" includes= "**/*.jar,**/*.pom,**/*.zip,**/*.tar.gz" />
<checksum algorithm= "sha1" format= "MD5SUM" >
<fileset refid= "dist-archives" />
</checksum>
<checksum algorithm= "md5" format= "MD5SUM" >
<fileset refid= "dist-archives" />
</checksum>
2018-09-01 18:58:51 -04:00
<checksum algorithm= "SHA-256" fileext= ".sha256" format= "MD5SUM" >
<fileset refid= "dist-archives" />
</checksum>
<checksum algorithm= "SHA-512" fileext= ".sha512" format= "MD5SUM" >
<fileset refid= "dist-archives" />
</checksum>
2016-03-06 20:58:26 -05:00
2018-09-01 18:58:51 -04:00
<fixcrlf srcDir= "${dist.dir}" includes= "**/*.md5,**/*.sha1,**/*.sha256,**/*.sha512" eol= "unix" />
2016-03-06 20:58:26 -05:00
2020-08-18 09:50:31 -04:00
<downloadfile src= "${dsig.bouncycastle-bcpg.url}" dest= "${dsig.bouncycastle-bcpg.jar}" />
2016-03-06 20:58:26 -05:00
<downloadfile src= "${dist.commons-openpgp.url}" dest= "${dist.commons-openpgp.jar}" />
<taskdef resource= "org/apache/commons/openpgp/ant/antlib.xml" uri= "antlib:org.apache.commons.openpgp.ant" >
<classpath >
<pathelement path= "${dist.commons-openpgp.jar}" />
2020-08-18 09:50:31 -04:00
<pathelement path= "${dsig.bouncycastle-prov.jar}" />
<pathelement path= "${dsig.bouncycastle-bcpg.jar}" />
2016-03-06 20:58:26 -05:00
</classpath>
</taskdef>
<openpgp:signer secring= "${settings.poi-signing.privateKey}"
pubring="${settings.poi-signing.publicKey}"
password="${settings.poi-signing.passphrase}" keyid="${settings.poi-signing.username}"
asciiarmor="true">
<fileset refid= "dist-archives" />
</openpgp:signer>
</target>
2016-04-17 21:28:11 -04:00
<target name= "dist-nexus" depends= "load-maven-server-settings,dist-checksum"
description="upload build artifacts to nexus">
2016-04-15 07:06:58 -04:00
<delete dir= "build/repo" />
<delete dir= "build/nexus-stage" />
<nexus-upload artifactId= "poi" />
<nexus-upload artifactId= "poi-examples" />
<nexus-upload artifactId= "poi-excelant" />
<nexus-upload artifactId= "poi-ooxml" />
2020-12-13 10:32:43 -05:00
<nexus-upload artifactId= "poi-ooxml-lite" />
<nexus-upload artifactId= "poi-ooxml-full" />
2016-04-15 07:06:58 -04:00
<nexus-upload artifactId= "poi-scratchpad" />
</target>
2016-03-06 20:58:26 -05:00
<macrodef name= "nexus-upload" >
<attribute name= "artifactId" />
<sequential >
2016-04-15 07:06:58 -04:00
<local name= "repo" />
<property name= "repo" location= "build/repo/@{artifactId}" />
<copy todir= "${repo}" >
<mappedresources >
2017-09-15 14:39:18 -04:00
<!-- add sha - 512 when nexus rules are updated (1/2) -->
2018-11-26 16:24:46 -05:00
<fileset dir= "build/dist/maven" includes= "@{artifactId}/**" excludes= "**/*.sha512,**/*.sha256" />
2016-04-15 07:06:58 -04:00
<regexpmapper from= "^([^/]+)/(.*)$$" to= "org/apache/poi/\1/${version.id}/\2" handledirsep= "true" />
</mappedresources>
</copy>
<local name= "lastUpdated" />
<tstamp >
<format property= "lastUpdated" pattern= "yyyyMMddHHmmss" timezone= "UTC" />
2016-05-16 05:49:17 -04:00
</tstamp>
2016-04-15 07:06:58 -04:00
<local name= "metadir" />
<property name= "metadir" location= "${repo}/org/apache/poi/@{artifactId}" />
<echo file= "${metadir}/maven-metadata.xml" > <![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<metadata >
<groupId > org.apache.poi</groupId>
<artifactId > @{artifactId}</artifactId>
<versioning >
<latest > ${version.id}</latest>
<release > ${version.id}</release>
<versions >
<version > ${version.id}</version>
</versions>
<lastUpdated > ${lastUpdated}</lastUpdated>
</versioning>
</metadata> ]]></echo>
2018-07-18 19:24:53 -04:00
<fixcrlf srcdir= "${metadir}" includes= "maven-metadata.xml" eol= "unix" eof= "remove" />
2017-08-28 16:41:16 -04:00
<!-- add sha - 512 when nexus rules are updated (2/2) -->
<!-- checksum algorithm="SHA - 512" fileext=".sha512" format="MD5SUM">
2017-08-16 09:44:58 -04:00
<fileset dir= "${metadir}" includes= "maven-metadata.xml" />
2017-08-28 16:41:16 -04:00
</checksum-->
2016-04-15 07:06:58 -04:00
<checksum algorithm= "sha1" format= "MD5SUM" >
<fileset dir= "${metadir}" includes= "maven-metadata.xml" />
</checksum>
<checksum algorithm= "md5" format= "MD5SUM" >
<fileset dir= "${metadir}" includes= "maven-metadata.xml" />
</checksum>
2018-09-01 18:58:51 -04:00
<fixcrlf srcDir= "${metadir}" includes= "*.md5,*.sha1,*.sha256,*.sha512" eol= "unix" />
2016-04-15 07:06:58 -04:00
2016-03-06 20:58:26 -05:00
<downloadfile src= "${dist.nexus-staging.url}" dest= "${dist.nexus-staging.jar}" />
<taskdef uri= "antlib:org.sonatype.nexus.ant.staging" resource= "org/sonatype/nexus/ant/staging/antlib.xml" >
<classpath > <pathelement path= "${dist.nexus-staging.jar}" /> </classpath>
</taskdef>
2016-04-15 07:06:58 -04:00
<staging:stageLocally description= "@{artifactId} ${version.id}" >
<staging:nexusStagingInfo stagingDirectory= "build/nexus-stage/@{artifactId}" />
<fileset dir= "${repo}" />
</staging:stageLocally>
<!-- if this throws a "... dh keypair ..." exception, use Java 7+ for executing the task -->
<staging:stageRemotely description= "@{artifactId} ${version.id}" >
<staging:nexusStagingInfo stagingDirectory= "build/nexus-stage/@{artifactId}" >
2016-03-06 20:58:26 -05:00
<staging:projectInfo groupId= "org.apache.poi" artifactId= "@{artifactId}" version= "${version.id}" />
2016-04-15 07:06:58 -04:00
<staging:connectionInfo baseUrl= "https://repository.apache.org/" >
2016-04-03 18:19:44 -04:00
<staging:authentication username= "${settings.apache-id.username}" password= "${settings.apache-id.password}" />
2016-03-06 20:58:26 -05:00
</staging:connectionInfo>
</staging:nexusStagingInfo>
</staging:stageRemotely>
</sequential>
</macrodef>
2016-04-07 19:11:22 -04:00
<target name= "-init-svn" depends= "init,fetch-svn-jars,load-maven-server-settings" >
<!-- JAVA_HOME needs to point to a JRE/JDK7+, otherwise the svn/https connection throws a "Could not generate DH keypair" -->
2017-09-15 14:39:18 -04:00
<fail message= "Environment needs to point to Java 8+" >
2016-04-07 19:11:22 -04:00
<condition >
<or >
2017-09-15 14:39:18 -04:00
<equals arg1= "${ant.java.version}" arg2= "1.7" />
2016-04-07 19:11:22 -04:00
<equals arg1= "${ant.java.version}" arg2= "1.6" />
<equals arg1= "${ant.java.version}" arg2= "1.5" />
</or>
</condition>
</fail>
<path id= "path.svnant" >
2020-05-05 09:36:30 -04:00
<pathelement location= "${dist.svnant.jar}" />
2020-08-18 09:50:31 -04:00
<pathelement location= "${dist.svnclientadapter-base.jar}" />
<pathelement location= "${dist.svnclientadapter-svnkit.jar}" />
<pathelement location= "${dist.svnclientadapter-javahl.jar}" />
2020-05-05 09:36:30 -04:00
<pathelement location= "${dist.svnkit.jar}" />
<pathelement location= "${dist.svnkit-javahl16.jar}" />
<pathelement location= "${dist.sqljet.jar}" />
<pathelement location= "${dist.antlr.jar}" />
<pathelement location= "${dist.sequence-library.jar}" />
2021-01-12 17:39:07 -05:00
<pathelement location= "${dist.lz4-java.jar}" />
2016-04-07 19:11:22 -04:00
</path>
<taskdef resource= "org/tigris/subversion/svnant/svnantlib.xml" classpathref= "path.svnant" />
<svnSetting
svnkit="true"
javahl="false"
username="${settings.apache-id.username}"
password="${settings.apache-id.password}"
id="svn.settings"
/>
</target>
2017-01-31 19:59:20 -05:00
<target name= "release-prep0" depends= "-init-svn" description= "check to make sure the release tag doesn't exist yet" >
<!-- verify that svn username/password are valid ... -->
2017-02-01 19:48:03 -05:00
<fail message= "Unable to connect to SVN repo. Verify apache-id username and password. If these are correct, change the release-prep0 target to check over http, which would indicate a problem with your https setup." >
2017-01-31 19:59:20 -05:00
<condition >
2017-02-01 19:48:03 -05:00
<not > <svnExists refid= "svn.settings" target= "https://svn.apache.org/repos/asf/poi/" /> </not>
2017-01-31 19:59:20 -05:00
</condition>
</fail>
<!-- verify that the release tag that we're about to create in release - prep1 does not already exist (no overwriting tags!) -->
2017-01-31 20:24:02 -05:00
<fail message= "Cannot create release tag. https://svn.apache.org/repos/asf/poi/tags/${RELEASE_TAG} already exists. Verify the requested release version (${version.id})." >
2017-01-31 19:59:20 -05:00
<condition >
2017-02-01 19:48:03 -05:00
<svnExists refid= "svn.settings" target= "https://svn.apache.org/repos/asf/poi/tags/${RELEASE_TAG}/" />
2017-01-31 19:59:20 -05:00
</condition>
</fail>
</target>
2016-04-07 19:11:22 -04:00
<!-- experimental release preparation ... tbd. ... -->
2017-01-31 19:59:20 -05:00
<target name= "release-prep1" depends= "-init-svn,release-prep0" description= "update the documentation and create the svn tag - needs Java7+" >
2016-04-03 18:19:44 -04:00
<local name= "tstamp_rel" />
<local name= "tstamp_next" />
<local name= "rel_next" />
<tstamp >
<format property= "tstamp_rel" pattern= "yyyy-MM-dd" offset= "7" unit= "day" />
<format property= "tstamp_next" pattern= "yyyy-MM" offset= "3" unit= "month" />
</tstamp>
2021-04-07 17:40:33 -04:00
<taskdef name= "NextRelease" classname= "NextRelease" classpath= "poi-excelant/build/poi-ant-contrib" />
2020-09-21 20:07:32 -04:00
<NextRelease property= "rel_next" />
2016-04-03 18:19:44 -04:00
<antcall target= "-update-build.xml" >
<param name= "version_id" value= "${version.id}" />
</antcall>
<replaceregexp byline= "true" >
<regexp pattern= "<release.*date=".*\?\?">" />
<substitution expression= "<!-- release version="${rel_next}" date="${tstamp_next}-??"> </release --> <release version="${version.id}" date="${tstamp_rel}">" />
<fileset dir= "src/documentation/content/xdocs" >
2018-08-31 08:08:40 -04:00
<include name= "changes.xml" />
2016-04-03 18:19:44 -04:00
</fileset>
</replaceregexp>
2018-08-31 08:08:40 -04:00
<fixcrlf srcdir= "." includes= "src/documentation/content/xdocs/changes.xml" eol= "unix" eof= "remove" />
2016-04-03 18:19:44 -04:00
<!-- can't combine updating and pinning of the documentation ... so we need two commits -->
<!-- (revision)properties can't be set and read within one svn block -->
2018-08-31 08:08:40 -04:00
<echo message= "updating build.xml and changes.xml" />
<exec command= "svn ci --username ${settings.apache-id.username} --password ${settings.apache-id.password} -m 'release prepare for ${version.id} - updating build.xml and changes.xml' build.xml src/documentation/content/xdocs/changes.xml" />
2016-08-21 17:33:03 -04:00
<svn refid= "svn.settings" >
2018-08-31 08:08:40 -04:00
<!-- <commit message="release prepare for ${version.id} - updating build.xml and changes.xml" recurse="false">
<fileset dir= "." includes= "build.xml,src/documentation/content/xdocs/changes.xml" />
2016-08-21 17:43:38 -04:00
</commit> -->
2016-04-03 18:58:08 -04:00
<update dir= "." recurse= "true" />
2016-04-03 18:19:44 -04:00
<status path= "." revisionProperty= "svn_version1" />
2016-08-21 17:33:03 -04:00
</svn>
2016-04-03 18:58:08 -04:00
<echo message= "pin documentation - release ${svn_version1}" />
2016-08-21 17:43:38 -04:00
<exec command= "svn ci --username ${settings.apache-id.username} --password ${settings.apache-id.password} -m 'release prepare for ${version.id} - pin documentation' src" />
2016-04-03 18:19:44 -04:00
<svn refid= "svn.settings" >
<propset path= "src" name= "svn:externals" value= "documentation -r${svn_version1} https://svn.apache.org/repos/asf/poi/site/src/documentation" />
2016-08-21 17:43:38 -04:00
<!-- <commit message="release prepare for ${version.id} - pin documentation" dir="src" recurse="false"/> -->
2016-04-03 18:58:08 -04:00
<update dir= "." recurse= "true" />
2016-04-03 18:19:44 -04:00
<status path= "." revisionProperty= "svn_version2" />
</svn>
<echo message= "create release tag" />
<svn refid= "svn.settings" >
<copy
srcUrl="https://svn.apache.org/repos/asf/poi/trunk"
destUrl="https://svn.apache.org/repos/asf/poi/tags/${RELEASE_TAG}"
2016-04-03 18:58:08 -04:00
message="tag r${svn_version2} as ${version.id}"/>
2016-04-03 18:19:44 -04:00
</svn>
2018-09-07 15:25:02 -04:00
<!-- update build.xml to the next snapshot version -->
2016-04-03 18:19:44 -04:00
<antcall target= "-update-build.xml" >
<param name= "version_id" value= "${rel_next}" />
</antcall>
2018-09-07 15:25:02 -04:00
<!-- unpin documentation and commit next snapshot version -->
2016-04-03 18:19:44 -04:00
<svn refid= "svn.settings" >
2016-04-03 18:23:21 -04:00
<update dir= "." recurse= "true" />
2016-04-03 18:19:44 -04:00
<propset path= "src" name= "svn:externals" value= "documentation https://svn.apache.org/repos/asf/poi/site/src/documentation" />
2016-08-21 17:43:38 -04:00
<!-- <commit message="prepare for ${rel_next}" recurse="false">
2016-04-03 18:19:44 -04:00
<fileset dir= "." includes= "build.xml" />
<dirset dir= "src" />
2016-08-21 17:43:38 -04:00
</commit> -->
2016-04-03 18:19:44 -04:00
</svn>
2021-10-15 03:58:20 -04:00
<exec command= "svn ci --username ${settings.apache-id.username} --password ${settings.apache-id.password} -m 'prepare for ${rel_next}' build.xml src poi*" />
2016-04-07 19:11:22 -04:00
<mkdir dir= "build/release" />
<svn refid= "svn.settings" >
2021-01-15 19:19:04 -05:00
<checkout url= "https://svn.apache.org/repos/asf/poi/tags/${RELEASE_TAG}" destPath= "build/release" ignoreExternals= "false" />
2016-04-07 19:11:22 -04:00
</svn>
</target>
<target name= "release-prep2" depends= "init" description= "compile the freshly checked out svn tag and upload it to the nexus - needs a JDK6" >
2019-04-04 23:44:02 -04:00
<!-- JAVA_HOME needs to point to a JDK8, otherwise the ant invocation is failing on a missing javac -->
2017-09-15 14:39:18 -04:00
<fail message= "Environment needs to point to a Java 8 JDK" >
2016-04-07 19:11:22 -04:00
<condition >
2017-09-15 14:39:18 -04:00
<not > <equals arg1= "${ant.java.version}" arg2= "1.8" /> </not>
2016-04-07 19:11:22 -04:00
</condition>
</fail>
<local name= "DSTAMP" />
<tstamp >
<format property= "DSTAMP" pattern= "yyyyMMdd" offset= "7" unit= "day" />
</tstamp>
<ant dir= "build/release" inheritAll= "false" inheritRefs= "false" useNativeBasedir= "true" >
<property name= "DSTAMP" value= "${DSTAMP}" />
<target name= "dist" />
</ant>
</target>
<target name= "release-prep3" depends= "-init-svn" description= "write the dist to the release candidate repo - needs Java7+" >
2016-07-02 18:09:00 -04:00
<ant dir= "build/release" inheritAll= "false" inheritRefs= "false" useNativeBasedir= "true" >
<target name= "dist-nexus" />
</ant>
2016-11-29 17:41:26 -05:00
<svn refid= "svn.settings" >
2016-04-07 19:11:22 -04:00
<import path= "build/release/build/dist"
url="https://dist.apache.org/repos/dist/dev/poi"
2016-04-09 07:28:12 -04:00
newEntry="${version.id}-${release.rc}"
2016-04-07 19:11:22 -04:00
message="release candidate POI ${version.id}"/>
</svn>
2016-04-03 18:19:44 -04:00
</target>
2018-09-07 15:25:02 -04:00
<target name= "release-finish" description= "write the dist to the release candidate repo - needs Java7+" >
<!-- svn refid="svn.settings">
<update dir= "." recurse= "true" />
</svn-->
<local name= "rel_prev" />
<local name= "file_date" />
<local name= "file_date_iso" />
<tstamp >
<!-- usually overwritten by a command line argument -->
<!-- for convience this is kept in the same format as in the release - prep call -->
<format property= "file_date" pattern= "yyyyMMdd" locale= "US" />
</tstamp>
2021-04-07 17:40:33 -04:00
<taskdef name= "NextRelease" classname= "NextRelease" classpath= "poi-excelant/build/poi-ant-contrib" />
2020-09-21 20:07:32 -04:00
<NextRelease property= "rel_prev" increment= "-1" />
<!-- we don't simply generate a new iso file date with tstamp,
but potentially use the date given as an argument to ant -->
<loadresource property= "file_date_iso" >
<string > ${file_date}</string>
<filterchain >
<replaceregex pattern= "([0-9]{4})([0-9]{2})([0-9]{2})" replace= "\1-\2-\3" />
</filterchain>
</loadresource>
2018-09-07 15:25:02 -04:00
<replaceregexp file= "build.gradle" match= "( +version += +)'[^']+'" replace= "\1'${version.id}'" />
2021-04-07 17:40:33 -04:00
<replaceregexp file= "poi-examples/src/main/groovy/build.gradle" match= "( *compile 'org.apache.poi:[^0-9]+)([0-9.]+)'" replace= "\1${rel_prev}'" byline= "true" />
<replaceregexp file= "poi-examples/src/main/scala/build.sbt" match= '( *org.apache.poi.* ")[0-9.]+(.+)' replace= "\1${rel_prev}\2" byline= "true" />
2021-01-17 13:24:31 -05:00
<replaceregexp file= "osgi/pom.xml" match= "version>${rel_prev}[^<]+" replace= "version>${version.id}" />
2018-09-07 15:25:02 -04:00
<replaceregexp file= "doap_POI.rdf" match= "<release>" replace= "<release> <Version> <name>Apache POI ${rel_prev}</name> <created>${file_date_iso}</created> <revision>${rel_prev}</revision> </Version> </release> <release>" />
</target>
2016-04-03 18:19:44 -04:00
<target name= "-update-build.xml" >
<replaceregexp byline= "true" >
<regexp pattern= "(<property name="version.id" value=")[^"]+("/>)" />
<substitution expression= "\1${version_id}\2" />
<fileset dir= "." >
<include name= "build.xml" />
</fileset>
</replaceregexp>
<fixcrlf srcdir= "." includes= "build.xml" eol= "unix" eof= "remove" />
</target>
2016-03-06 20:58:26 -05:00
<!--
Configure gpg settings in local maven settings.xml
see release-guide.txt for more details
-->
<target name= "load-maven-server-settings" >
<xslt in= "${user.home}/.m2/settings.xml" out= "build/tmp/signing.properties" >
<style >
<string > < ![CDATA[
<xsl:stylesheet version= "1.0" xmlns:xsl= "http://www.w3.org/1999/XSL/Transform" xmlns:mvn= "http://maven.apache.org/SETTINGS/1.0.0" >
<xsl:output method= "text" version= "1.0" encoding= "ISO-8859-1" />
<xsl:template match= "@*|text()" />
2016-04-03 18:19:44 -04:00
<xsl:template match= "//mvn:server[contains('poi-signing|apache-id',mvn:id/text())]/*[name(.)!='id']" >
2016-03-06 20:58:26 -05:00
<xsl:value-of select= "concat('settings.',../mvn:id,'.',name(.),'=',translate(text(),'\','/'),'
')" />
</xsl:template>
</xsl:stylesheet>
]]></string>
</style>
</xslt>
<loadproperties srcFile= "build/tmp/signing.properties" />
<pathconvert property= "settings.poi-signing.publicKey" >
<path > <pathelement path= "${settings.poi-signing.privateKey}" /> </path>
<mapper > <filtermapper > <replacestring from= "secring" to= "pubring" /> </filtermapper> </mapper>
</pathconvert>
</target>
2016-07-02 18:09:00 -04:00
2016-11-29 17:41:26 -05:00
<macrodef name= "loadChecksum" >
<attribute name= "url" />
<attribute name= "property" />
<sequential >
<loadresource property= "@{property}" >
<url url= "@{url}" />
<filterchain >
<striplinebreaks />
<replaceregex pattern= " .*" replace= "" />
</filterchain>
</loadresource>
</sequential>
</macrodef>
2016-07-02 18:09:00 -04:00
2018-09-08 17:23:19 -04:00
<macrodef name= "download-line" >
<attribute name= "prop" />
<attribute name= "dist" />
<attribute name= "pack" />
2016-07-02 18:09:00 -04:00
<sequential >
2018-09-08 17:23:19 -04:00
<local name= "baseurl" />
2020-03-08 04:28:04 -04:00
<property name= "baseurl" value= "https://downloads.apache.org/poi/release" />
2018-09-08 17:23:19 -04:00
<local name= "basedyn" />
<property name= "basedyn" value= "https://www.apache.org/dyn/closer.lua/poi/release" />
2016-11-29 17:41:26 -05:00
<delete file= "build/loadFilesize.txt" />
<record name= "build/loadFilesize.txt" action= "start" loglevel= "verbose" append= "false" />
2018-09-08 17:23:19 -04:00
<http url= "${baseurl}/@{dist}/poi-@{dist}-${version.id}-${file_date}.@{pack}" method= "HEAD" expected= "200" printrequestheaders= "false" printresponseheaders= "false" />
2016-11-29 17:41:26 -05:00
<record name= "build/loadFilesize.txt" action= "stop" />
<local name= "fileSize" />
<loadfile property= "fileSize" srcFile= "build/loadFilesize.txt" >
<filterchain >
<tokenfilter >
<containsstring contains= "Content-Length" />
<replaceregex pattern= ".* ([0-9]+)$" replace= "\1" flags= "gi" />
</tokenfilter>
2021-01-17 15:32:16 -05:00
<striplinebreaks />
2016-11-29 17:41:26 -05:00
</filterchain>
</loadfile>
2018-09-08 17:23:19 -04:00
2021-04-07 17:40:33 -04:00
<taskdef name= "bytes2mega" classname= "Bytes2Mega" classpath= "poi-excelant/build/poi-ant-contrib" />
2018-09-08 17:23:19 -04:00
<local name= "fileSizeMb" />
<bytes2mega property= "fileSizeMb" bytes= "${fileSize}" />
<property name= "@{prop}" > <![CDATA[<li>
<a href= "${basedyn}/@{dist}/poi-@{dist}-${version.id}-${file_date}.@{pack}" > poi-@{dist}-${version.id}-${file_date}.@{pack}</a>
(${fileSizeMb} MB, <a href= "${baseurl}/@{dist}/poi-@{dist}-${version.id}-${file_date}.@{pack}.asc" > signature (.asc)</a> ,
checksum: <a href= "${baseurl}/@{dist}/poi-@{dist}-${version.id}-${file_date}.@{pack}.sha256" > SHA-256</a> ,
<a href= "${baseurl}/@{dist}/poi-@{dist}-${version.id}-${file_date}.@{pack}.sha512" > SHA-512</a> )
</li> ]]></property>
2016-07-02 18:09:00 -04:00
</sequential>
</macrodef>
2016-11-29 17:41:26 -05:00
<!-- TODO: currently this only saves a copy and paste snipplet to a file ...
2018-08-31 08:08:40 -04:00
would be nice if it really changes changes.xml and download.xml
2016-11-29 17:41:26 -05:00
Doesn't work with Java6 - the https urls can't be accessed via loadChecksum
-->
<target name= "update-download" >
2020-05-05 09:36:30 -04:00
<downloadfile src= "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/missing-link/ml-ant-http-1.1.3.zip" dest= "${util.lib}/ml-ant-http-1.1.3.zip" />
<unzip src= "${util.lib}/ml-ant-http-1.1.3.zip" dest= "${util.lib}" >
2016-07-02 18:09:00 -04:00
<patternset >
<include name= "ml-ant-http-1.1.3.jar" />
</patternset>
2016-11-29 17:41:26 -05:00
</unzip>
2016-07-02 18:09:00 -04:00
<taskdef name= "http" classname= "org.missinglink.ant.task.http.HttpClientTask" >
<classpath >
2020-05-05 09:36:30 -04:00
<path location= "${util.lib}/ml-ant-http-1.1.3.jar" />
2016-07-02 18:09:00 -04:00
</classpath>
</taskdef>
2016-11-29 17:41:26 -05:00
<tstamp >
<format property= "rel_date" pattern= "dd MMMM yyyy" locale= "US" />
<format property= "file_date" pattern= "yyyyMMdd" locale= "US" />
</tstamp>
2018-09-08 17:23:19 -04:00
<local name= "li1" />
<local name= "li2" />
<local name= "li3" />
<local name= "li4" />
<download-line prop= "li1" dist= "bin" pack= "tar.gz" />
<download-line prop= "li2" dist= "bin" pack= "zip" />
<download-line prop= "li3" dist= "src" pack= "tar.gz" />
<download-line prop= "li4" dist= "src" pack= "zip" />
<echo file= "download-snipplet.xml" > < ![CDATA[
2016-07-02 18:09:00 -04:00
<section id= "POI-${version.id}" > <title > ${rel_date} - POI ${version.id} available</title>
<p > The Apache POI team is pleased to announce the release of ${version.id}.
Featured are a handful of new areas of functionality and numerous bug fixes.</p>
<p > A summary of changes is available in the
2018-09-05 19:00:15 -04:00
<a href= "https://www.apache.org/dyn/closer.lua/poi/dev/RELEASE-NOTES-${version.id}.txt" > Release Notes</a> .
A full list of changes is available in the <a href= "site:changes" > change log</a> .
People interested should also follow the <a href= "site:mailinglists" > dev list</a>
2016-07-02 18:09:00 -04:00
to track progress.</p>
<p >
The POI source release as well as the pre-built binary deployment packages are listed below.
2018-09-05 19:00:15 -04:00
Pre-built versions of all <a href= "site:components" > POI components</a>
2016-07-02 18:09:00 -04:00
are available in the central Maven repository under Group ID "org.apache.poi" and Version
"${version.id}".
</p>
2017-04-16 16:40:47 -04:00
<section id= "POI-${version.id}-bin" > <title > Binary Distribution</title>
2016-07-02 18:09:00 -04:00
<ul >
2018-09-08 17:23:19 -04:00
${li1}
${li2}
2016-07-02 18:09:00 -04:00
</ul>
</section>
2017-04-16 16:40:47 -04:00
<section id= "POI-${version.id}-src" > <title > Source Distribution</title>
2016-07-02 18:09:00 -04:00
<ul >
2018-09-08 17:23:19 -04:00
${li3}
${li4}
2016-07-02 18:09:00 -04:00
</ul>
</section>
</section>
]]></echo>
2016-11-29 17:41:26 -05:00
</target>
2017-07-08 19:44:35 -04:00
2020-12-15 18:04:14 -05:00
<target name= "test-env" description= "tests if ant is available on the jenkins worker" >
2019-12-09 17:53:14 -05:00
<echo > Using Ant: ${ant.version} from ${ant.home}</echo>
2017-07-08 19:44:35 -04:00
</target>
2019-04-07 03:17:58 -04:00
2021-12-08 12:21:21 -05:00
<target name= "replaceVersion" description= "Apply the version from build.xml in all other places" >
<replaceregexp
2019-04-07 03:17:58 -04:00
match=" version = '[0-9.]+(?:-SNAPSHOT)?'"
replace=" version = '${version.id}'">
2021-12-08 12:21:21 -05:00
<fileset dir= "." >
<include name= "build.gradle" />
</fileset>
2019-10-26 01:26:47 -04:00
</replaceregexp>
2021-12-08 12:21:21 -05:00
<replaceregexp
2021-11-02 09:19:16 -04:00
match="< poi.version>[0-9.]+(?:-SNAPSHOT)?< /poi.version>"
replace="< poi.version>${version.id}< /poi.version>">
2021-12-08 12:21:21 -05:00
<fileset dir= "." >
<include name= "osgi/pom.xml" />
</fileset>
2019-04-07 03:17:58 -04:00
</replaceregexp>
2021-12-08 12:21:21 -05:00
</target>
2016-12-30 12:00:13 -05:00
</project>