2015-05-31 16:11:28 -04:00
|
|
|
<?xml version="1.0"?>
|
2020-05-07 06:27:52 -04:00
|
|
|
<!--
|
2015-05-31 17:02:39 -04: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.
|
|
|
|
-->
|
2015-05-31 16:11:28 -04:00
|
|
|
<project name="POI Testbuild" default="run" basedir=".">
|
|
|
|
|
2015-06-16 01:42:36 -04:00
|
|
|
<description>Test-Ant file which verifies that the Apache POI distribution build sources can be compiled successfully.
|
2020-05-07 06:27:52 -04:00
|
|
|
|
2021-11-02 09:18:07 -04:00
|
|
|
Before running this, you should execute the "jar" target in the main build.gradle to have the packaged files created correctly.
|
2015-06-16 01:42:36 -04:00
|
|
|
</description>
|
2016-05-24 09:39:46 -04:00
|
|
|
|
2021-03-27 21:12:58 -04:00
|
|
|
<property name="dist" value="../build/dist"/>
|
|
|
|
<property name="build" value="../build/distsourcebuild"/>
|
2016-05-24 09:39:46 -04:00
|
|
|
|
2021-11-02 09:18:07 -04:00
|
|
|
<condition property="gradle.executable" value="../gradlew.bat" else="../gradlew">
|
|
|
|
<os family="windows" />
|
|
|
|
</condition>
|
|
|
|
|
2015-05-31 16:11:28 -04:00
|
|
|
<target name="init" depends="">
|
|
|
|
</target>
|
2016-05-24 09:39:46 -04:00
|
|
|
|
2015-06-16 01:42:36 -04:00
|
|
|
<target name="run" depends="init,runSourceBuild,runCompileTest"/>
|
2016-05-24 09:39:46 -04:00
|
|
|
|
2015-06-16 01:42:36 -04:00
|
|
|
<target name="runSourceBuild" depends="init">
|
2015-05-31 16:11:28 -04:00
|
|
|
<!-- clean out old stuff in build-dir -->
|
|
|
|
<delete dir="${build}"/>
|
|
|
|
<mkdir dir="${build}"/>
|
|
|
|
|
2015-06-16 01:42:36 -04:00
|
|
|
<!-- select latest built source zip -->
|
2015-05-31 16:11:28 -04:00
|
|
|
<pathconvert property="srcpackage">
|
|
|
|
<last>
|
|
|
|
<sort>
|
|
|
|
<date xmlns="antlib:org.apache.tools.ant.types.resources.comparators"/>
|
|
|
|
<resources>
|
|
|
|
<fileset dir="${dist}">
|
2024-06-23 03:38:33 -04:00
|
|
|
<include name="apache-poi-src-*.zip"/>
|
2015-05-31 16:11:28 -04:00
|
|
|
</fileset>
|
|
|
|
</resources>
|
|
|
|
</sort>
|
|
|
|
</last>
|
|
|
|
</pathconvert>
|
|
|
|
|
|
|
|
<echo message="Found source package at ${srcpackage}"/>
|
|
|
|
<unzip src="${srcpackage}" dest="${build}" failOnEmptyArchive="true"/>
|
|
|
|
|
|
|
|
<!-- look for name of sub-dir, do this dynamically as it changes with every (beta|rc)-release -->
|
|
|
|
<pathconvert property="dirversion">
|
|
|
|
<dirset dir="${build}">
|
2016-05-24 09:39:46 -04:00
|
|
|
<include name="*"/>
|
2015-05-31 16:11:28 -04:00
|
|
|
</dirset>
|
|
|
|
</pathconvert>
|
|
|
|
|
2016-05-24 09:39:46 -04:00
|
|
|
<!-- copy over required libs to avoid re-downloading them always -->
|
|
|
|
<mkdir dir="${dirversion}/lib"/>
|
|
|
|
<copy todir="${dirversion}/lib">
|
2021-03-27 21:12:58 -04:00
|
|
|
<fileset dir="../lib"/>
|
2016-05-24 09:39:46 -04:00
|
|
|
</copy>
|
|
|
|
|
2015-05-31 16:11:28 -04:00
|
|
|
<!-- finally call Ant on the extracted source to check if we can build the packages -->
|
|
|
|
<echo message="Building in temporary dir ${dirversion}/"/>
|
2021-11-02 09:18:07 -04:00
|
|
|
<!--ant dir="${dirversion}" target="assemble" inheritAll="false" inheritRefs="false" useNativeBasedir="true"/-->
|
|
|
|
<exec executable="${gradle.executable}" dir="." failonerror="true">
|
|
|
|
<arg value="assemble" />
|
|
|
|
</exec>
|
2015-05-31 16:11:28 -04:00
|
|
|
</target>
|
2015-06-16 01:42:36 -04:00
|
|
|
|
|
|
|
<target name="runCompileTest" depends="init" description="Verify that we can compile most examples without including excelant or scratchpad jars">
|
|
|
|
<!-- clean out old stuff in build-dir -->
|
2018-11-19 15:47:03 -05:00
|
|
|
<delete dir="${build}" quiet="true" failonerror="false"/>
|
|
|
|
<!-- ... try again - on Windows, the JaCoCo ant task seems to keep files open and hence the lib directory can't be removed -->
|
|
|
|
<delete dir="${build}" quiet="true" failonerror="false"/>
|
2015-06-16 01:42:36 -04:00
|
|
|
<mkdir dir="${build}"/>
|
2016-05-24 09:39:46 -04:00
|
|
|
|
2015-06-16 01:42:36 -04:00
|
|
|
<!-- select latest built jar files without scratchpad.jar -->
|
|
|
|
<pathconvert property="jarpackage">
|
2016-05-24 09:39:46 -04:00
|
|
|
<sort>
|
|
|
|
<resources>
|
|
|
|
<fileset dir="${dist}">
|
2020-05-17 15:16:57 -04:00
|
|
|
<include name="**/poi-5.*.jar"/>
|
|
|
|
<include name="**/poi-ooxml-5.*.jar"/>
|
2020-12-13 10:32:43 -05:00
|
|
|
<include name="**/poi-ooxml-lite-5.*.jar"/>
|
2016-05-24 09:39:46 -04:00
|
|
|
<exclude name="**/*-javadoc*"/>
|
|
|
|
<exclude name="**/*-sources*"/>
|
|
|
|
</fileset>
|
|
|
|
</resources>
|
|
|
|
</sort>
|
2015-06-16 01:42:36 -04:00
|
|
|
</pathconvert>
|
|
|
|
|
2016-05-24 09:39:46 -04:00
|
|
|
<fail message="Did not find jar packages looking in directory ${dist}">
|
|
|
|
<condition>
|
|
|
|
<or>
|
|
|
|
<equals arg1="${jarpackage}" arg2=""/>
|
|
|
|
<not>
|
|
|
|
<isset property="jarpackage"/>
|
|
|
|
</not>
|
|
|
|
</or>
|
|
|
|
</condition>
|
|
|
|
</fail>
|
|
|
|
|
|
|
|
<echo message="Found jar packages at ${jarpackage}, dist: ${dist}"/>
|
|
|
|
<path id="libs">
|
2021-03-27 21:12:58 -04:00
|
|
|
<fileset dir="../lib/main" includes="*.jar"/>
|
|
|
|
<fileset dir="../lib/ooxml" includes="*.jar"/>
|
|
|
|
<fileset dir="../lib/main-tests">
|
2016-05-24 09:39:46 -04:00
|
|
|
<include name="junit*.jar"/>
|
|
|
|
</fileset>
|
|
|
|
</path>
|
|
|
|
|
|
|
|
<echo message="Compiling examples without linking to scratchpad.jar to ensure that only some specific ones require this jar"/>
|
2021-04-10 06:01:50 -04:00
|
|
|
<javac srcdir="../poi-examples/src/main/java" destdir="${build}"
|
2017-09-15 14:39:18 -04:00
|
|
|
target="1.8" source="1.8" debug="true"
|
2020-05-07 06:27:52 -04:00
|
|
|
encoding="ASCII" fork="yes" includeantruntime="false"
|
2020-11-28 09:19:30 -05:00
|
|
|
excludes="org/apache/poi/examples/hslf/**,org/apache/poi/examples/hsmf/**,org/apache/poi/examples/hwmf/**,**/EmbeddedObjects.java,**/EmeddedObjects.java,**/LoadEmbedded.java,**/Word2Forrest.java"
|
2016-05-24 09:39:46 -04:00
|
|
|
classpath="${jarpackage}" classpathref="libs">
|
2015-06-16 01:42:36 -04:00
|
|
|
</javac>
|
2016-05-24 09:39:46 -04:00
|
|
|
|
2015-06-16 01:42:36 -04:00
|
|
|
<!-- select latest built jar files with additionally scratchpad.jar -->
|
|
|
|
<pathconvert property="jarpackagescratchpad">
|
2016-05-24 09:39:46 -04:00
|
|
|
<sort>
|
|
|
|
<resources>
|
|
|
|
<fileset dir="${dist}">
|
2020-05-17 15:16:57 -04:00
|
|
|
<include name="**/poi-5.*.jar"/>
|
|
|
|
<include name="**/poi-ooxml-5.*.jar"/>
|
2020-12-13 10:32:43 -05:00
|
|
|
<include name="**/poi-ooxml-lite-5.*.jar"/>
|
2020-05-17 15:16:57 -04:00
|
|
|
<include name="**/poi-scratchpad-5.*.jar"/>
|
2016-05-24 09:39:46 -04:00
|
|
|
<exclude name="**/*-javadoc*"/>
|
|
|
|
<exclude name="**/*-sources*"/>
|
|
|
|
</fileset>
|
|
|
|
</resources>
|
|
|
|
</sort>
|
2015-06-16 01:42:36 -04:00
|
|
|
</pathconvert>
|
|
|
|
|
2016-05-24 09:39:46 -04:00
|
|
|
<echo message="Compiling all examples with the additional scratchpad.jar"/>
|
2021-04-10 07:44:30 -04:00
|
|
|
<javac srcdir="../poi-examples/src/main/java" destdir="${build}"
|
2017-09-15 14:39:18 -04:00
|
|
|
target="1.8" source="1.8" debug="true"
|
2020-05-07 06:27:52 -04:00
|
|
|
encoding="ASCII" fork="yes" includeantruntime="false"
|
2016-05-24 09:39:46 -04:00
|
|
|
classpath="${jarpackagescratchpad}" classpathref="libs">
|
2015-06-16 01:42:36 -04:00
|
|
|
</javac>
|
|
|
|
</target>
|
2015-05-31 16:11:28 -04:00
|
|
|
</project>
|