blob: 3c36334b65ce68de036dae0cde68a99b028ebe00 [file] [log] [blame]
<?xml version="1.0" ?>
<project name="libaddressinput" default="compile">
<property name="src.dir" value="src"/>
<property name="test.dir" value="test"/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="testdata.dir" value="../testdata"/>
<property name="testlibs.dir" value="testlibs"/>
<property name="report.dir" value="${build.dir}/junitreport"/>
<path id="classpath">
<fileset dir="${src.dir}" includes="src/com/android/i18n/**"/>
<pathelement location="android.jar"/>
</path>
<path id="test.classpath">
<pathelement location="${classes.dir}"/>
<pathelement location="${jar.dir}/${ant.project.name}-test.jar"/>
<fileset dir="${testlibs.dir}" includes="**/*.jar"/>
</path>
<target name="compile" description="Compile Java source.">
<mkdir dir="${classes.dir}"/>
<!-- AddressWidget*.java must be excluded, as they depend on R.class, which
would be generated by the Android resource compiler. -->
<javac srcdir="${src.dir}/"
encoding="utf-8"
includes="com/android/i18n/**"
excludes="com/android/i18n/addressinput/AddressWidget*.java"
destdir="${classes.dir}"
classpathref="classpath"
includeantruntime="false"
debug="on">
<compilerarg value="-Xlint"/>
</javac>
<javac srcdir="${test.dir}"
excludes="com/android/i18n/addressinput/AddressWidget*.java"
destdir="${classes.dir}"
classpathref="test.classpath"
encoding="utf-8"
includeantruntime="true"
debug="on"/>
</target>
<target name="jar" depends="compile">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}.jar">
<fileset dir="${classes.dir}">
<include name="**/*.class"/>
<exclude name="**/*Test*"/>
</fileset>
</jar>
</target>
<target name="test-jar" depends="compile">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}-test.jar">
<fileset dir="${classes.dir}">
<include name="**/*.class"/>
<exclude name="**/*Test*"/>
</fileset>
<fileset dir="${testdata.dir}" />
</jar>
</target>
<target name="junit" depends="test-jar">
<mkdir dir="${report.dir}"/>
<junit printsummary="yes">
<classpath refid="test.classpath"/>
<formatter type="xml"/>
<batchtest fork="no" todir="${report.dir}">
<fileset dir="${test.dir}">
<include name="**/*Test*"/>
<exclude name="**/AddressWidget*"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="junitreport">
<junitreport todir="${report.dir}">
<fileset dir="${report.dir}" includes="TEST-*.xml"/>
<report todir="${report.dir}"/>
</junitreport>
</target>
<target name="clean" description="Remove generated files.">
<delete dir="${build.dir}"/>
</target>
<target name="clean-build" depends="clean,jar"/>
</project>