1+ <project >
2+ <property name =" target" location =" target" />
3+ <property name =" version-base" value =" 0.1" />
4+ <property name =" version-status" value =" " />
5+ <property name =" version" value =" ${ version-base } ${ version-status } " />
6+ <property name =" dist" value =" truth${ version } " />
7+ <property name =" src" value =" src/main/java" />
8+ <property name =" binjar" value =" truth-${ version } .jar" />
9+ <property name =" testjar" value =" truth-${ version } -tests.jar" />
10+ <property name =" testsrc" location =" src/test/java" />
11+ <property name =" testbin" location =" ${ target } /test/java" />
12+ <property name =" bin" location =" ${ target } /main" />
13+
14+ <macrodef name =" truth_compilation" >
15+ <attribute name =" srcdir" />
16+ <attribute name =" destdir" />
17+ <attribute name =" classpath" />
18+ <sequential >
19+ <mkdir dir =" @{ destdir } " />
20+ <javac
21+ srcdir =" @{ srcdir } "
22+ destdir =" @{ destdir } "
23+ debug =" on"
24+ classpath =" @{ classpath } "
25+ includeantruntime =" false"
26+ target =" 1.5"
27+ >
28+ <compilerarg value =" -Xlint:unchecked" />
29+ <classpath >
30+ <pathelement location =" ../junit/junit4.9b2/junit-4.9b2.jar" />
31+ </classpath >
32+ </javac >
33+ </sequential >
34+ </macrodef >
35+
36+ <macrodef name =" run-tests" >
37+ <element name =" extra-args" implicit =" yes" />
38+ <sequential >
39+ <java classname =" org.junit.runner.JUnitCore" fork =" yes" failonerror =" true" >
40+ <extra-args />
41+ <arg value =" test.org.junit.contrib.truth.AllTests" />
42+ <classpath >
43+ <pathelement location =" ${ dist } " />
44+ <pathelement location =" ${ dist } /${ binjar } " />
45+ <pathelement location =" ${ dist } /${ testjar } " />
46+ <!-- TODO: don't hard-code JUnit version -->
47+ <pathelement location =" ../junit/junit4.9b2/junit-4.9b2.jar" />
48+ </classpath >
49+ </java >
50+ </sequential >
51+ </macrodef >
52+
53+ <target name =" build" >
54+ <truth_compilation srcdir =" ${ src } " destdir =" ${ bin } " classpath =" " />
55+ <truth_compilation srcdir =" ${ testsrc } " destdir =" ${ testbin } " classpath =" ${ bin } " />
56+ </target >
57+
58+ <target name =" jars" depends =" build" >
59+ <mkdir dir =" ${ dist } " />
60+ <jar
61+ jarfile =" ${ dist } /${ binjar } "
62+ basedir =" ${ bin } "
63+ />
64+ <jar
65+ jarfile =" ${ dist } /${ testjar } "
66+ basedir =" ${ testbin } "
67+ />
68+ </target >
69+
70+ <target name =" populate-dist"
71+ depends =" build, jars"
72+ >
73+ </target >
74+
75+ <target name =" dist" depends =" populate-dist" >
76+ <run-tests >
77+ <jvmarg value =" -Dignore.this=ignored" />
78+ </run-tests >
79+ </target >
80+ </project >
81+ <!-- TODO: cheating -->
0 commit comments