Update build.xml based on the one from commons-lang: add additional test-jar target

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1495867 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2013-06-23 18:27:46 +00:00
parent f36d6870f2
commit 6b41e50c2d
7 changed files with 371 additions and 637 deletions

View File

@ -51,9 +51,6 @@ The major targets are:
ant compile - compile the code ant compile - compile the code
ant test - test using junit ant test - test using junit
ant jar - create a jar file ant jar - create a jar file
ant test-jar - create the testframework jar file
ant javadoc - build the javadoc ant javadoc - build the javadoc
ant dist - create folders as per a distribution ant dist - create folders as per a distribution
ant tf.jar - create the testframework jar file
ant tf.javadoc - build the testframework javadoc

View File

@ -1,70 +0,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 name="Collections Test Framework jar" default="jar" basedir=".">
<!--
$Id$
-->
<!-- ========== Component Declarations ==================================== -->
<!-- The current version number of this component -->
<property name="component.version" value=""/>
<!-- The base directory for compiled test classes -->
<property name="test.classes" value="target/test-classes"/>
<!-- The base directory for distribution targets -->
<property name="dist.home" value="target"/>
<!-- JDK versions -->
<property name="maven.compile.source" value=""/>
<property name="maven.compile.target" value=""/>
<!-- ========== Executable Targets ======================================== -->
<target name="jar" description="Create Collections Test Framework jar">
<mkdir dir="${dist.home}"/>
<mkdir dir="${test.classes}/META-INF"/>
<copy file="LICENSE.txt" tofile="${test.classes}/META-INF/LICENSE.txt"/>
<copy file="NOTICE.txt" tofile="${test.classes}/META-INF/NOTICE.txt"/>
<jar jarfile="${dist.home}/commons-collections-testframework-${component.version}.jar">
<manifest>
<attribute name="Specification-Title" value="Commons Collections Test Framework"/>
<attribute name="Specification-Version" value="${component.version}"/>
<attribute name="Specification-Vendor" value="The Apache Software Foundation"/>
<attribute name="Implementation-Title" value="Commons Collections Test Framework"/>
<attribute name="Implementation-Version" value="${component.version}"/>
<attribute name="Implementation-Vendor" value="The Apache Software Foundation"/>
<attribute name="Implementation-Vendor-Id" value="org.apache"/>
<attribute name="X-Compile-Source-JDK" value="${maven.compile.source}"/>
<attribute name="X-Compile-Target-JDK" value="${maven.compile.target}"/>
</manifest>
<fileset dir="${test.classes}">
<include name="**/LICENSE.txt"/>
<include name="**/NOTICE.txt"/>
<include name="**/AbstractTest*.class"/>
<include name="**/BulkTest*.class"/>
</fileset>
</jar>
</target>
</project>

27
build.properties.sample Normal file
View File

@ -0,0 +1,27 @@
# 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.
##########################################################################
# Sample Ant build.properties file
#
# This setup assumes dependent jars are in a local maven 2 repository.
# However the jars are located, the properties ending in ".jar" need
# expand to full paths to the jars.
##########################################################################
# Repository base path - unnecessary if full jar paths are provided below
repository=${user.home}/.m2/repository
junit.home=${repository}/junit/junit/4.11/
hamcrest.home=${repository}/org/hamcrest/hamcrest-core/1.3/
easymock.home=${repository}/org/easymock/easymock/3.1/

692
build.xml
View File

