Author: niallp
Date: Fri Apr  9 16:10:30 2010
New Revision: 932482

URL: http://svn.apache.org/viewvc?rev=932482&view=rev
Log:
Replace m1 generated ant build with hand writtern one

Modified:
    commons/proper/chain/trunk/build.xml

Modified: commons/proper/chain/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/chain/trunk/build.xml?rev=932482&r1=932481&r2=932482&view=diff
==============================================================================
--- commons/proper/chain/trunk/build.xml (original)
+++ commons/proper/chain/trunk/build.xml Fri Apr  9 16:10:30 2010
@@ -1,194 +1,286 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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="Chain" default="dist" basedir=".">
+<!--
+  "Chain" component of the Apache Commons Subproject
+  $Id$
+-->
 
-<!--build.xml generated by maven from project.xml version 1.3-SNAPSHOT
-  on date June 1 2008, time 1950-->
 
-<project default="jar" name="commons-chain" basedir=".">
-  <property name="defaulttargetdir" value="target">
-  </property>
-  <property name="libdir" value="target/lib">
-  </property>
-  <property name="classesdir" value="target/classes">
-  </property>
-  <property name="testclassesdir" value="target/test-classes">
-  </property>
-  <property name="testclassesdir" value="target/test-classes">
-  </property>
-  <property name="testreportdir" value="target/test-reports">
-  </property>
-  <property name="distdir" value="dist">
-  </property>
-  <property name="javadocdir" value="dist/docs/api">
-  </property>
-  <property name="final.name" value="commons-chain-1.3-SNAPSHOT">
-  </property>
-  <path id="build.classpath">
-    <fileset dir="${libdir}">
-      <include name="**/*.jar">
-      </include>
-    </fileset>
+<!-- ========== Initialize Properties ===================================== -->
+
+
+  <property file="build.properties"/>                <!-- Component local   -->
+  <property file="../build.properties"/>             <!-- Commons local     -->
+  <property file="${user.home}/build.properties"/>   <!-- User local        -->
+
+
+<!-- ========== Component Declarations ==================================== -->
+
+
+  <!-- The name of this component -->
+  <property name="component.name"          value="chain"/>
+
+  <!-- The title of this component -->
+  <property name="component.title"         value="Commons Chain"/>
+
+  <!-- The current version number of this component -->
+  <property name="component.version"       value="1.3-SNAPSHOT"/>
+
+  <!-- The base directory for compilation targets -->
+  <property name="build.home"              value="target"/>
+
+  <!-- The base directory for component resources -->
+  <property name="resources.home"          value="src/main/resources"/>
+
+  <!-- The base directory for component sources -->
+  <property name="source.home"             value="src/main/java"/>
+
+  <!-- Artifact Name -->
+  <property name="final.name"             
value="commons-${component.name}-${component.version}"/>
+
+  <!-- The base directory for unit test sources -->
+  <property name="test.home"               value="src/test"/>
+
+  <!-- Download lib dir -->
+  <property name="download.lib.dir"        value="lib"/>
+
+<!-- ========== External Dependencies ===================================== -->
+
+  <property name="beanutils.version"       value="1.8.3"/>
+  <property name="digester.version"        value="1.8"/>
+  <property name="logging.version"         value="1.1.1"/>
+  <property name="servlet.version"         value="2.3"/>
+  <property name="portlet.version"         value="1.0"/>
+  <property name="myfaces.version"         value="1.1.0"/>
+  <property name="junit.version"           value="3.8.1"/>
+
+  <property name="beanutils.home"          
value="${user.home}/.m2/repository/commons-beanutils/commons-beanutils/${beanutils.version}"/>
+  <property name="digester.home"           
value="${user.home}/.m2/repository/commons-digester/commons-digester/${digester.version}"/>
+  <property name="logging.home"            
value="${user.home}/.m2/repository/commons-logging/commons-logging/${logging.version}"/>
+  <property name="servlet.home"            
value="${user.home}/.m2/repository/javax/servlet/servlet-api/${servlet.version}"/>
+  <property name="portlet.home"            
value="${user.home}/.m2/repository/javax/portlet/portlet-api/${portlet.version}"/>
+  <property name="myfaces.home"            
value="${user.home}/.m2/repository/myfaces/myfaces-api/${myfaces.version}"/>
+  <property name="junit.home"              
value="${user.home}/.m2/repository/junit/junit/${junit.version}"/>
+
+  <property name="beanutils.jar"          
value="${beanutils.home}/commons-beanutils-${beanutils.version}.jar"/>
+  <property name="digester.jar"           
value="${digester.home}/commons-digester-${digester.version}.jar"/>
+  <property name="logging.jar"            
value="${logging.home}/commons-logging-${logging.version}.jar"/>
+  <property name="servlet.jar"            
value="${servlet.home}/servlet-api-${servlet.version}.jar"/>
+  <property name="portlet.jar"            
value="${portlet.home}/portlet-api-${portlet.version}.jar"/>
+  <property name="myfaces.jar"            
value="${myfaces.home}/myfaces-api-${myfaces.version}.jar"/>
+  <property name="junit.jar"              
value="${junit.home}/junit-${junit.version}.jar"/>
+
+<!-- ========== Compiler Defaults ========================================= -->
+
+
+  <!-- source JDK version (should be same as maven.compile.source) -->
+  <property name="compile.source"          value="1.4"/>
+
+  <!-- target JDK version (should be same as maven.compile.target) -->
+  <property name="compile.target"          value="1.4"/>
+
+  <!-- Should Java compilations set the 'debug' compiler option? -->
+  <property name="compile.debug"           value="true"/>
+
+  <!-- Should Java compilations set the 'deprecation' compiler option? -->
+  <property name="compile.deprecation"     value="false"/>
+
+  <!-- Should Java compilations set the 'optimize' compiler option? -->
+  <property name="compile.optimize"        value="true"/>
+
+  <!-- Construct compile classpath -->
+  <path id="compile.classpath">
+    <pathelement location="${build.home}/classes"/>
+    <pathelement location="${beanutils.jar}"/>
+    <pathelement location="${digester.jar}"/>
+    <pathelement location="${logging.jar}"/>
+    <pathelement location="${servlet.jar}"/>
+    <pathelement location="${portlet.jar}"/>
+    <pathelement location="${myfaces.jar}"/>
+  </path>
+
+<!-- ========== Test Execution Defaults =================================== -->
+
+
+  <!-- Construct unit test classpath -->
+  <path id="test.classpath">
+    <path refid="compile.classpath"/>
+    <pathelement location="${build.home}/tests"/>
+    <pathelement location="${junit.jar}"/>
   </path>
