Moved from old Ant style build to Maven build. Maven generated build.xml file there for Gump, so need to remember to keep it synced every now and then.


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/io/trunk@140420 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/build.properties.sample b/build.properties.sample
deleted file mode 100644
index 7774089..0000000
--- a/build.properties.sample
+++ /dev/null
@@ -1,8 +0,0 @@
-# build.properties.sample - Sample build.properties for "io"
-
-# Base properties for expansion below
-commons.home=../../jakarta-commons
-junit.home=/usr/local/junit3.7
-
-# External packages
-junit.jar=${junit.home}/junit.jar
diff --git a/build.xml b/build.xml
index f234217..61fd8b1 100644
--- a/build.xml
+++ b/build.xml
@@ -1,275 +1,171 @@
-<project name="IO" default="compile" basedir=".">
+<?xml version="1.0" encoding="UTF-8"?>
 
+<!--build.xml generated by maven from project.xml version SNAPSHOT
+  on date November 23 2003, time 1432-->
 
-<!--
-        "IO" component of the Jakarta Commons Subproject
-        $Id: build.xml,v 1.12 2003/08/21 18:59:26 jeremias Exp $
--->
-
-
-<!-- ========== Initialize Properties ===================================== -->
-
-
-  <property file="build.properties"/>                <!-- Component local   -->
-  <property file="../build.properties"/>             <!-- Commons local     -->
-  <property file="${user.home}/build.properties"/>   <!-- User local        -->
-
-
-<!-- ========== External Dependencies ===================================== -->
-
-
-  <!-- The directory containing your binary distribution of JUnit,
-       version 3.7 or later -->
-  <property name="junit.home"              value="/usr/local/junit3.7"/>
-
-
-<!-- ========== Derived Values ============================================ -->
-
-
-  <!-- The pathname of the "junit.jar" JAR file -->
-  <property name="junit.jar"               value="${junit.home}/junit.jar"/>
-
-
-<!-- ========== Component Declarations ==================================== -->
-
-
-  <!-- The name of this component -->
-  <property name="component.name"          value="io"/>
-
-  <!-- The primary package name of this component -->
-  <property name="component.package"       value="org.apache.commons.io"/>
-
-  <!-- The title of this component -->
-  <property name="component.title"         value="I/O Utilities"/>
-
-  <!-- The current version number of this component -->
-  <property name="component.version"       value="1.0-dev"/>
-
-  <!-- The base directory for compilation targets -->
-  <property name="build.home"              value="target"/>
-
-  <!-- The base directory for component configuration files -->
-  <property name="conf.home"               value="src/conf"/>
-
-  <!-- The base directory for distribution targets -->
-  <property name="dist.home"               value="dist"/>
-
-  <!-- The base directory for component sources -->
-  <property name="source.home"             value="src/java"/>
-
-  <!-- The base directory for unit test sources -->
-  <property name="test.home"               value="src/test"/>
-
-  <!-- Test data directory -->
-  <property name="data.test"               value="data/test"/>
-
-<!-- ========== Compiler Defaults ========================================= -->
-
-
-  <!-- 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="true"/>
-
-  <!-- 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"/>
-  </path>
-
-
-<!-- ========== Test Execution Defaults =================================== -->
-
-
-  <!-- Construct unit test classpath -->
-  <path id="test.classpath">
-    <pathelement location="${build.home}/classes"/>
-    <pathelement location="${build.home}/tests"/>
-    <pathelement location="${junit.jar}"/>
-  </path>
-
-  <!-- Should all tests fail if one does? -->
-  <property name="test.failonerror"        value="false"/>
-
-  <!-- The test runner to execute -->
-  <property name="test.runner"             value="junit.textui.TestRunner"/>
-
-
-<!-- ========== Executable Targets ======================================== -->
-
-
-  <target name="init"
-   description="Initialize and evaluate conditionals">
-    <echo message="-------- ${component.name} ${component.version} --------"/>
-    <filter  token="name"                  value="${component.name}"/>
-    <filter  token="package"               value="${component.package}"/>
-    <filter  token="version"               value="${component.version}"/>
+<project default="jar" name="jakarta-commons-io" 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="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="jakarta-commons-io-SNAPSHOT">
+  </property>
+  <target name="init" description="o Initializes some properties">
+    <mkdir dir="${libdir}">
+    </mkdir>
+    <condition property="noget">
+      <equals arg2="only" arg1="${build.sysclasspath}">
+      </equals>
+    </condition>
   </target>