@ -1,553 +1,257 @@
<?xml version="1.0"?>
<!-- <!--
Licensed to the Apache Software Foundation (ASF) under one or more /*
contributor license agreements. See the NOTICE file distributed with * Licensed to the Apache Software Foundation (ASF) under one
this work for additional information regarding copyright ownership. * or more contributor license agreements. See the NOTICE file
The ASF licenses this file to You under the Apache License, Version 2.0 * distributed with this work for additional information
(the "License"); you may not use this file except in compliance with * regarding copyright ownership. The ASF licenses this file
the License. You may obtain a copy of the License at * to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
http://www.apache.org/licenses/LICENSE-2.0 * with the License. You may obtain a copy of the License at
*
Unless required by applicable law or agreed to in writing, software * http://www.apache.org/licenses/LICENSE-2.0
distributed under the License is distributed on an "AS IS" BASIS, *
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * Unless required by applicable law or agreed to in writing,
See the License for the specific language governing permissions and * software distributed under the License is distributed on an
limitations under the License. * "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.
*/
-->
<!--
"Collections" component of the Apache Commons Subproject
$Id$
--> -->
<project name="commons-collections" default="compile" basedir="."> <project name="Collections" default="compile" basedir=".">
<!-- ========== Properties ================================================ --> <!-- ========== Initialize Properties ===================================== -->
<property file="${user.home}/${component.name}.build.properties"/>
<property file="${user.home}/build.properties"/>
<property file="${basedir}/build.properties"/>
<property file="${basedir}/default.properties"/>
<property name="jdk.javadoc" value="http://download.oracle.com/javase/1.5.0/docs/api/"/>
<!-- This can be used to define 'junit.jar' properties if necessary --> <!-- ========== Construct compile classpath =============================== -->
<property file="build.properties"/> <path id="compile.classpath">
<pathelement location="${build.home}/classes"/>
<!-- ========== Component Declarations ==================================== -->
<!-- The name of this component -->
<property name="component.name" value="commons-collections4"/>
<!-- The primary package name of this component -->
<property name="component.package" value="org.apache.commons.collections4"/>
<!-- The short title of this component -->
<property name="component.title" value="Commons Collections"/>
<!-- The full title of this component -->
<property name="component.title.full" value="Apache Commons Collections"/>
<!-- The current version number of this component -->
<property name="component.version" value="4.0-SNAPSHOT"/>
<!-- The base directory for component configuration files -->
<property name="source.conf" value="src/conf"/>
<!-- The base directory for component sources -->
<property name="source.java" value="src/main/java"/>
<!-- The base directory for unit test sources -->
<property name="source.test" value="src/test/java"/>
<!-- The directories for compilation targets -->
<property name="build.home" value="build"/>
<property name="build.conf" value="${build.home}/conf"/>
<property name="build.classes" value="${build.home}/classes"/>
<property name="build.tests" value="${build.home}/tests"/>
<property name="build.test.reports" value="${build.home}/test-reports"/>
<property name="build.docs" value="${build.home}/docs/apidocs"/>
<property name="build.src" value="${build.home}/src-ide" />
<!-- The directories for tests -->
<property name="build.reports" value="${build.home}/reports" />
<!-- The name/location of the jar file to build -->
<property name="final.name" value="${component.name}-${component.version}"/>
<property name="jar.name" value="${final.name}.jar"/>
<property name="build.jar.name" value="${build.home}/${jar.name}"/>
<!-- The name/location of the zip files to build -->
<property name="build.dist.bin" value="${build.home}/bin"/>
<property name="build.dist.bin.work" value="${build.dist.bin}/${component.name}-${component.version}"/>
<property name="build.dist.src" value="${build.home}/src"/>
<property name="build.dist.src.work" value="${build.dist.src}/${component.name}-${component.version}-src"/>
<property name="build.dist" value="${build.home}/dist"/>
<property name="build.bin.tar.name" value="${build.dist}/${component.name}-${component.version}.tar"/>
<property name="build.bin.gz.name" value="${build.dist}/${component.name}-${component.version}.tar.gz"/>
<property name="build.bin.zip.name" value="${build.dist}/${component.name}-${component.version}.zip"/>
<property name="build.src.tar.name" value="${build.dist}/${component.name}-${component.version}-src.tar"/>
<property name="build.src.gz.name" value="${build.dist}/${component.name}-${component.version}-src.tar.gz"/>
<property name="build.src.zip.name" value="${build.dist}/${component.name}-${component.version}-src.zip"/>
<property name="dist.home" value="dist"/>
<!-- for nightly builds -->
<!-- Path variables -->
<path id="test.support.path">
<!--Combines all jar references needed for running and compiling tests-->
<pathelement location="${junit.jar}" />
<pathelement location="${hamcrest.jar}" />
<pathelement location="${easymock.jar}" />
</path> </path>
<!-- ========== Settings ================================================== --> <!-- ========== Construct unit test classpath ============================= -->
<path id="test.classpath">
<pathelement location="${build.home}/classes"/>
<pathelement location="${build.home}/tests"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${hamcrest.jar}"/>
<pathelement location="${easymock.jar}"/>
</path>
<!-- Javac -->
<property name="compile.debug" value="true"/>
<property name="compile.deprecation" value="true"/>
<property name="compile.optimize" value="false"/>
<!-- Javadoc -->
<property name="javadoc.access" value="protected"/>
<property name="javadoc.links" value="http://download.oracle.com/javase/1.5.0/docs/api/"/>
<!-- JUnit -->
<property name="test.failonerror" value="true"/>
<property name="test.fork" value="true"/>
<property name="test.haltonfailure" value="true"/>
<!-- Maven -->
<property name="maven.repo" value="${user.home}/.maven/repository" />
<!-- ====================================================================== -->
<!-- ========== Executable Targets ======================================== --> <!-- ========== Executable Targets ======================================== -->
<!-- ====================================================================== --> <target name="init" description="Initialize and evaluate conditionals">
<target name="clean"
description="Clean build and distribution directories">
<delete dir="${build.home}"/>
</target>
<!-- ====================================================================== -->
<target name="init"
description="Initialize and evaluate conditionals">
<echo message="-------- ${component.name} ${component.version} --------"/> <echo message="-------- ${component.name} ${component.version} --------"/>
</target> <filter token="name" value="${component.name}"/>
<filter token="package" value="${component.package}"/>
<!-- ====================================================================== --> <filter token="version" value="${component.version}"/>
<filter token="compile.source" value="${compile.source}"/>
<target name="prepare" depends="init" <filter token="compile.target" value="${compile.target}"/>
description="Prepare build directory">
<mkdir dir="${build.home}"/> <mkdir dir="${build.home}"/>
</target> </target>
<!-- ====================================================================== --> <!-- ========== Compile Targets ========================================= -->
<target name="compile" depends="init" description="Compile shareable components">
<target name="compile" depends="prepare" <mkdir dir="${build.home}/classes"/>
description="Compile main code"> <javac srcdir="${source.home}" destdir="${build.home}/classes" debug="${compile.debug}" deprecation="${compile.deprecation}" target="${compile.target}" source="${compile.source}" excludes="${compile.excludes}" optimize="${compile.optimize}" includeantruntime="false" encoding="${compile.encoding}">
<mkdir dir="${build.classes}"/> <classpath refid="compile.classpath"/>
<javac srcdir="${source.java}"
destdir="${build.classes}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}"
includeantruntime="false">
</javac> </javac>
</target> <copy todir="${build.home}/classes" filtering="on">
<fileset dir="${source.home}" excludes="**/*.java,**/*.html"/>
<!-- ====================================================================== -->
<target name="jar" depends="compile"
description="Create jar">
<mkdir dir="${build.classes}/META-INF"/>
<copy file="LICENSE.txt"
tofile="${build.classes}/META-INF/LICENSE.txt"/>
<copy file="NOTICE.txt"
tofile="${build.classes}/META-INF/NOTICE.txt"/>
<tstamp/>
<mkdir dir="${build.conf}"/>
<copy todir="${build.conf}" filtering="on">
<filterset>
<filter token="name" value="${component.name}"/>
<filter token="title" value="${component.title}"/>
<filter token="package" value="${component.package}"/>
<filter token="version" value="${component.version}"/>
</filterset>
<fileset dir="${source.conf}" includes="*.MF"/>
</copy> </copy>
<!-- NOTE: A jar built using JDK1.4 is incompatible with JDK1.2 -->
<jar jarfile="${build.jar.name}"
basedir="${build.classes}"
manifest="${build.conf}/MANIFEST.MF"/>
</target> </target>
<!-- ====================================================================== --> <target name="compile.tests" depends="compile" description="Compile unit test cases">
<mkdir dir="${build.home}/tests"/>
<target name="compile.tests" depends="compile" <javac srcdir="${test.home}" destdir="${build.home}/tests" debug="${compile.debug}" deprecation="off" target="${compile.target}" source="${compile.source}" optimize="${compile.optimize}" includeantruntime="false" encoding="${compile.encoding}">
description="Compile unit test cases"> <classpath refid="test.classpath"/>
<mkdir dir="${build.tests}"/>
<javac srcdir="${source.test}"
destdir="${build.tests}"
debug="true"
deprecation="false"
optimize="false"
includeantruntime="false">
<classpath>
<pathelement location="${build.classes}"/>
<path refid="test.support.path"/>
</classpath>
</javac> </javac>
<copy todir="${build.home}/tests" filtering="on">
<fileset dir="${test.home}" excludes="**/*.java"/>
</copy>
</target> </target>
<!-- ====================================================================== --> <!-- ========== Unit Tests ========================================= -->
<target name="test" depends="compile.tests" description="Run all unit test cases">
<!-- Tests collections, either running all or one test --> <echo message="Running unit tests ..."/>
<target name="test" depends="-test-all,-test-single" <mkdir dir="${build.home}/test-reports"/>
description="Run unit tests" /> <junit printsummary="true" showoutput="true" fork="yes" haltonfailure="${test.failonerror}">
<classpath refid="test.classpath"/>
<path id="build.path"> <formatter type="plain" usefile="true" />
<pathelement location="${build.classes}" /> <!-- If test.entry is defined, run a single test, otherwise run all valid tests -->
</path> <test name="${test.entry}" todir="${build.home}/test-reports" if="test.entry"/>
<batchtest fork="yes" todir="${build.home}/test-reports" unless="test.entry">
<!-- Runs all tests --> <fileset dir="${test.home}">
<target name="-test-all" depends="compile.tests" unless="testcase">
<mkdir dir="${build.test.reports}" />
<junit printsummary="yes" haltonfailure="${test.haltonfailure}" showoutput="yes">
<classpath>
<pathelement location="${build.classes}"/>
<pathelement location="${build.tests}"/>
<path refid="test.support.path"/>
</classpath>
<formatter type="xml" />
<formatter type="plain" />
<batchtest fork="${test.fork}" todir="${build.test.reports}">
<fileset dir="${source.test}">
<include name="**/*Test.java"/> <include name="**/*Test.java"/>
<exclude name="**/TestUtils.java"/>
<exclude name="**/*$*"/> <exclude name="**/*$*"/>
<exclude name="**/TestUtils.java"/>
<exclude name="**/Abstract*.java"/> <exclude name="**/Abstract*.java"/>
<exclude name="**/BulkTest.java"/> <exclude name="**/BulkTest.java"/>
</fileset> </fileset>
</batchtest> </batchtest>
</junit> </junit>
<junitreport todir="${build.test.reports}">
<fileset dir="${build.test.reports}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${build.test.reports}/html" />
</junitreport>
</target> </target>
<!-- Runs a single test --> <target name="clean" description="Clean build and distribution directories">
<target name="-test-single" depends="compile.tests" if="testcase"> <delete dir="${build.home}"/>
<junit printsummary="yes" haltonfailure="${test.haltonfailure}" showoutput="yes">
<formatter type="brief" />
<classpath>
<pathelement location="${build.classes}"/>
<pathelement location="${build.tests}"/>
<path refid="test.support.path"/>
</classpath>
<test name="${testcase}" fork="${test.fork}" todir="${build.test.reports}">
<formatter type="brief" usefile="false" />
</test>
</junit>
</target> </target>
<!-- ====================================================================== --> <target name="all" depends="clean,test,compile" description="Clean and compile all components"/>
<target name="testjar" depends="compile.tests,jar" <!-- ========== JavaDocs ========================================= -->
description="Run all unit test cases"> <target name="javadoc" depends="compile" description="Create component Javadoc documentation">
<echo message="Running collections tests against built jar ..."/> <mkdir dir="${build.home}"/>
<junit printsummary="yes" haltonfailure="${test.haltonfailure}" dir="${basedir}"> <mkdir dir="${build.home}/apidocs"/>
<classpath>
<pathelement location="${build.jar.name}"/>
<pathelement location="${build.tests}"/>
<path refid="test.support.path"/>
</classpath>
<batchtest fork="${test.fork}">
<fileset dir="${source.test}">
<include name="**/TestAllPackages.java"/>
</fileset>
<formatter type="brief" usefile="false" />
</batchtest>
</junit>
</target>
<!-- ====================================================================== -->
<target name="javadoc" depends="prepare"
description="Create component Javadoc documentation">
<tstamp> <tstamp>
<format property="year" pattern="yyyy"/> <format property="current.year" pattern="yyyy"/>
</tstamp> </tstamp>
<delete dir="${build.docs}"/> <javadoc sourcepath="${source.home}"
<mkdir dir="${build.docs}"/> destdir="${build.home}/apidocs"
<javadoc sourcepath="${source.java}" overview="${source.home}/org/apache/commons/collections4/overview.html"
destdir="${build.docs}" packagenames="org.apache.commons.*"
packagenames="${component.package}.*" excludepackagenames="${javadoc.excludepackagenames}"
access="${javadoc.access}"
author="true"
version="true"
use="true"
link="${javadoc.links}"
overview="${source.java}/org/apache/commons/collections/overview.html"
doctitle="${component.title} ${component.version} API;"
windowtitle="${component.title} ${component.version} API"
bottom="Copyright &amp;copy; 2001-${year} Apache Software Foundation. All Rights Reserved.">
</javadoc>
</target>
<!-- ====================================================================== -->
<!-- ========== Test framework ============================================ -->
<!-- ====================================================================== -->
<property name="tf.name" value="commons-collections-testframework"/>
<property name="tf.package" value="org.apache.commons.collections"/>
<property name="tf.title" value="Commons Collections Test Framework"/>
<property name="tf.title.full" value="Apache Commons Collections Test Framework"/>
<property name="tf.version" value="${component.version}"/>
<property name="tf.build.conf" value="${build.home}/tfconf"/>
<property name="tf.build.tf" value="${build.home}/testframework"/>
<property name="tf.build.docs" value="${build.home}/docs/testframework"/>
<property name="tf.jar.name" value="${tf.name}-${tf.version}.jar"/>
<property name="tf.build.jar.name" value="${build.home}/${tf.jar.name}"/>
<!-- ====================================================================== -->
<!-- patternset describing test framework source not dependent on collections jar -->
<patternset id="tf.patternset.validate">
<include name="**/AbstractTestObject.java"/>
<include name="**/AbstractTestCollection.java"/>
<include name="**/AbstractTestSet.java"/>
<include name="**/AbstractTestSortedSet.java"/>
<include name="**/AbstractTestList.java"/>
<include name="**/AbstractTestMap.java"/>
<include name="**/AbstractTestSortedMap.java"/>
<include name="**/AbstractTestComparator.java"/>
<include name="**/AbstractTestIterator.java"/>
<include name="**/AbstractTestListIterator.java"/>
<include name="**/AbstractTestMapEntry.java"/>
<include name="**/BulkTest.java"/>
</patternset>
<target name="tf.validate" depends="prepare"
description="Testframework - Validate testframework independence">
<delete dir="${tf.build.tf}"/>
<mkdir dir="${tf.build.tf}"/>
<javac srcdir="${source.test}"
destdir="${tf.build.tf}"
debug="true"
deprecation="false"
optimize="false"
includeantruntime="false">
<patternset refid="tf.patternset.validate" />
<classpath>
<path refid="test.support.path"/>
</classpath>
</javac>
<delete dir="${tf.build.tf}"/>
</target>
<!-- ====================================================================== -->
<target name="tf.jar" depends="compile.tests"
description="Testframework - Create jar">
<mkdir dir="${tf.build.tf}"/>
<copy todir="${tf.build.tf}">
<fileset dir="${build.tests}">
<include name="**/AbstractTest*.class"/>
<include name="**/BulkTest*.class"/>
</fileset>
</copy>
<!-- NOTE: A jar built using JDK1.4 is incompatible with JDK1.2 -->
<ant antfile="build-testframework.xml" target="jar">
<property name="test.classes" value="${tf.build.tf}"/>
<property name="dist.home" value="${build.home}"/>
<property name="component.version" value="${tf.version}"/>
<property name="maven.compile.source" value="1.5"/>
<property name="maven.compile.target" value="1.5"/>
</ant>
</target>
<!-- ====================================================================== -->
<target name="tf.javadoc" depends="prepare"
description="Testframework - Create Javadoc documentation">
<tstamp>
<format property="year" pattern="yyyy"/>
</tstamp>
<delete dir="${tf.build.docs}"/>
<mkdir dir="${tf.build.docs}"/>
<javadoc destdir="${tf.build.docs}"
access="protected"
author="false" author="false"
version="false" version="true"
link="${javadoc.links}" doctitle="&lt;h1&gt;Commons Lang ${component.version}&lt;/h1&gt;"
overview="${source.test}/org/apache/commons/collections/overview.html" windowtitle="Lang ${component.version}"
doctitle="${tf.title} ${tf.version} API;" bottom="Copyright &amp;copy; 2001-${current.year} - Apache Software Foundation"
windowtitle="${tf.title} ${tf.version} API" use="true"
bottom="Copyright &amp;copy; 2001-${year} Apache Software Foundation. All Rights Reserved."> encoding="${compile.encoding}"
<fileset dir="${source.test}"> source="${compile.source}">
<include name="**/AbstractTest*.java"/> <classpath refid="compile.classpath"/>
<include name="**/BulkTest*.java"/> <link href="${jdk.javadoc}"/>
</fileset> <link href="${collections.javadoc}"/>
</javadoc> </javadoc>
</target> </target>
<!-- ========== Jar Targets ========================================= -->
<!-- ====================================================================== --> <target name="jar" depends="compile" description="Create jar">
<!-- ========== Distributions ============================================= --> <mkdir dir="${build.home}/classes/META-INF"/>
<!-- ====================================================================== --> <copy file="LICENSE.txt" tofile="${build.home}/classes/META-INF/LICENSE.txt"/>
<copy file="NOTICE.txt" tofile="${build.home}/classes/META-INF/NOTICE.txt"/>
<!-- ====================================================================== --> <jar jarfile="${build.home}/${final.name}.jar">
<manifest>
<!-- Target needed for nightly builds --> <attribute name="Specification-Title" value="Commons Collections"/>
<target name="dist" depends="javadoc,dist.create" <attribute name="Specification-Version" value="${component.version}"/>
description="Create distribution folders"> <attribute name="Specification-Vendor" value="The Apache Software Foundation"/>
<delete dir="${dist.home}"/> <attribute name="Implementation-Title" value="Commons Collections"/>
<mkdir dir="${dist.home}" /> <attribute name="Implementation-Version" value="${component.version}"/>
<copy todir="${dist.home}"> <attribute name="Implementation-Vendor" value="The Apache Software Foundation"/>
<fileset dir="${build.dist.bin}" /> <attribute name="Implementation-Vendor-Id" value="org.apache"/>
</copy> <attribute name="X-Compile-Source-JDK" value="${compile.source}"/>
<attribute name="X-Compile-Target-JDK" value="${compile.target}"/>
</manifest>
<fileset dir="${build.home}/classes">
<include name="**/*.class"/>
<include name="**/LICENSE.txt"/>
<include name="**/NOTICE.txt"/>
</fileset>
</jar>
</target> </target>
<target name="dist.create" depends="jar,testjar,tf.validate,tf.jar,dist.bin,dist.src" /> <target name="javadoc-jar" depends="javadoc" description="Create JavaDoc jar">
<jar jarfile="${build.home}/${final.name}-javadoc.jar">
<target name="dist.bin"> <manifest>
<copy todir="${build.src}"> <attribute name="Specification-Title" value="Commons Collections API"/>
<fileset dir="${basedir}/src/java" includes="**/*.java" /> <attribute name="Specification-Version" value="${component.version}"/>
</copy> <attribute name="Specification-Vendor" value="The Apache Software Foundation"/>
<copy todir="${build.src}/META-INF"> <attribute name="Implementation-Title" value="Commons Collections API"/>
<fileset dir="${basedir}" includes="LICENSE*, NOTICE*" /> <attribute name="Implementation-Version" value="${component.version}"/>
</copy> <attribute name="Implementation-Vendor" value="The Apache Software Foundation"/>
<jar jarfile="${build.home}/${final.name}-src-ide.zip" basedir="${build.src}" /> <attribute name="Implementation-Vendor-Id" value="org.apache"/>
<antcall target="internal-md5"> </manifest>
<param name="path" value="${build.home}/${final.name}.jar"/> <fileset dir="${build.home}/apidocs"/>
</antcall> <fileset dir="${basedir}">
<mkdir dir="${build.dist.bin.work}"/>
<copy todir="${build.dist.bin.work}">
<fileset dir=".">
<include name="LICENSE.txt"/> <include name="LICENSE.txt"/>
<include name="NOTICE.txt"/> <include name="NOTICE.txt"/>
<include name="README.txt"/>
<include name="RELEASE-NOTES.html"/>
</fileset> </fileset>
</copy> </jar>
<copy todir="${build.dist.bin.work}">
<fileset dir="${build.home}">
<include name="*.jar"/>
<include name="docs/**"/>
</fileset>
</copy>
</target> </target>
<target name="dist.src"> <target name="source-jar" depends="init" description="Create Source jar">
<mkdir dir="${build.dist.src.work}"/> <jar jarfile="${build.home}/${final.name}-sources.jar">
<copy todir="${build.dist.src.work}"> <manifest>
<fileset dir="."> <attribute name="Specification-Title" value="Commons Collections Source"/>
<attribute name="Specification-Version" value="${component.version}"/>
<attribute name="Specification-Vendor" value="The Apache Software Foundation"/>
<attribute name="Implementation-Title" value="Commons Collections Source"/>
<attribute name="Implementation-Version" value="${component.version}"/>
<attribute name="Implementation-Vendor" value="The Apache Software Foundation"/>
<attribute name="Implementation-Vendor-Id" value="org.apache"/>
</manifest>
<fileset dir="${source.home}">
<include name="**/*.java"/>
</fileset>
<fileset dir="${basedir}">
<include name="LICENSE.txt"/> <include name="LICENSE.txt"/>
<include name="NOTICE.txt"/> <include name="NOTICE.txt"/>
<include name="README.txt"/>
<include name="RELEASE-NOTES.html"/>
<include name="DEVELOPERS-GUIDE.html"/>
<include name="PROPOSAL.html"/>
<include name="STATUS.html"/>
<include name="build.xml"/>
<include name="build-testframework.xml"/>
<include name="maven.xml"/>
<include name="project.xml"/>
<include name="project.properties"/>
<include name="pom.xml"/>
</fileset> </fileset>
</copy> </jar>
<copy todir="${build.dist.src.work}">
<fileset dir="${build.home}">
<include name="${final.name}.jar"/>
</fileset>
</copy>
<copy todir="${build.dist.src.work}">
<fileset dir=".">
<include name="data/**"/>
<include name="src/**"/>
<include name="xdocs/**"/>
</fileset>
</copy>
</target> </target>
<!-- ====================================================================== --> <target name="test-jar" depends="init" description="Create Testframework jar">
<jar jarfile="${build.home}/${final.name}-tests.jar">
<target name="release" depends="dist.create,zip" <manifest>
description="Create release"> <attribute name="Specification-Title" value="Commons Collections Testframework"/>
<!-- POM --> <attribute name="Specification-Version" value="${component.version}"/>
<copy file="project.xml" tofile="${build.home}/${final.name}.pom" /> <attribute name="Specification-Vendor" value="The Apache Software Foundation"/>
<antcall target="internal-md5"> <attribute name="Implementation-Title" value="Commons Collections Testframework"/>
<param name="path" value="${build.home}/${final.name}.pom"/> <attribute name="Implementation-Version" value="${component.version}"/>
</antcall> <attribute name="Implementation-Vendor" value="The Apache Software Foundation"/>
<attribute name="Implementation-Vendor-Id" value="org.apache"/>
</manifest>
<fileset dir="${test.home}">
<include name="**/*.java"/>
</fileset>
<fileset dir="${basedir}">
<include name="LICENSE.txt"/>
<include name="NOTICE.txt"/>
</fileset>
</jar>
</target> </target>
<target name="zip" depends="zip.bin,zip.src"> <!-- ========== Distribution ========================================= -->
</target> <target name="dist" depends="clean,jar,source-jar,javadoc-jar,test-jar" description="Create binary distribution">
<target name="zip.bin"> <!-- binary distro -->
<mkdir dir="${build.dist}"/> <zip destfile="${build.home}/${final.name}.zip">
<fixcrlf srcdir="${build.dist.bin.work}" eol="lf" includes="*.txt" /> <zipfileset dir="${basedir}" prefix="${final.name}"
<tar longfile="gnu" tarfile="${build.bin.tar.name}"> includes="LICENSE.txt,
<tarfileset dir="${build.dist.bin}"/> NOTICE.txt,
</tar> RELEASE-NOTES.txt"
<gzip zipfile="${build.bin.gz.name}" src="${build.bin.tar.name}"/> />
<delete file="${build.bin.tar.name}" /> <zipfileset dir="${build.home}" includes="*.jar," prefix="${final.name}"/>
<antcall target="internal-md5"> <zipfileset dir="${build.home}/apidocs" prefix="${final.name}/apidocs"/>
<param name="path" value="${build.bin.gz.name}"/>
</antcall>
<fixcrlf srcdir="${build.dist.bin.work}" eol="crlf" includes="*.txt" />
<zip zipfile="${build.bin.zip.name}" >
<zipfileset dir="${build.dist.bin}"/>
</zip> </zip>
<antcall target="internal-md5"> <tar destfile="${build.home}/${final.name}.tar.gz" compression="gzip">
<param name="path" value="${build.bin.zip.name}"/> <zipfileset src="${build.home}/${final.name}.zip"/>
</antcall>
</target>
<target name="zip.src">
<mkdir dir="${build.dist}"/>
<fixcrlf srcdir="${build.dist.src.work}" eol="lf" includes="*.txt,*.properties" />
<tar longfile="gnu" tarfile="${build.src.tar.name}">
<tarfileset dir="${build.dist.src}"/>
</tar> </tar>
<gzip zipfile="${build.src.gz.name}" src="${build.src.tar.name}"/>
<delete file="${build.src.tar.name}" />
<antcall target="internal-md5">
<param name="path" value="${build.src.gz.name}"/>
</antcall>
<fixcrlf srcdir="${build.dist.src.work}" eol="crlf" includes="*.txt,*.properties" /> <!-- source distro -->
<zip zipfile="${build.src.zip.name}" > <zip destfile="${build.home}/${final.name}-src.zip">
<zipfileset dir="${build.dist.src}"/> <zipfileset dir="${basedir}" prefix="${final.name}-src"
includes="build.xml,
default.properties,
build.properties.sample,
DEVELOPERS-GUIDE.html,
PROPOSAL.html,
LICENSE.txt,
NOTICE.txt,
README.txt,
pom.xml,
RELEASE-NOTES.txt"
/>
<zipfileset dir="${basedir}/src" prefix="${final.name}-src/src"/>
</zip> </zip>
<antcall target="internal-md5"> <tar destfile="${build.home}/${final.name}-src.tar.gz" compression="gzip">
<param name="path" value="${build.src.zip.name}"/> <zipfileset src="${build.home}/${final.name}-src.zip"/>
</antcall> </tar>
</target>
<target name="internal-md5">
<basename property="_base" file="${path}"/>
<checksum file="${path}" property="md5"/>
<echo message="${md5} *${_base}" file="${path}.md5"/>
</target> </target>
<!-- ====================================================================== -->
<target name="clirr">
<taskdef resource="clirrtask.properties">
<classpath path="${maven.repo}/clirr/jars/clirr-core-0.6-uber.jar;" />
</taskdef>
<clirr>
<origfiles dir="${maven.repo}/commons-collections/jars" includes="commons-collections-3.2.1.jar"/>
<newfiles dir="${build.home}" includes="${final.name}.jar" />
<formatter type="plain" outfile="${build.home}/clirr.txt" />
</clirr>
</target>
</project> </project>

