The Android Open Source Project | adc854b | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 1 | <!-- JUnit build script using ant 1.3 -->
|
| 2 | <project name="junit" default="dist" basedir=".">
|
| 3 | <target name="init">
|
| 4 | <tstamp/>
|
| 5 | <property name="version" value="3.7" />
|
| 6 | <property name="dist" value="junit${version}" />
|
| 7 | <property name="versionfile" value="junit/runner/Version.java" />
|
| 8 | <property name="zipfile" value="${dist}.zip" />
|
| 9 | </target>
|
| 10 |
|
| 11 | <target name="versiontag" depends="init">
|
| 12 | <filter token="version" value="${version}" />
|
| 13 | <copy
|
| 14 | file="${versionfile}"
|
| 15 | tofile="${versionfile}tmp"
|
| 16 | filtering="on"
|
| 17 | />
|
| 18 | <move file="${versionfile}tmp" tofile="${versionfile}" />
|
| 19 | </target>
|
| 20 |
|
| 21 | <target name="build" depends="versiontag">
|
| 22 | <javac
|
| 23 | srcdir="."
|
| 24 | destdir="."
|
| 25 | debug="on"
|
| 26 | />
|
| 27 | </target>
|
| 28 |
|
| 29 | <target name="dist" depends="build">
|
| 30 | <delete dir="${dist}" />
|
| 31 | <mkdir dir="${dist}" />
|
| 32 | <jar
|
| 33 | jarfile="${dist}/src.jar"
|
| 34 | basedir="."
|
| 35 | excludes="${dist}/src.jar, junit/tests/**, junit/samples/**, **/*.class, doc/**, README.html, build.xml"
|
| 36 | />
|
| 37 | <jar
|
| 38 | jarfile="${dist}/junit.jar"
|
| 39 | basedir="."
|
| 40 | excludes="${dist}/junit.jar, junit/tests/**, junit/samples/**, **/*.java, doc/**, README.html, jar-manifest.txt"
|
| 41 | />
|
| 42 | <copy todir="${dist}/junit/samples">
|
| 43 | <fileset dir="junit/samples" />
|
| 44 | </copy>
|
| 45 | <copy todir="${dist}/junit/tests">
|
| 46 | <fileset dir="junit/tests" />
|
| 47 | </copy>
|
| 48 | <delete file="${dist}/junit/tests/test.jar"/>
|
| 49 | <jar
|
| 50 | jarfile="${dist}/junit/tests/test.jar"
|
| 51 | basedir="."
|
| 52 | includes="junit/tests/LoadedFromJar.class"
|
| 53 | />
|
| 54 | <mkdir dir="${dist}/javadoc" />
|
| 55 | <javadoc
|
| 56 | sourcepath="."
|
| 57 | packagenames="junit.framework.*, junit.extensions.*"
|
| 58 | destdir="${dist}/javadoc"
|
| 59 | author="false"
|
| 60 | version="false"
|
| 61 | use="false"
|
| 62 | windowtitle="JUnit API"
|
| 63 | />
|
| 64 | <copy todir="${dist}/doc">
|
| 65 | <fileset dir="doc"/>
|
| 66 | </copy>
|
| 67 | <copy file="README.html" tofile="${dist}/README.html" />
|
| 68 |
|
| 69 | <java classname="junit.textui.TestRunner" fork="yes">
|
| 70 | <arg value="junit.samples.AllTests" />
|
| 71 | <classpath>
|
| 72 | <pathelement location="${dist}" />
|
| 73 | <pathelement location="${dist}/junit.jar" />
|
| 74 | </classpath>
|
| 75 | </java>
|
| 76 | </target>
|
| 77 |
|
| 78 | <target name="zip">
|
| 79 | <!-- !!! hard code names, variable substitution doesn't work !!! -->
|
| 80 | <zip
|
| 81 | zipfile="junit3.6.zip"
|
| 82 | basedir="."
|
| 83 | includes="junit3.6/**"
|
| 84 | />
|
| 85 | </target>
|
| 86 |
|
| 87 | <target name="awtui" depends="dist">
|
| 88 | <java classname="junit.awtui.TestRunner" fork="yes">
|
| 89 | <arg value="junit.samples.AllTests" />
|
| 90 | <classpath>
|
| 91 | <pathelement location="${dist}" />
|
| 92 | <pathelement location="${dist}/junit.jar" />
|
| 93 | </classpath>
|
| 94 | </java>
|
| 95 | </target>
|
| 96 |
|
| 97 | <target name="swingui" depends="dist">
|
| 98 | <java classname="junit.swingui.TestRunner" fork="yes">
|
| 99 | <arg value="junit.samples.AllTests" />
|
| 100 | <classpath>
|
| 101 | <pathelement location="${dist}" />
|
| 102 | <pathelement location="${dist}/junit.jar" />
|
| 103 | </classpath>
|
| 104 | </java>
|
| 105 | </target>
|
| 106 | </project>
|