-
-
-  <target name="prepare" depends="init"
-   description="Prepare build directory">
-    <mkdir dir="${build.home}"/>
-    <mkdir dir="${build.home}/classes"/>
-    <mkdir dir="${build.home}/conf"/>
-    <mkdir dir="${build.home}/tests"/>
-  </target>
-
-
-  <target name="static" depends="prepare"
-   description="Copy static files to build directory">
-    <tstamp/>
-    <copy  todir="${build.home}/conf" filtering="on">
-      <fileset dir="${conf.home}" includes="*.MF"/>
-    </copy>
-  </target>
-
-
-  <target name="compile" depends="static"
-   description="Compile shareable components">
-    <javac  srcdir="${source.home}"
-           destdir="${build.home}/classes"
-             debug="${compile.debug}"
-       deprecation="${compile.deprecation}"
-          optimize="${compile.optimize}">
-      <classpath refid="compile.classpath"/>
+  <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="/Users/hen/java/jakarta/src/jakarta-commons-sandbox/io/src/java">
+        </pathelement>
+      </src>
+      <classpath>
+        <fileset dir="${libdir}">
+          <include name="*.jar">
+          </include>
+        </fileset>
+      </classpath>
     </javac>
-    <copy    todir="${build.home}/classes" filtering="on">
-      <fileset dir="${source.home}" excludes="**/*.java"/>
+    <copy todir="${classesdir}">
+      <fileset dir="/Users/hen/java/jakarta/src/jakarta-commons-sandbox/io">
+        <include name="**/*.properties">
+        </include>
+      </fileset>
     </copy>
-  </target>
-
-
-  <target name="compile.tests" depends="compile"
-   description="Compile unit test cases">
-    <javac  srcdir="${test.home}"
-           destdir="${build.home}/tests"
-             debug="${compile.debug}"
-       deprecation="${compile.deprecation}"
-          optimize="${compile.optimize}">
-      <classpath refid="test.classpath"/>
-    </javac>
-    <copy    todir="${build.home}/tests" filtering="off">
-      <fileset dir="${test.home}" excludes="**/*.java"/>
-    </copy>
-
-    <!-- Copies test data -->
-    <copy todir="${build.home}/tests" filtering="off">
-      <fileset dir="${data.test}"/>
-    </copy>
-
-  </target>
-
-  <target name="clean"
-   description="Clean build and distribution directories">
-    <delete    dir="${build.home}"/>
-    <delete    dir="${dist.home}"/>
-  </target>
-
-
-  <target name="all" depends="clean,compile"
-   description="Clean and compile all components"/>
-
-
-  <target name="javadoc" depends="compile"
-   description="Create component Javadoc documentation">
-    <mkdir      dir="${dist.home}"/>
-    <mkdir      dir="${dist.home}/docs"/>
-    <mkdir      dir="${dist.home}/docs/api"/>
-    <javadoc sourcepath="${source.home}"
-                destdir="${dist.home}/docs/api"
-           packagenames="org.apache.commons.*"
-                 author="true"
-                private="true"
-                version="true"
-               doctitle="&lt;h1&gt;${component.title}&lt;/h1&gt;"
-            windowtitle="${component.title} (Version ${component.version})"
-                 bottom="Copyright (c) 2001-2003 - Apache Software Foundation">
-      <classpath refid="compile.classpath"/>
-      <link href="http://java.sun.com/products/jdk/1.3/docs/api/"/>
-    </javadoc>
-  </target>
-
-
-  <target name="dist" depends="compile,javadoc"
-   description="Create binary distribution">
-    <mkdir      dir="${dist.home}"/>
-    <copy      file="../LICENSE"
-              todir="${dist.home}"/>
-    <copy      file="RELEASE-NOTES.txt"
-              todir="${dist.home}"/>
-    <antcall target="jar"/>
-  </target>
-
-
-  <target name="jar" depends="compile"
-   description="Create jar">
-    <mkdir      dir="${dist.home}"/>
-    <mkdir      dir="${build.home}/classes/META-INF"/>
-    <copy      file="../LICENSE"
-             tofile="${build.home}/classes/META-INF/LICENSE.txt"/>
-    <jar    jarfile="${dist.home}/commons-${component.name}.jar"
-            basedir="${build.home}/classes"
-           manifest="${build.home}/conf/MANIFEST.MF"/>
-  </target>
-
-
-  <target name="install-jar" depends="jar"
-   description="--> Installs jar file in ${lib.repo}">
-    <copy todir="${lib.repo}" filtering="no">
-      <fileset dir="${dist.home}">
-        <include name="commons-${component.name}.jar"/>
+    <copy todir="${testclassesdir}">
+      <fileset dir="/Users/hen/java/jakarta/src/jakarta-commons-sandbox/io/data/test">
       </fileset>
     </copy>
   </target>
-
-
-<!-- ========== Unit Test Targets ========================================= -->
-
-
-  <target name="test"  depends="compile.tests,
-                                test.io
-                               "
-   description="Run all unit test cases">
+  <target name="jar" description="o Create the jar" depends="compile,test">
+    <jar jarfile="target/${final.name}.jar" excludes="**/package.html" basedir="${classesdir}">
+    </jar>
   </target>
