Skip to content

Commit

Permalink
initial import of ExcelAnt tasks, see Bugzilla 50610
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/excelant@1072119 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Yegor Kozlov committed Feb 18, 2011
1 parent 36cdd9d commit 712b746
Show file tree
Hide file tree
Showing 33 changed files with 3,441 additions and 7 deletions.
133 changes: 126 additions & 7 deletions build.xml
Expand Up @@ -109,6 +109,15 @@ under the License.
<property name="ooxml.testokfile" location="build/ooxml-testokfile.txt"/>
<property name="ooxml.lite.output.dir" location="build/ooxml-lite-classes"/>

<!-- Excelant: -->
<property name="excelant.resource.dir" value="src/excelant/resources"/>
<property name="excelant.src" location="src/excelant/java"/>
<property name="excelant.src.test" location="src/excelant/testcases"/>
<property name="excelant.reports.test" location="build/excelant-test-results"/>
<property name="excelant.output.dir" location="build/excelant-classes"/>
<property name="excelant.output.test.dir" location="build/excelant-test-classes"/>
<property name="excelant.testokfile" location="build/excelant-testokfile.txt"/>

<!-- jars in the /lib directory, see the fetch-jars target-->
<property name="main.commons-logging.jar" location="${main.lib}/commons-logging-1.1.jar"/>
<property name="main.commons-logging.url"
Expand All @@ -117,6 +126,8 @@ under the License.
<property name="main.log4j.url" value="${repository.m2}/maven2/log4j/log4j/1.2.13/log4j-1.2.13.jar"/>
<property name="main.junit.jar" location="${main.lib}/junit-3.8.1.jar"/>
<property name="main.junit.url" value="${repository.m2}/maven2/junit/junit/3.8.1/junit-3.8.1.jar"/>
<property name="main.ant.jar" location="${main.lib}/ant-1.8.2.jar"/>
<property name="main.ant.url" value="${repository.m2}/maven2/org/apache/ant/ant/1.8.2/ant-1.8.2.jar"/>

<!-- jars in the lib-ooxml directory, see the fetch-ooxml-jars target-->
<property name="ooxml.dom4j.jar" location="${ooxml.lib}/dom4j-1.6.1.jar"/>
Expand Down Expand Up @@ -155,9 +166,9 @@ under the License.
</propertyset>

<path id="main.classpath">
<fileset dir="${main.lib}">
<include name="*.jar"/>
</fileset>
<pathelement location="${main.commons-logging.jar}"/>
<pathelement location="${main.log4j.jar}"/>
<pathelement location="${main.junit.jar}"/>
</path>

<path id="scratchpad.classpath">
Expand Down Expand Up @@ -216,6 +227,18 @@ under the License.
<pathelement location="${scratchpad.output.dir}"/>
</path>

<path id="excelant.classpath">
<path refid="ooxml.classpath"/>
<pathelement location="${main.ant.jar}"/>
<pathelement location="${ooxml.output.dir}"/>
</path>
<path id="test.excelant.classpath">
<path refid="ooxml.classpath"/>
<pathelement location="${ooxml.output.dir}"/>
<pathelement location="${excelant.output.dir}"/>
<pathelement location="${excelant.output.test.dir}"/>
<pathelement location="${main.output.test.dir}"/>
</path>

<!-- Prints POI's Ant usage help -->
<target name="help" description="Prints Apache POI's Ant usage help">
Expand Down Expand Up @@ -248,6 +271,9 @@ under the License.
<mkdir dir="${ooxml.output.dir}"/>
<mkdir dir="${ooxml.output.test.dir}"/>
<mkdir dir="${ooxml.reports.test}"/>
<mkdir dir="${excelant.output.dir}"/>
<mkdir dir="${excelant.output.test.dir}"/>
<mkdir dir="${excelant.reports.test}"/>
<mkdir dir="${examples.output.dir}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${build.site}"/>
Expand All @@ -272,6 +298,7 @@ under the License.
<available file="${main.commons-logging.jar}"/>
<available file="${main.log4j.jar}"/>
<available file="${main.junit.jar}"/>
<available file="${main.ant.jar}"/>
</and>
<isset property="disconnected"/>
</or>
Expand All @@ -293,6 +320,10 @@ under the License.
<param name="sourcefile" value="${main.junit.url}"/>
<param name="destfile" value="${main.junit.jar}"/>
</antcall>
<antcall target="downloadfile">
<param name="sourcefile" value="${main.ant.url}"/>
<param name="destfile" value="${main.ant.jar}"/>
</antcall>
</target>

