• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0"?>
2
3<project name="vogar" default="jar">
4    <property file="local.properties" />
5
6    <!-- can be overridden at the command line with -Dversion=
7         or in IDEA, in the ant properties dialog -->
8    <property name="version" value="0.0"/> <!-- subversion revision? -->
9
10    <property name="installroot" value="build/vogar-${version}"/>
11    <property name="javadocroot" value="${installroot}/docs/api"/>
12    <property name="caliper" value="lib/caliper.jar"/>
13    <property name="gson" value="lib/gson-1.7.1.jar"/>
14    <property name="guava" value="lib/guava.jar"/>
15    <property name="kxml2" value="lib/kxml-libcore-20110123.jar"/>
16    <property name="android" value="${android.platform.dir}/android.jar"/>
17    <property name="mockito" value="lib/mockito-all-1.8.5.jar"/>
18
19    <path id="dependencies">
20        <pathelement location="${caliper}"/>
21        <pathelement location="${gson}"/>
22        <pathelement location="${guava}"/>
23        <pathelement location="${kxml2}"/>
24        <pathelement location="${android}"/>
25    </path>
26
27    <target name="compile"
28            description="Compile all Java source code">
29        <fail unless="android.platform.dir"
30               message="No android.platform.dir. Create local.properties or put Android tools on your $PATH."/>
31        <mkdir dir="build/classes"/>
32        <javac srcdir="src"
33               includes="**"
34               destdir="build/classes"
35               debug="on"
36               source="1.5"
37               target="1.5"
38               classpathref="dependencies">
39            <compilerarg value="-Xlint"/>
40            <!--compilerarg value="-Werror"/-->
41        </javac>
42    </target>
43
44    <target name="jar"
45            depends="compile"
46            description="Build JAR archive of vogar">
47        <jar destfile="build/vogar.jar" update="true" index="true">
48            <fileset dir="build/classes"/>
49            <zipfileset src="${caliper}"/>
50            <zipfileset src="${gson}"/>
51            <zipfileset src="${guava}"/>
52            <zipfileset src="${kxml2}"/>
53            <fileset dir="resources"/>
54            <manifest>
55                <attribute name="Main-Class" value="vogar.Vogar"/>
56            </manifest>
57        </jar>
58    </target>
59
60    <target name="compiletests"
61            depends="jar"
62            description="Compile all Java test code">
63        <mkdir dir="build/test-classes"/>
64        <javac srcdir="test"
65               includes="vogar/**"
66               destdir="build/test-classes"
67               debug="on"
68               source="1.5"
69               target="1.5"
70               classpathref="dependencies">
71            <compilerarg value="-Xlint"/>
72            <!--compilerarg value="-Werror"/-->
73            <classpath>
74                <pathelement location="build/vogar.jar" />
75                <pathelement location="${mockito}"/>
76            </classpath>
77        </javac>
78    </target>
79
80    <target name="clean"
81            description="Remove all generated files.">
82        <delete dir="build"/>
83    </target>
84
85</project>
86