87
default.properties Normal file
View File

@ -0,0 +1,87 @@
#
# 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.
#
# $Id$
# The location of the "junit.jar" JAR file
junit.jar = ${junit.home}/junit-4.11.jar
# The location of the "junit.jar" JAR file
hamcrest.jar = ${hamcrest.home}/hamcrest-core-1.3.jar
# The location of the Easymock jar
easymock.jar = ${easymock.home}/easymock-3.1.jar
# Whether or not to fork tests
junit.fork = true
# The name of this component
component.name = commons-collections4
# The primary package name of this component
component.package = org.apache.commons.collections4
# The title of this component
component.title = Commons Collections
# The current version number of this component
component.version = 4.0-SNAPSHOT
# The name that is used to create the jar file
final.name = ${component.name}-${component.version}
# The base directory for compilation targets
build.home = target
# The base directory for component configuration files
conf.home = src/conf
# The base directory for component sources
source.home = src/main/java
# The base directory for unit test sources
test.home = src/test/java
# Should Java compilations set the 'debug' compiler option?
compile.debug = true
# Should Java compilations set the 'deprecation' compiler option?
compile.deprecation = true
# Should Java compilations set the 'optimize' compiler option?
compile.optimize = true
# Generate class files for specific VM version (e.g., 1.1 or 1.2).
# Note that the default value depends on the JVM that is running Ant.
# In particular, if you use JDK 1.4+ the generated classes will not be usable
# for a 1.1 Java VM unless you explicitly set this attribute to the value 1.1
# (which is the default value for JDK 1.1 to 1.3).
compile.target = 1.5
# Specifies the source version for the Java compiler.
# Corresponds to the source attribute for the ant javac task.
# Valid values are 1.3, 1.4, 1.5.
compile.source = 1.5
# Specifies the source encoding.
compile.encoding = ISO-8859-1
# Should all tests fail if one does?
test.failonerror = true
# The test runner to execute
test.runner = junit.textui.TestRunner

View File

@ -1,12 +0,0 @@
Manifest-Version: 1.0
Package: org.apache.commons.collections
Extension-Name: commons-collections
Specification-Version: @version@
Specification-Vendor: Apache Software Foundation
Specification-Title: Commons Collections
Implementation-Version: @version@
Implementation-Vendor: Apache Software Foundation
Implementation-Title: Commons Collections
Implementation-Vendor-Id: org.apache
X-Compile-Source-JDK: 1.3
X-Compile-Target-JDK: 1.3

View File

@ -25,7 +25,8 @@
<fileSet> <fileSet>
<includes> <includes>
<include>build.xml</include> <include>build.xml</include>
<include>build-testframework.xml</include> <include>default.properties</include>
<include>build.properties.sample</include>
<include>DEVELOPERS-GUIDE.html</include> <include>DEVELOPERS-GUIDE.html</include>
<include>LICENSE.txt</include> <include>LICENSE.txt</include>
<include>NOTICE.txt</include> <include>NOTICE.txt</include>