<target name="check-ooxml-jars">
Expand Down Expand Up @@ -397,7 +428,7 @@ under the License.
</target>

<target name="compile" depends="init, compile-main,
compile-scratchpad, compile-examples"
compile-scratchpad, compile-examples, compile-excelant"
description="Compiles the POI main classes, scratchpad and examples"/>

<target name="compile-all" depends="compile,compile-ooxml-lite"/>
Expand Down Expand Up @@ -509,6 +540,36 @@ under the License.
</javac>
</target>

<target name="compile-excelant" depends="compile-main,compile-ooxml">
<javac target="${jdk.version.class}"
source="${jdk.version.source}"
destdir="${excelant.output.dir}"
srcdir="${excelant.src}"
debug="${compile.debug}"
encoding="${java.source.encoding}"
fork="yes"
includeantruntime="false">
<classpath refid="excelant.classpath"/>
</javac>
<javac target="${jdk.version.class}"
source="${jdk.version.source}"
destdir="${excelant.output.test.dir}"
srcdir="${excelant.src.test}"
debug="${compile.debug}"
encoding="${java.source.encoding}"
fork="yes"
includeantruntime="false">
<classpath>
<path refid="excelant.classpath"/>
<pathelement location="${excelant.output.dir}"/>
<pathelement path="${main.output.test.dir}"/>
</classpath>
</javac>
<copy todir="${excelant.output.dir}">
<fileset dir="${excelant.resource.dir}"/>
</copy>
</target>

<target name="compile-version" depends="init"
description="Compiles the version class">
<!-- Generate the .java file -->
Expand All @@ -533,7 +594,7 @@ under the License.
<delete file="${version.java}"/>
</target>

<target name="test" depends="compile,test-main,test-scratchpad,test-ooxml"
<target name="test" depends="compile,test-main,test-scratchpad,test-ooxml,test-excelant"
description="Tests main, scratchpad and ooxml"/>
<target name="test-all" depends="test,test-ooxml-lite"/>

Expand Down Expand Up @@ -655,6 +716,37 @@ under the License.
<ooxml-test-runner classpath="ooxml-lite.classpath"/>
</target>

<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>

<target name="test-excelant" depends="compile-excelant,-test-excelant-check"
unless="excelant.test.notRequired">
<junit printsummary="yes" fork="yes" forkmode="once" haltonfailure="${halt.on.test.failure}"
failureproperty="excelant.test.failed">
<classpath refid="test.excelant.classpath"/>
<syspropertyset refid="junit.properties"/>
<jvmarg value="${poi.test.locale}"/>
<formatter type="plain"/>
<batchtest todir="${excelant.reports.test}">
<fileset dir="${excelant.src.test}">
<include name="**/Test*.java"/>
</fileset>
</batchtest>
</junit>
<delete file="${excelant.testokfile}"/>
<antcall target="-test-excelant-write-testfile"/>
</target>



<target name="-check-docs">
<uptodate property="main.docs.notRequired" targetfile="${build.site}/index.html">
<srcfiles dir="${build.site.src}"/>
Expand Down Expand Up @@ -801,6 +893,13 @@ under the License.
</replacetokens>
</filterchain>
</copy>
<copy file="maven/poi-excelant.pom" tofile="${dist.dir}/poi-excelant-${version.id}.pom">
<filterchain>
<replacetokens>
<token key="VERSION" value="${version.id}"/>
</replacetokens>
</filterchain>
</copy>
<copy file="maven/mvn-deploy.sh" todir="${dist.dir}">
<filterchain>
<replacetokens>
Expand Down Expand Up @@ -849,6 +948,11 @@ under the License.
<fileset dir="${ooxml.lite.output.dir}"/>
<metainf dir="legal/"/>
</jar>
<jar destfile="${dist.dir}/${jar.name}-excelant-${version.id}-${DSTAMP}.jar"
manifest="build/poi-manifest.mf">
<fileset dir="${excelant.output.dir}"/>
<metainf dir="legal/"/>
</jar>
</target>

<target name="jar-src" description="Sources for Maven">
Expand All @@ -872,6 +976,11 @@ under the License.
<fileset dir="${examples.src}"/>
<metainf dir="legal/"/>
</jar>
<jar destfile="${dist.dir}/${jar.name}-excelant-${version.id}-sources-${DSTAMP}.jar"
manifest="build/poi-manifest.mf">
<fileset dir="${excelant.src}"/>
<metainf dir="legal/"/>
</jar>
</target>