-
-<!--
-  <target name="test.io" depends="compile.tests">
-    <echo message="Running IO tests ..."/>
-    <java classname="${test.runner}" fork="yes"
-        failonerror="${test.failonerror}">
-      <arg value="org.apache.commons.io.IOTestCase"/>
-      <classpath refid="test.classpath"/>
-    </java>
+  <target name="clean" description="o Clean up the generated directories">
+    <delete dir="${defaulttargetdir}">
+    </delete>
+    <delete dir="${distdir}">
+    </delete>
   </target>
--->
-  <target name="test.io" depends="compile.tests">
-
-   <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
-
-    <junit printsummary="yes" haltonfailure="${test.failonerror}" fork="yes">
-
-      <formatter type="brief" usefile="false"/>
-      <classpath refid="test.classpath"/>
-
-     <batchtest todir="${build.home}/tests">
-        <fileset dir="${build.home}/tests">
-          <include name="**/test/*TestCase.class"/>
-          <include name="**/*Test.class" />
-          <include name="**/*TestCase.class" />
-          <include name="**/Test*.class" />
-          <include name="**/output/Test*.class" />
-          <exclude name="**/AllTest.class" />
-          <exclude name="**/*$$*Test.class" />
-          <exclude name="**/compress/zip/*.class" />
-          <exclude name="**/compress/tar/*.class" />
-          <exclude name="**/FileBasedTestCase.class" />
+  <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" depends="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>
+        <fileset dir="${libdir}">
+          <include name="*.jar">
+          </include>
+        </fileset>
+        <pathelement path="${testclassesdir}">
+        </pathelement>
+        <pathelement path="${classesdir}">
+        </pathelement>
+      </classpath>
+      <batchtest todir="${testreportdir}">
+        <fileset dir="/Users/hen/java/jakarta/src/jakarta-commons-sandbox/io/src/test">
+          <include name="**/*Test*">
+          </include>
+          <exclude name="**/testtools/**">
+          </exclude>
+          <exclude name="**/compress/**/*Test*">
+          </exclude>
+          <exclude name="**/IOUtilTestCase*">
+          </exclude>
         </fileset>
       </batchtest>
     </junit>
   </target>
-
-</project>
+  <target name="compile-tests" depends="compile">
+    <mkdir dir="${testclassesdir}">
+    </mkdir>
+    <javac destdir="${testclassesdir}" deprecation="true" debug="true" optimize="false" excludes="**/package.html">
+      <src>
+        <pathelement location="/Users/hen/java/jakarta/src/jakarta-commons-sandbox/io/src/test">
+        </pathelement>
+      </src>
+      <classpath>
+        <fileset dir="${libdir}">
+          <include name="*.jar">
+          </include>
+        </fileset>
+        <pathelement path="${classesdir}">
+        </pathelement>
+      </classpath>
+    </javac>
+  </target>
+  <target name="javadoc" description="o Generate javadoc" depends="jar">
+    <mkdir dir="${javadocdir}">
+    </mkdir>
+    <tstamp>
+      <format pattern="2002-yyyy" property="year">
+      </format>
+    </tstamp>
+    <property name="copyright" value="Copyright &amp;copy;  Apache Software Foundation. All Rights Reserved.">
+    </property>
+    <property name="title" value="io SNAPSHOT API">
+    </property>
+    <javadoc use="true" private="true" destdir="${javadocdir}" author="true" version="true" sourcepath="/Users/hen/java/jakarta/src/jakarta-commons-sandbox/io/src/java" packagenames="org.apache.commons.io.*">
+      <classpath>
+        <fileset dir="${libdir}">
+          <include name="*.jar">
+          </include>
+        </fileset>
+        <pathelement location="target/${final.name}.jar">
+        </pathelement>
+      </classpath>
+    </javadoc>
+  </target>
+  <target name="get-deps" unless="noget" depends="init">
+    <get dest="${libdir}/junit-3.8.1.jar" usetimestamp="true" ignoreerrors="true" src="http://www.ibiblio.org/maven/junit/jars/junit-3.8.1.jar">
+    </get>
+    <get dest="${libdir}/junit-3.8.1.jar" usetimestamp="true" ignoreerrors="true" src="http://www.ibiblio.org/maven/junit/jars/junit-3.8.1.jar">
+    </get>
+    <get dest="${libdir}/ant-1.5.jar" usetimestamp="true" ignoreerrors="true" src="http://www.ibiblio.org/maven/ant/jars/ant-1.5.jar">
+    </get>
+    <get dest="${libdir}/ant-optional-1.5.jar" usetimestamp="true" ignoreerrors="true" src="http://www.ibiblio.org/maven/ant/jars/ant-optional-1.5.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