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/

804
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"/>
<!-- This can be used to define 'junit.jar' properties if necessary --> <property file="${user.home}/build.properties"/>
<property file="build.properties"/> <property file="${basedir}/build.properties"/>
<property file="${basedir}/default.properties"/>
<!-- ========== Component Declarations ==================================== --> <property name="jdk.javadoc" value="http://download.oracle.com/javase/1.5.0/docs/api/"/>
<!-- The name of this component --> <!-- ========== Construct compile classpath =============================== -->
<property name="component.name" value="commons-collections4"/> <path id="compile.classpath">
<pathelement location="${build.home}/classes"/>
<!-- The primary package name of this component --> </path>
<property name="component.package" value="org.apache.commons.collections4"/>
<!-- ========== Construct unit test classpath ============================= -->
<!-- The short title of this component --> <path id="test.classpath">
<property name="component.title" value="Commons Collections"/> <pathelement location="${build.home}/classes"/>
<pathelement location="${build.home}/tests"/>
<!-- The full title of this component --> <pathelement location="${junit.jar}"/>
<property name="component.title.full" value="Apache Commons Collections"/> <pathelement location="${hamcrest.jar}"/>
<pathelement location="${easymock.jar}"/>
<!-- The current version number of this component --> </path>
<property name="component.version" value="4.0-SNAPSHOT"/>
<!-- ========== Executable Targets ======================================== -->
<!-- The base directory for component configuration files --> <target name="init" description="Initialize and evaluate conditionals">
<property name="source.conf" value="src/conf"/> <echo message="-------- ${component.name} ${component.version} --------"/>
<filter token="name" value="${component.name}"/>
<!-- The base directory for component sources --> <filter token="package" value="${component.package}"/>
<property name="source.java" value="src/main/java"/> <filter token="version" value="${component.version}"/>
<filter token="compile.source" value="${compile.source}"/>
<!-- The base directory for unit test sources --> <filter token="compile.target" value="${compile.target}"/>
<property name="source.test" value="src/test/java"/> <mkdir dir="${build.home}"/>
</target>
<!-- The directories for compilation targets -->
<property name="build.home" value="build"/> <!-- ========== Compile Targets ========================================= -->
<property name="build.conf" value="${build.home}/conf"/> <target name="compile" depends="init" description="Compile shareable components">
<property name="build.classes" value="${build.home}/classes"/> <mkdir dir="${build.home}/classes"/>
<property name="build.tests" value="${build.home}/tests"/> <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}">
<property name="build.test.reports" value="${build.home}/test-reports"/> <classpath refid="compile.classpath"/>
<property name="build.docs" value="${build.home}/docs/apidocs"/> </javac>
<property name="build.src" value="${build.home}/src-ide" /> <copy todir="${build.home}/classes" filtering="on">
<fileset dir="${source.home}" excludes="**/*.java,**/*.html"/>
<!-- The directories for tests --> </copy>
<property name="build.reports" value="${build.home}/reports" /> </target>
<!-- The name/location of the jar file to build --> <target name="compile.tests" depends="compile" description="Compile unit test cases">
<property name="final.name" value="${component.name}-${component.version}"/> <mkdir dir="${build.home}/tests"/>
<property name="jar.name" value="${final.name}.jar"/> <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}">
<property name="build.jar.name" value="${build.home}/${jar.name}"/> <classpath refid="test.classpath"/>
</javac>
<!-- The name/location of the zip files to build --> <copy todir="${build.home}/tests" filtering="on">
<property name="build.dist.bin" value="${build.home}/bin"/> <fileset dir="${test.home}" excludes="**/*.java"/>
<property name="build.dist.bin.work" value="${build.dist.bin}/${component.name}-${component.version}"/> </copy>
<property name="build.dist.src" value="${build.home}/src"/> </target>
<property name="build.dist.src.work" value="${build.dist.src}/${component.name}-${component.version}-src"/>
<property name="build.dist" value="${build.home}/dist"/> <!-- ========== Unit Tests ========================================= -->
<property name="build.bin.tar.name" value="${build.dist}/${component.name}-${component.version}.tar"/> <target name="test" depends="compile.tests" description="Run all unit test cases">
<property name="build.bin.gz.name" value="${build.dist}/${component.name}-${component.version}.tar.gz"/> <echo message="Running unit tests ..."/>
<property name="build.bin.zip.name" value="${build.dist}/${component.name}-${component.version}.zip"/> <mkdir dir="${build.home}/test-reports"/>
<property name="build.src.tar.name" value="${build.dist}/${component.name}-${component.version}-src.tar"/> <junit printsummary="true" showoutput="true" fork="yes" haltonfailure="${test.failonerror}">
<property name="build.src.gz.name" value="${build.dist}/${component.name}-${component.version}-src.tar.gz"/> <classpath refid="test.classpath"/>
<property name="build.src.zip.name" value="${build.dist}/${component.name}-${component.version}-src.zip"/> <formatter type="plain" usefile="true" />
<property name="dist.home" value="dist"/> <!-- If test.entry is defined, run a single test, otherwise run all valid tests -->
<!-- for nightly builds --> <test name="${test.entry}" todir="${build.home}/test-reports" if="test.entry"/>
<batchtest fork="yes" todir="${build.home}/test-reports" unless="test.entry">
<!-- Path variables --> <fileset dir="${test.home}">
<path id="test.support.path"> <include name="**/*Test.java"/>
<!--Combines all jar references needed for running and compiling tests--> <exclude name="**/*$*"/>
<pathelement location="${junit.jar}" /> <exclude name="**/TestUtils.java"/>
<pathelement location="${hamcrest.jar}" /> <exclude name="**/Abstract*.java"/>
<pathelement location="${easymock.jar}" /> <exclude name="**/BulkTest.java"/>
</path> </fileset>
</batchtest>
<!-- ========== Settings ================================================== --> </junit>
</target>
<!-- Javac -->
<property name="compile.debug" value="true"/> <target name="clean" description="Clean build and distribution directories">
<property name="compile.deprecation" value="true"/> <delete dir="${build.home}"/>
<property name="compile.optimize" value="false"/> </target>
<!-- Javadoc --> <target name="all" depends="clean,test,compile" description="Clean and compile all components"/>
<property name="javadoc.access" value="protected"/>
<property name="javadoc.links" value="http://download.oracle.com/javase/1.5.0/docs/api/"/> <!-- ========== JavaDocs ========================================= -->
<target name="javadoc" depends="compile" description="Create component Javadoc documentation">
<!-- JUnit --> <mkdir dir="${build.home}"/>
<property name="test.failonerror" value="true"/> <mkdir dir="${build.home}/apidocs"/>
<property name="test.fork" value="true"/> <tstamp>
<property name="test.haltonfailure" value="true"/> <format property="current.year" pattern="yyyy"/>
</tstamp>
<!-- Maven --> <javadoc sourcepath="${source.home}"
<property name="maven.repo" value="${user.home}/.maven/repository" /> destdir="${build.home}/apidocs"
overview="${source.home}/org/apache/commons/collections4/overview.html"
packagenames="org.apache.commons.*"
<!-- ====================================================================== --> excludepackagenames="${javadoc.excludepackagenames}"
<!-- ========== Executable Targets ======================================== --> author="false"
<!-- ====================================================================== --> version="true"
doctitle="&lt;h1&gt;Commons Lang ${component.version}&lt;/h1&gt;"
<target name="clean" windowtitle="Lang ${component.version}"
description="Clean build and distribution directories"> bottom="Copyright &amp;copy; 2001-${current.year} - Apache Software Foundation"
<delete dir="${build.home}"/> use="true"
</target> encoding="${compile.encoding}"
source="${compile.source}">
<!-- ====================================================================== --> <classpath refid="compile.classpath"/>
<link href="${jdk.javadoc}"/>
<target name="init" <link href="${collections.javadoc}"/>
description="Initialize and evaluate conditionals"> </javadoc>
<echo message="-------- ${component.name} ${component.version} --------"/> </target>
</target>
<!-- ========== Jar Targets ========================================= -->
<!-- ====================================================================== --> <target name="jar" depends="compile" description="Create jar">
<mkdir dir="${build.home}/classes/META-INF"/>
<target name="prepare" depends="init" <copy file="LICENSE.txt" tofile="${build.home}/classes/META-INF/LICENSE.txt"/>
description="Prepare build directory"> <copy file="NOTICE.txt" tofile="${build.home}/classes/META-INF/NOTICE.txt"/>
<mkdir dir="${build.home}"/> <jar jarfile="${build.home}/${final.name}.jar">
</target> <manifest>
<attribute name="Specification-Title" value="Commons Collections"/>
<!-- ====================================================================== --> <attribute name="Specification-Version" value="${component.version}"/>
<attribute name="Specification-Vendor" value="The Apache Software Foundation"/>
<target name="compile" depends="prepare" <attribute name="Implementation-Title" value="Commons Collections"/>
description="Compile main code"> <attribute name="Implementation-Version" value="${component.version}"/>
<mkdir dir="${build.classes}"/> <attribute name="Implementation-Vendor" value="The Apache Software Foundation"/>
<javac srcdir="${source.java}" <attribute name="Implementation-Vendor-Id" value="org.apache"/>
destdir="${build.classes}" <attribute name="X-Compile-Source-JDK" value="${compile.source}"/>
debug="${compile.debug}" <attribute name="X-Compile-Target-JDK" value="${compile.target}"/>
deprecation="${compile.deprecation}" </manifest>
optimize="${compile.optimize}" <fileset dir="${build.home}/classes">
includeantruntime="false"> <include name="**/*.class"/>
</javac> <include name="**/LICENSE.txt"/>
</target> <include name="**/NOTICE.txt"/>
</fileset>
<!-- ====================================================================== --> </jar>
</target>
<target name="jar" depends="compile"
description="Create jar"> <target name="javadoc-jar" depends="javadoc" description="Create JavaDoc jar">
<mkdir dir="${build.classes}/META-INF"/> <jar jarfile="${build.home}/${final.name}-javadoc.jar">
<copy file="LICENSE.txt" <manifest>
tofile="${build.classes}/META-INF/LICENSE.txt"/> <attribute name="Specification-Title" value="Commons Collections API"/>
<copy file="NOTICE.txt" <attribute name="Specification-Version" value="${component.version}"/>
tofile="${build.classes}/META-INF/NOTICE.txt"/> <attribute name="Specification-Vendor" value="The Apache Software Foundation"/>
<attribute name="Implementation-Title" value="Commons Collections API"/>
<tstamp/> <attribute name="Implementation-Version" value="${component.version}"/>
<mkdir dir="${build.conf}"/> <attribute name="Implementation-Vendor" value="The Apache Software Foundation"/>
<copy todir="${build.conf}" filtering="on"> <attribute name="Implementation-Vendor-Id" value="org.apache"/>
<filterset> </manifest>
<filter token="name" value="${component.name}"/> <fileset dir="${build.home}/apidocs"/>
<filter token="title" value="${component.title}"/> <fileset dir="${basedir}">
<filter token="package" value="${component.package}"/> <include name="LICENSE.txt"/>
<filter token="version" value="${component.version}"/> <include name="NOTICE.txt"/>
</filterset> </fileset>
<fileset dir="${source.conf}" includes="*.MF"/> </jar>
</copy> </target>
<!-- NOTE: A jar built using JDK1.4 is incompatible with JDK1.2 --> <target name="source-jar" depends="init" description="Create Source jar">
<jar jarfile="${build.jar.name}" <jar jarfile="${build.home}/${final.name}-sources.jar">
basedir="${build.classes}" <manifest>
manifest="${build.conf}/MANIFEST.MF"/> <attribute name="Specification-Title" value="Commons Collections Source"/>
</target> <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}"/>
<target name="compile.tests" depends="compile" <attribute name="Implementation-Vendor" value="The Apache Software Foundation"/>
description="Compile unit test cases"> <attribute name="Implementation-Vendor-Id" value="org.apache"/>
<mkdir dir="${build.tests}"/> </manifest>
<javac srcdir="${source.test}" <fileset dir="${source.home}">
destdir="${build.tests}" <include name="**/*.java"/>
debug="true" </fileset>
deprecation="false" <fileset dir="${basedir}">
optimize="false" <include name="LICENSE.txt"/>
includeantruntime="false"> <include name="NOTICE.txt"/>
<classpath> </fileset>
<pathelement location="${build.classes}"/> </jar>
<path refid="test.support.path"/> </target>
</classpath>
</javac> <target name="test-jar" depends="init" description="Create Testframework jar">
</target> <jar jarfile="${build.home}/${final.name}-tests.jar">
<manifest>
<!-- ====================================================================== --> <attribute name="Specification-Title" value="Commons Collections Testframework"/>
<attribute name="Specification-Version" value="${component.version}"/>
<!-- Tests collections, either running all or one test --> <attribute name="Specification-Vendor" value="The Apache Software Foundation"/>
<target name="test" depends="-test-all,-test-single" <attribute name="Implementation-Title" value="Commons Collections Testframework"/>
description="Run unit tests" /> <attribute name="Implementation-Version" value="${component.version}"/>
<attribute name="Implementation-Vendor" value="The Apache Software Foundation"/>
<path id="build.path"> <attribute name="Implementation-Vendor-Id" value="org.apache"/>
<pathelement location="${build.classes}" /> </manifest>
</path> <fileset dir="${test.home}">
<include name="**/*.java"/>
<!-- Runs all tests --> </fileset>
<target name="-test-all" depends="compile.tests" unless="testcase"> <fileset dir="${basedir}">
<mkdir dir="${build.test.reports}" /> <include name="LICENSE.txt"/>
<include name="NOTICE.txt"/>
<junit printsummary="yes" haltonfailure="${test.haltonfailure}" showoutput="yes"> </fileset>
<classpath> </jar>
<pathelement location="${build.classes}"/> </target>
<pathelement location="${build.tests}"/>
<path refid="test.support.path"/> <!-- ========== Distribution ========================================= -->
</classpath> <target name="dist" depends="clean,jar,source-jar,javadoc-jar,test-jar" description="Create binary distribution">
<formatter type="xml" /> <!-- binary distro -->
<formatter type="plain" /> <zip destfile="${build.home}/${final.name}.zip">
<batchtest fork="${test.fork}" todir="${build.test.reports}"> <zipfileset dir="${basedir}" prefix="${final.name}"
<fileset dir="${source.test}"> includes="LICENSE.txt,
<include name="**/*Test.java"/> NOTICE.txt,
<exclude name="**/TestUtils.java"/> RELEASE-NOTES.txt"
<exclude name="**/*$*"/> />
<exclude name="**/Abstract*.java"/> <zipfileset dir="${build.home}" includes="*.jar," prefix="${final.name}"/>
<exclude name="**/BulkTest.java"/> <zipfileset dir="${build.home}/apidocs" prefix="${final.name}/apidocs"/>
</fileset> </zip>
</batchtest> <tar destfile="${build.home}/${final.name}.tar.gz" compression="gzip">
</junit> <zipfileset src="${build.home}/${final.name}.zip"/>
<junitreport todir="${build.test.reports}"> </tar>
<fileset dir="${build.test.reports}">
<include name="TEST-*.xml" /> <!-- source distro -->
</fileset> <zip destfile="${build.home}/${final.name}-src.zip">
<report format="frames" todir="${build.test.reports}/html" /> <zipfileset dir="${basedir}" prefix="${final.name}-src"
</junitreport> includes="build.xml,
</target> default.properties,
build.properties.sample,
<!-- Runs a single test --> DEVELOPERS-GUIDE.html,
<target name="-test-single" depends="compile.tests" if="testcase"> PROPOSAL.html,
<junit printsummary="yes" haltonfailure="${test.haltonfailure}" showoutput="yes"> LICENSE.txt,
<formatter type="brief" /> NOTICE.txt,
<classpath> README.txt,
<pathelement location="${build.classes}"/> pom.xml,
<pathelement location="${build.tests}"/> RELEASE-NOTES.txt"
<path refid="test.support.path"/> />
</classpath> <zipfileset dir="${basedir}/src" prefix="${final.name}-src/src"/>
</zip>
<test name="${testcase}" fork="${test.fork}" todir="${build.test.reports}"> <tar destfile="${build.home}/${final.name}-src.tar.gz" compression="gzip">
<formatter type="brief" usefile="false" /> <zipfileset src="${build.home}/${final.name}-src.zip"/>
</test> </tar>
</junit>
</target> </target>
<!-- ====================================================================== -->
<target name="testjar" depends="compile.tests,jar"
description="Run all unit test cases">
<echo message="Running collections tests against built jar ..."/>
<junit printsummary="yes" haltonfailure="${test.haltonfailure}" dir="${basedir}">
<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>
<format property="year" pattern="yyyy"/>
</tstamp>
<delete dir="${build.docs}"/>
<mkdir dir="${build.docs}"/>
<javadoc sourcepath="${source.java}"
destdir="${build.docs}"
packagenames="${component.package}.*"
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"
version="false"
link="${javadoc.links}"
overview="${source.test}/org/apache/commons/collections/overview.html"
doctitle="${tf.title} ${tf.version} API;"
windowtitle="${tf.title} ${tf.version} API"
bottom="Copyright &amp;copy; 2001-${year} Apache Software Foundation. All Rights Reserved.">
<fileset dir="${source.test}">
<include name="**/AbstractTest*.java"/>
<include name="**/BulkTest*.java"/>
</fileset>
</javadoc>
</target>
<!-- ====================================================================== -->
<!-- ========== Distributions ============================================= -->
<!-- ====================================================================== -->
<!-- ====================================================================== -->
<!-- Target needed for nightly builds -->
<target name="dist" depends="javadoc,dist.create"
description="Create distribution folders">
<delete dir="${dist.home}"/>
<mkdir dir="${dist.home}" />
<copy todir="${dist.home}">
<fileset dir="${build.dist.bin}" />
</copy>
</target>
<target name="dist.create" depends="jar,testjar,tf.validate,tf.jar,dist.bin,dist.src" />
<target name="dist.bin">
<copy todir="${build.src}">
<fileset dir="${basedir}/src/java" includes="**/*.java" />
</copy>
<copy todir="${build.src}/META-INF">
<fileset dir="${basedir}" includes="LICENSE*, NOTICE*" />
</copy>
<jar jarfile="${build.home}/${final.name}-src-ide.zip" basedir="${build.src}" />
<antcall target="internal-md5">
<param name="path" value="${build.home}/${final.name}.jar"/>
</antcall>
<mkdir dir="${build.dist.bin.work}"/>
<copy todir="${build.dist.bin.work}">
<fileset dir=".">
<include name="LICENSE.txt"/>
<include name="NOTICE.txt"/>
<include name="README.txt"/>
<include name="RELEASE-NOTES.html"/>
</fileset>
</copy>
<copy todir="${build.dist.bin.work}">
<fileset dir="${build.home}">
<include name="*.jar"/>
<include name="docs/**"/>
</fileset>
</copy>
</target>
<target name="dist.src">
<mkdir dir="${build.dist.src.work}"/>
<copy todir="${build.dist.src.work}">
<fileset dir=".">
<include name="LICENSE.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>
</copy>
<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 name="release" depends="dist.create,zip"
description="Create release">
<!-- POM -->
<copy file="project.xml" tofile="${build.home}/${final.name}.pom" />
<antcall target="internal-md5">
<param name="path" value="${build.home}/${final.name}.pom"/>
</antcall>
</target>
<target name="zip" depends="zip.bin,zip.src">
</target>
<target name="zip.bin">
<mkdir dir="${build.dist}"/>
<fixcrlf srcdir="${build.dist.bin.work}" eol="lf" includes="*.txt" />
<tar longfile="gnu" tarfile="${build.bin.tar.name}">
<tarfileset dir="${build.dist.bin}"/>
</tar>
<gzip zipfile="${build.bin.gz.name}" src="${build.bin.tar.name}"/>
<delete file="${build.bin.tar.name}" />
<antcall target="internal-md5">
<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>
<antcall target="internal-md5">
<param name="path" value="${build.bin.zip.name}"/>
</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>
<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" />
<zip zipfile="${build.src.zip.name}" >
<zipfileset dir="${build.dist.src}"/>
</zip>
<antcall target="internal-md5">
<param name="path" value="${build.src.zip.name}"/>
</antcall>
</target>
<target name="internal-md5">
<basename property="_base" file="${path}"/>
<checksum file="${path}" property="md5"/>
<echo message="${md5} *${_base}" file="${path}.md5"/>
</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>