| <?xml version="1.0" ?> |
| |
| <project name="libphonenumber" default="compile"> |
| <property name="src.dir" value="src"/> |
| <property name="test.dir" value="test"/> |
| <property name="build.dir" value="build"/> |
| <property name="resources.dir" value="resources"/> |
| <property name="classes.dir" value="${build.dir}/classes"/> |
| <property name="jar.dir" value="${build.dir}/jar"/> |
| <property name="lib.dir" value="lib"/> |
| <property name="report.dir" value="${build.dir}/junitreport"/> |
| |
| <path id="classpath"> |
| <fileset dir="${lib.dir}" includes="**/*.jar"/> |
| </path> |
| <path id="test.classpath"> |
| <pathelement location="${classes.dir}"/> |
| <pathelement location="lib/junit/junit-4.8.1.jar"/> |
| <pathelement location="${jar.dir}/${ant.project.name}-test.jar"/> |
| <fileset dir="${lib.dir}"> |
| <include name="**/*.jar"/> |
| </fileset> |
| </path> |
| |
| <target name="compile" description="Compile Java source."> |
| <mkdir dir="${classes.dir}"/> |
| <javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath"/> |
| <javac srcdir="${test.dir}" destdir="${classes.dir}" classpathref="classpath"/> |
| <javac srcdir="${resources.dir}" destdir="${classes.dir}" classpathref="classpath"/> |
| </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> |
| <fileset dir="${src.dir}"> |
| <include name="**/PhoneNumberMetadataProto"/> |
| </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="${src.dir}"> |
| <include name="**/PhoneNumberMetadataProto"/> |
| </fileset> |
| <fileset dir="${test.dir}"> |
| <include name="**/PhoneNumberMetadataProtoForTesting"/> |
| </fileset> |
| </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}" includes="**/*Test.java"/> |
| </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> |
| |