<target name="assemble" depends="jar,jar-src">
Expand All @@ -882,6 +991,7 @@ under the License.
<include name="${jar.name}-ooxml-${version.id}-${DSTAMP}.jar"/>
<include name="${jar.name}-examples-${version.id}-${DSTAMP}.jar"/>
<include name="${jar.name}-ooxml-schemas-${version.id}-${DSTAMP}.jar"/>
<include name="${jar.name}-excelant-${version.id}-${DSTAMP}.jar"/>
</patternset>

<!-- patterns to exclude from source assemblies -->
Expand All @@ -907,7 +1017,11 @@ under the License.

<zip destfile="${dist.dir}/${jar.name}-bin-${version.id}-${DSTAMP}.zip">
<zipfileset dir="legal/" prefix="${zipdir}"/>
<zipfileset dir="${main.lib}" prefix="${zipdir}/lib" includes="*.jar"/>
<zipfileset dir="${main.lib}" prefix="${zipdir}/lib">
<include name="commons-logging-*.jar"/>
<include name="junit-*.jar"/>
<include name="log4j-*.jar"/>
</zipfileset>
<zipfileset dir="${ooxml.lib}" prefix="${zipdir}/ooxml-lib">
<include name="dom4j-*.jar"/>
<include name="geronimo-stax-*.jar"/>
Expand All @@ -931,7 +1045,11 @@ under the License.
longfile="gnu"
compression="gzip">
<tarfileset dir="legal/" prefix="${zipdir}"/>
<tarfileset dir="${main.lib}" prefix="${zipdir}/lib" includes="*.jar"/>
<zipfileset dir="${main.lib}" prefix="${zipdir}/lib">
<include name="commons-logging-*.jar"/>
<include name="junit-*.jar"/>
<include name="log4j-*.jar"/>
</zipfileset>
<tarfileset dir="${ooxml.lib}" prefix="${zipdir}/ooxml-lib">
<include name="dom4j-*.jar"/>
<include name="geronimo-stax-*.jar"/>
Expand Down Expand Up @@ -1000,6 +1118,7 @@ under the License.
<m2-install artifactId="poi-ooxml"/>
<m2-install artifactId="poi-examples"/>
<m2-install artifactId="poi-ooxml-schemas"/>
<m2-install artifactId="poi-excelant"/>
</target>

<!-- Runs Apache Rat against the source code, to spot any files -->
Expand Down
73 changes: 73 additions & 0 deletions maven/poi-excelant.pom
@@ -0,0 +1,73 @@
<?xml version="1.0"?>
<!--
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.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.poi</groupId>
<artifactId>poi-excelant</artifactId>
<version>@VERSION@</version>
<packaging>jar</packaging>
<name>Apache POI</name>
<url>http://poi.apache.org/</url>
<description>Apache POI Excel Ant Tasks</description>

<mailingLists>
<mailingList>
<name>POI Users List</name>
<subscribe>user-subscribe@poi.apache.org</subscribe>
<unsubscribe>user-unsubscribe@poi.apache.org</unsubscribe>
<archive>http://mail-archives.apache.org/mod_mbox/poi-user/</archive>
</mailingList>
<mailingList>
<name>POI Developer List</name>
<subscribe>dev-subscribe@poi.apache.org</subscribe>
<unsubscribe>dev-unsubscribe@poi.apache.org</unsubscribe>
<archive>http://mail-archives.apache.org/mod_mbox/poi-dev/</archive>
</mailingList>
</mailingLists>

<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<organization>
<name>Apache Software Foundation</name>
<url>http://www.apache.org/</url>
</organization>

<dependencies>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>@VERSION@</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>@VERSION@</version>
</dependency>
</dependencies>
</project>
1 change: 1 addition & 0 deletions src/documentation/content/xdocs/spreadsheet/book.xml
Expand Up @@ -40,6 +40,7 @@
<menu-item label="Pictorial Docs" href="diagrams.html"/>
<menu-item label="Limitations" href="limitations.html"/>
<menu-item label="User Defined Functions" href="user-defined-functions.html"/>
<menu-item label="ExcelAnt Tests" href="excelant.html"/>
</menu>

<menu label="Contributer's Guide">
Expand Down

0 comments on commit 712b746

Please sign in to comment.