-  <target name="init" description="o Initializes some properties">
-    <mkdir dir="${libdir}">
-    </mkdir>
-    <condition property="noget">
-      <equals arg2="only" arg1="${build.sysclasspath}">
-      </equals>
-    </condition>
-    <!--Test if JUNIT is present in ANT classpath-->
-
-    <available property="Junit.present" classname="junit.framework.Test">
-    </available>
-  </target>
-  <target name="compile" description="o Compile the code" depends="get-deps">
-    <mkdir dir="${classesdir}">
-    </mkdir>
-    <javac destdir="${classesdir}" deprecation="true" debug="true" 
optimize="false" excludes="**/package.html">
-      <src>
-        <pathelement location="src/java">
-        </pathelement>
-      </src>
-      <classpath refid="build.classpath">
-      </classpath>
-    </javac>
-    <copy todir="${classesdir}">
-      <fileset dir="src/test">
-        <include name="**/*.xml">
-        </include>
-      </fileset>
-    </copy>
-    <mkdir dir="${classesdir}/META-INF">
-    </mkdir>
-    <copy todir="${classesdir}/META-INF">
-      <fileset dir=".">
-        <include name="NOTICE.txt">
-        </include>
-      </fileset>
-    </copy>
-  </target>
-  <target name="jar" description="o Create the jar" depends="compile,test">
-    <jar jarfile="${defaulttargetdir}/${final.name}.jar" 
excludes="**/package.html" basedir="${classesdir}">
-    </jar>
-  </target>
-  <target name="clean" description="o Clean up the generated directories">
-    <delete dir="${defaulttargetdir}">
-    </delete>
-    <delete dir="${distdir}">
-    </delete>
-  </target>
-  <target name="dist" description="o Create a distribution" depends="jar, 
javadoc">
-    <mkdir dir="dist">
-    </mkdir>
-    <copy todir="dist">
-      <fileset dir="${defaulttargetdir}" includes="*.jar">
-      </fileset>
-      <fileset dir="${basedir}" includes="LICENSE*, README*">
-      </fileset>
-    </copy>
-  </target>
-  <target name="test" description="o Run the test cases" if="test.failure" 
depends="internal-test">
-    <fail message="There were test failures.">
-    </fail>
-  </target>
-  <target name="internal-test" if="Junit.present" 
depends="junit-present,compile-tests">
-    <mkdir dir="${testreportdir}">
-    </mkdir>
-    <junit dir="./" failureproperty="test.failure" printSummary="yes" 
fork="true" haltonerror="true">
-      <sysproperty key="basedir" value=".">
-      </sysproperty>
-      <formatter type="xml">
-      </formatter>
-      <formatter usefile="false" type="plain">
-      </formatter>
-      <classpath>
-        <path refid="build.classpath">
-        </path>
-        <pathelement path="${testclassesdir}">
-        </pathelement>
-        <pathelement path="${classesdir}">
-        </pathelement>
-      </classpath>
-      <batchtest todir="${testreportdir}">
-        <fileset dir="src/test">
-          <include name="**/*TestCase.java">
-          </include>
-        </fileset>
-      </batchtest>
-    </junit>
-  </target>
-  <target name="junit-present" unless="Junit.present" depends="init">
-    <echo>================================= WARNING 
================================</echo>
-    <echo>Junit isn't present in your ${ANT_HOME}/lib directory. Tests not 
executed.</echo>
-    
<echo>==========================================================================</echo>
-  </target>
-  <target name="compile-tests" if="Junit.present" 
depends="junit-present,compile">
-    <mkdir dir="${testclassesdir}">
-    </mkdir>
-    <javac destdir="${testclassesdir}" deprecation="true" debug="true" 
optimize="false" excludes="**/package.html">
-      <src>
-        <pathelement location="src/test">
-        </pathelement>
-      </src>
-      <classpath>
-        <path refid="build.classpath">
-        </path>
-        <pathelement path="${classesdir}">
-        </pathelement>
-      </classpath>
-    </javac>
-  </target>
-  <target name="javadoc" description="o Generate javadoc" depends="get-deps">
-    <mkdir dir="${javadocdir}">
-    </mkdir>
-    <tstamp>
-      <format pattern="2003-yyyy" property="year">
-      </format>
-    </tstamp>
-    <property name="copyright" value="Copyright &amp;copy;  The Apache 
Software Foundation. All Rights Reserved.">
-    </property>
-    <property name="title" value="Commons Chain 1.3-SNAPSHOT API">
-    </property>
-    <javadoc use="true" private="true" destdir="${javadocdir}" author="true" 
version="true" sourcepath="src/java" packagenames="org.apache.commons.chain.*">
-      <classpath>
-        <path refid="build.classpath">
-        </path>
-      </classpath>
-    </javadoc>
-  </target>
-  <target name="get-deps" unless="noget" depends="init">
-    <!--Proxy settings works only with a JDK 1.2 and higher.-->
-
-    <setproxy>
-    </setproxy>
-    <get dest="${libdir}/servlet-api-2.3.jar" usetimestamp="true" 
ignoreerrors="true" 
src="http://repo1.maven.org/maven/javax.servlet/jars/servlet-api-2.3.jar";>
-    </get>
-    <get dest="${libdir}/portlet-api-1.0.jar" usetimestamp="true" 
ignoreerrors="true" 
src="http://repo1.maven.org/maven/javax.portlet/jars/portlet-api-1.0.jar";>
-    </get>
-    <get dest="${libdir}/myfaces-api-1.1.0.jar" usetimestamp="true" 
ignoreerrors="true" 
src="http://repo1.maven.org/maven/myfaces/jars/myfaces-api-1.1.0.jar";>
-    </get>
-    <get dest="${libdir}/junit-3.8.1.jar" usetimestamp="true" 
ignoreerrors="true" 
src="http://repo1.maven.org/maven/junit/jars/junit-3.8.1.jar";>
-    </get>
-    <get dest="${libdir}/xml-apis-2.0.2.jar" usetimestamp="true" 
ignoreerrors="true" 
src="http://repo1.maven.org/maven/xml-apis/jars/xml-apis-2.0.2.jar";>
-    </get>
-    <get dest="${libdir}/xercesImpl-2.2.1.jar" usetimestamp="true" 
ignoreerrors="true" 
src="http://repo1.maven.org/maven/xerces/jars/xercesImpl-2.2.1.jar";>
-    </get>
-    <get dest="${libdir}/commons-beanutils-1.7.0.jar" usetimestamp="true" 
ignoreerrors="true" 
src="http://repo1.maven.org/maven/commons-beanutils/jars/commons-beanutils-1.7.0.jar";>
-    </get>
-    <get dest="${libdir}/commons-digester-1.8.jar" usetimestamp="true" 
ignoreerrors="true" 
src="http://repo1.maven.org/maven/commons-digester/jars/commons-digester-1.8.jar";>
-    </get>
-    <get dest="${libdir}/commons-logging-1.1.1.jar" usetimestamp="true" 
ignoreerrors="true" 
src="http://repo1.maven.org/maven/commons-logging/jars/commons-logging-1.1.1.jar";>
-    </get>
-    <get dest="${libdir}/maven-xdoc-plugin-1.9.2.jar" usetimestamp="true" 
ignoreerrors="true" 
src="http://repo1.maven.org/maven/maven/plugins/maven-xdoc-plugin-1.9.2.jar";>
-    </get>
-    <get dest="${libdir}/maven-changelog-plugin-1.8.2.jar" usetimestamp="true" 
ignoreerrors="true" 
src="http://repo1.maven.org/maven/maven/plugins/maven-changelog-plugin-1.8.2.jar";>
-    </get>
-    <get dest="${libdir}/maven-changes-plugin-1.6.jar" usetimestamp="true" 
ignoreerrors="true" 
src="http://repo1.maven.org/maven/maven/plugins/maven-changes-plugin-1.6.jar";>
-    </get>
-  </target>
-  <target name="install-maven">
-    <get dest="${user.home}/maven-install-latest.jar" usetimestamp="true" 
src="${repo}/maven/maven-install-latest.jar">
-    </get>
-    <unjar dest="${maven.home}" src="${user.home}/maven-install-latest.jar">
-    </unjar>
-  </target>
-</project>
\ No newline at end of file
+
+  <!-- Should all tests fail if one does? -->
+  <property name="test.failonerror"        value="true"/>
+
+  <!-- The test runner to execute -->
+  <property name="test.runner"             value="junit.textui.TestRunner"/>
+
+
+<!-- ========== Executable Targets ======================================== -->
+
+
+    <target name="all" depends="clean,test,jar,javadoc-jar,source-jar" 
description="Clean, test, compile and create Jars"/>
+
+    <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} 
--------"/>
+        <mkdir dir="${build.home}"/>
+        <mkdir dir="${build.home}/classes"/>
+        <mkdir dir="${build.home}/tests"/>
+    </target>
+
+    <!-- ========== Compile ========================================== -->
+    <target name="compile" depends="init" description="Compile">
+        <javac  srcdir="${source.home}"
+               destdir="${build.home}/classes"
+                 source="${compile.source}"
+                 target="${compile.target}"
+                  debug="${compile.debug}"
+            deprecation="${compile.deprecation}"
+               optimize="${compile.optimize}">
+          <classpath refid="compile.classpath"/>
+        </javac>
+    </target>
+
+    <!-- ========== Unit Tests ========================================= -->
+    <target name="compile.tests" depends="compile" description="Compile unit 
test cases">
+        <javac  srcdir="${test.home}/java"
+               destdir="${build.home}/tests"
+                 debug="${compile.debug}"
+           deprecation="${compile.deprecation}"
+              optimize="${compile.optimize}">
+            <classpath refid="test.classpath"/>
+        </javac>
+        <copy todir="${build.home}/tests" filtering="on">
+            <fileset dir="${test.home}/java">
+              <include name="**/*.xml"/>
+            </fileset>
+        </copy>
+    </target>
+
+    <target name="test" depends="compile.tests" description="Run all unit test 
cases">
+        <echo message="Running unit tests ..."/>
+        <mkdir dir="${build.home}/test-reports"/>
+        <junit printsummary="true" showoutput="true" fork="yes" 
haltonfailure="${test.failonerror}">
+            <classpath refid="test.classpath"/>
+            <formatter type="plain" usefile="true" />
+            <!-- If test.entry is defined, run a single test, otherwise run 
all valid tests -->
+            <test name="${test.entry}" todir="${build.home}/test-reports" 
if="test.entry"/>
+            <batchtest fork="yes" todir="${build.home}/test-reports" 
unless="test.entry">
+                <fileset dir="${test.home}/java">
+                    <include name="**/*TestCase.java"/>
+                    <!--exclude name="**/Abstract*Test.java"/-->
+                </fileset>
+            </batchtest>
+        </junit>
+    </target>
+
+
+    <!-- ========== JavaDocs ========================================= -->
+    <target name="javadoc" depends="compile" description="Create component 
Javadoc documentation">
+        <mkdir dir="${build.home}"/>
+        <mkdir dir="${build.home}/apidocs"/>
+        <tstamp>
+            <format property="current.year" pattern="yyyy"/>
+        </tstamp>
+        <javadoc sourcepath="${source.home}" 
+                 destdir="${build.home}/apidocs" 
+                 
overview="${source.home}/org/apache/commons/${component.name}/overview.html" 
+                 packagenames="org.apache.commons.*" 
+                 excludepackagenames="${javadoc.excludepackagenames}" 
+                 author="false" 
+                 version="true" 
+                 doctitle="&lt;h1&gt;${component.title} 
${component.version}&lt;/h1&gt;"
+                 windowtitle="Lang ${component.version}" 
+                 bottom="${component.title} &amp;copy; 2001-${current.year} - 
Apache Software Foundation" 
+                 use="true" 
+                 link="${jdk.javadoc}" 
+                 source="${compile.source}">
+            <classpath refid="compile.classpath"/>
+        </javadoc>
+    </target>
+
+    <!-- ========== Jar Targets ========================================= -->
+    <target name="jar" depends="compile" description="Create jar">
+        <jar jarfile="${build.home}/${final.name}.jar">
+            <manifest>
+                <attribute name="Specification-Title"      
value="${component.title}"/>
+                <attribute name="Specification-Version"    
value="${component.version}"/>
+                <attribute name="Specification-Vendor"     value="The Apache 
Software Foundation"/>
+                <attribute name="Implementation-Title"     
value="${component.title}"/>
+                <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="${compile.source}"/>
+                <attribute name="X-Compile-Target-JDK" 
value="${compile.target}"/>
+            </manifest>
+            <fileset dir="${build.home}/classes">
+                <include name="**/*.class"/>
+            </fileset>
+            <fileset dir="${basedir}">
+                <include name="LICENSE.txt"/>
+                <include name="NOTICE.txt"/>
+            </fileset>
+        </jar>
+    </target>
+
+    <target name="javadoc-jar" depends="javadoc" description="Create JavaDoc 
jar">
+        <jar jarfile="${build.home}/${final.name}-javadoc.jar">
+            <manifest>
+                <attribute name="Specification-Title"      
value="${component.title} API"/>
+                <attribute name="Specification-Version"    
value="${component.version}"/>
+                <attribute name="Specification-Vendor"     value="The Apache 
Software Foundation"/>
+                <attribute name="Implementation-Title"     
value="${component.title} API"/>
+                <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="${build.home}/apidocs"/>
+            <fileset dir="${basedir}">
+                <include name="LICENSE.txt"/>
+                <include name="NOTICE.txt"/>
+            </fileset>
+        </jar>
+    </target>
+
+    <target name="source-jar" depends="init" description="Create JavaDoc jar">
+        <jar jarfile="${build.home}/${final.name}-sources.jar">
+            <manifest>
+                <attribute name="Specification-Title"      
value="${component.title} Source"/>
+                <attribute name="Specification-Version"    
value="${component.version}"/>
+                <attribute name="Specification-Vendor"     value="The Apache 
Software Foundation"/>
+                <attribute name="Implementation-Title"     
value="${component.title} 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="NOTICE.txt"/>
+            </fileset>
+        </jar>
+    </target>
+      
+</project>
+


Reply via email to