|
Commons Collections example source code file (build.xml)
The Commons Collections build.xml source code<!-- 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="commons-collections" default="compile" basedir="."> <!-- ========== Properties ================================================ --> <!-- This can be used to define 'junit.jar' property if necessary --> <property file="build.properties"/> <!-- ========== Component Declarations ==================================== --> <!-- The name of this component --> <property name="component.name" value="commons-collections"/> <!-- The primary package name of this component --> <property name="component.package" value="org.apache.commons.collections"/> <!-- 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="3.2.1"/> <!-- 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/java"/> <!-- The base directory for unit test sources --> <property name="source.test" value="src/test"/> <!-- 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 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"/> <!-- ========== Settings ================================================== --> <!-- 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://java.sun.com/j2se/1.3/docs/api/"/> <!-- JUnit --> <property name="test.failonerror" value="true"/> <!-- Maven --> <property name="maven.repo" value="${user.home}/.maven/repository" /> <!-- ====================================================================== --> <!-- ========== Executable Targets ======================================== --> <!-- ====================================================================== --> <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} --------"/> </target> <!-- ====================================================================== --> <target name="prepare" depends="init" description="Prepare build directory"> <mkdir dir="${build.home}"/> </target> <!-- ====================================================================== --> <target name="compile" depends="prepare" description="Compile main code"> <mkdir dir="${build.classes}"/> <javac srcdir="${source.java}" destdir="${build.classes}" debug="${compile.debug}" deprecation="${compile.deprecation}" optimize="${compile.optimize}"> </javac> </target> <!-- ====================================================================== --> <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> <!-- 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> <!-- ====================================================================== --> <!-- Targets you might use to get smaller jar files - not recommended --> <target name="splitjar" depends="jar" description="Create split jar"> <jar jarfile="${build.home}/${component.name}-bag-${component.version}.jar" basedir="${build.classes}" manifest="${build.conf}/MANIFEST.MF"> <include name="**/META-INF/*"/> <include name="**/BagUtils*.class"/> <include name="**/bag/*.class"/> </jar> <jar jarfile="${build.home}/${component.name}-bidimap-${component.version}.jar" basedir="${build.classes}" manifest="${build.conf}/MANIFEST.MF"> <include name="**/META-INF/*"/> <include name="**/bidimap/*.class"/> </jar> <jar jarfile="${build.home}/${component.name}-buffer-${component.version}.jar" basedir="${build.classes}" manifest="${build.conf}/MANIFEST.MF"> <include name="**/META-INF/*"/> <include name="**/BufferUtils*.class"/> <include name="**/buffer/*.class"/> </jar> <jar jarfile="${build.home}/${component.name}-functors-${component.version}.jar" basedir="${build.classes}" manifest="${build.conf}/MANIFEST.MF"> <include name="**/META-INF/*"/> <include name="**/ClosureUtils*.class"/> <include name="**/FactoryUtils*.class"/> <include name="**/PredicateUtils*.class"/> <include name="**/TransformerUtils*.class"/> <include name="**/functors/*.class"/> </jar> <jar jarfile="${build.home}/${component.name}-core-${component.version}.jar" basedir="${build.classes}" manifest="${build.conf}/MANIFEST.MF"> <include name="**/META-INF/*"/> <include name="**/*"/> <exclude name="**/BagUtils*.class"/> <exclude name="**/BufferUtils*.class"/> <exclude name="**/ClosureUtils*.class"/> <exclude name="**/FactoryUtils*.class"/> <exclude name="**/PredicateUtils*.class"/> <exclude name="**/TransformerUtils*.class"/> <exclude name="**/bag/*.class"/> <exclude name="**/bidimap/*.class"/> <exclude name="**/buffer/*.class"/> <exclude name="**/functors/*.class"/> <exclude name="**/iterators/ProxyIterator*.class"/> <exclude name="**/iterators/ProxyListIterator*.class"/> <exclude name="**/map/*.class"/> <exclude name="org/apache/commons/collections/BeanMap*.class"/> <exclude name="org/apache/commons/collections/BinaryHeap*.class"/> <exclude name="org/apache/commons/collections/BoundedFifoBuffer*.class"/> <exclude name="org/apache/commons/collections/CursorableLinkedList*.class"/> <exclude name="org/apache/commons/collections/CursorableSubList*.class"/> <exclude name="org/apache/commons/collections/DefaultMapBag*.class"/> <exclude name="org/apache/commons/collections/DefaultMapEntry*.class"/> <exclude name="org/apache/commons/collections/DoubleOrderedMap*.class"/> <exclude name="org/apache/commons/collections/HashBag*.class"/> <exclude name="org/apache/commons/collections/LRUMap*.class"/> <exclude name="org/apache/commons/collections/MultiHashMap*.class"/> <exclude name="org/apache/commons/collections/PriorityQueue*.class"/> <exclude name="org/apache/commons/collections/ProxyMap*.class"/> <exclude name="org/apache/commons/collections/ReferenceMap*.class"/> <exclude name="org/apache/commons/collections/SequencedHashMap*.class"/> <exclude name="org/apache/commons/collections/StaticBucketMap*.class"/> <exclude name="org/apache/commons/collections/SynchronizedPriorityQueue*.class"/> <exclude name="org/apache/commons/collections/TreeBag*.class"/> <exclude name="org/apache/commons/collections/UnboundedFifoBuffer*.class"/> </jar> <jar jarfile="${build.home}/${component.name}-deprecated-${component.version}.jar" basedir="${build.classes}" manifest="${build.conf}/MANIFEST.MF"> <include name="**/META-INF/*"/> <include name="**/iterators/ProxyIterator*.class"/> <include name="**/iterators/ProxyListIterator*.class"/> <include name="org/apache/commons/collections/BeanMap*.class"/> <include name="org/apache/commons/collections/BinaryHeap*.class"/> <include name="org/apache/commons/collections/BoundedFifoBuffer*.class"/> <include name="org/apache/commons/collections/CursorableLinkedList*.class"/> <include name="org/apache/commons/collections/CursorableSubList*.class"/> <include name="org/apache/commons/collections/DefaultMapBag*.class"/> <include name="org/apache/commons/collections/DefaultMapEntry*.class"/> <include name="org/apache/commons/collections/DoubleOrderedMap*.class"/> <include name="org/apache/commons/collections/HashBag*.class"/> <include name="org/apache/commons/collections/LRUMap*.class"/> <include name="org/apache/commons/collections/MultiHashMap*.class"/> <include name="org/apache/commons/collections/PriorityQueue*.class"/> <include name="org/apache/commons/collections/ProxyMap*.class"/> <include name="org/apache/commons/collections/ReferenceMap*.class"/> <include name="org/apache/commons/collections/SequencedHashMap*.class"/> <include name="org/apache/commons/collections/StaticBucketMap*.class"/> <include name="org/apache/commons/collections/SynchronizedPriorityQueue*.class"/> <include name="org/apache/commons/collections/TreeBag*.class"/> <include name="org/apache/commons/collections/UnboundedFifoBuffer*.class"/> </jar> </target> <!-- ====================================================================== --> <target name="compile.tests" depends="compile" description="Compile unit test cases"> <mkdir dir="${build.tests}"/> <javac srcdir="${source.test}" destdir="${build.tests}" debug="true" deprecation="false" optimize="false"> <classpath> <pathelement location="${build.classes}"/> <pathelement location="${junit.jar}"/> </classpath> </javac> </target> <!-- ====================================================================== --> <!-- Tests collections, either running all or one test --> <target name="test" depends="-test-all,-test-single" description="Run unit tests" /> <!-- Runs all tests --> <target name="-test-all" depends="compile.tests" unless="testcase"> <mkdir dir="${build.test.reports}"/> <junit printsummary="yes" haltonfailure="yes" showoutput="yes"> <formatter type="brief" /> <classpath> <pathelement location="${build.classes}"/> <pathelement location="${build.tests}"/> <pathelement location="${junit.jar}"/> </classpath> <batchtest fork="yes" todir="${build.test.reports}"> <fileset dir="${source.test}"> <include name="**/Test*.java"/> <exclude name="**/TestAll*.java"/> <exclude name="**/TestAbstract*"/> <exclude name="**/TestArrayList.java"/> <exclude name="**/TestLinkedList.java"/> <exclude name="**/TestHashMap.java"/> <exclude name="**/TestTreeMap.java"/> <exclude name="**/TestTypedCollection.java"/> </fileset> <formatter type="brief" usefile="false" /> </batchtest> </junit> </target> <!-- Runs a single test --> <target name="-test-single" depends="compile.tests" if="testcase"> <junit printsummary="yes" haltonfailure="yes" showoutput="yes"> <formatter type="brief" /> <classpath> <pathelement location="${build.classes}"/> <pathelement location="${build.tests}"/> <pathelement location="${junit.jar}"/> </classpath> <test name="${testcase}" fork="yes" todir="${build.test.reports}"> <formatter type="brief" usefile="false" /> </test> </junit> </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="yes"> <classpath> <pathelement location="${build.jar.name}"/> <pathelement location="${build.tests}"/> <pathelement location="${junit.jar}"/> </classpath> <batchtest fork="yes"> <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> Other Commons Collections examples (source code examples)Here is a short list of links related to this Commons Collections build.xml source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.