-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
119 lines (105 loc) · 5.09 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?xml version="1.0"?>
<project name="TestEnough" basedir="." default="test">
<property name="src.dir" location="${basedir}/src"/>
<property name="test.dir" location="${basedir}/test"/>
<property name="lib.dir" location="${basedir}/lib"/>
<property name="test.lib.dir" location="${basedir}/test-lib"/>
<property name="release.dir" location="${basedir}/release"/>
<property name="target.dir" location="${basedir}/target"/>
<property name="classes.dir" location="${target.dir}/classes"/>
<property name="test.classes.dir" location="${target.dir}/test-classes"/>
<property name="test.reports.dir" location="${target.dir}/reports"/>
<property name="pkg.dir" location="${target.dir}/pkg"/>
<path id="dependencies">
<fileset dir="${lib.dir}" includes="*.jar" id="dependencies.fileset"/>
</path>
<path id="test.dependencies">
<fileset dir="${test.lib.dir}" includes="*.jar" id="test.dependencies.fileset"/>
</path>
<path id="src.classpath">
<pathelement path="${classes.dir}"/>
<path refid="dependencies"/>
</path>
<path id="test.classpath">
<pathelement path="${test.classes.dir}"/>
<path refid="src.classpath"/>
<path refid="test.dependencies"/>
</path>
<target name="init" depends="clean">
<mkdir dir="${classes.dir}"/>
<mkdir dir="${test.classes.dir}"/>
<mkdir dir="${test.reports.dir}"/>
</target>
<target name="clean">
<delete dir="${target.dir}"/>
</target>
<target name="compile" depends="init">
<javac destdir="${classes.dir}" target="1.5" source="1.5" debug="true" includeantruntime="false">
<classpath refid="src.classpath"/>
<src path="${src.dir}"/>
</javac>
</target>
<target name="compile.tests" depends="compile">
<javac destdir="${test.classes.dir}" target="1.5" source="1.5" includeantruntime="false">
<classpath refid="test.classpath"/>
<src path="${test.dir}"/>
</javac>
</target>
<target name="test" depends="compile.tests, compile">
<junit failureproperty="test.failure" printsummary="yes" haltonfailure="true" fork="true">
<classpath refid="test.classpath"/>
<batchtest todir="${test.reports.dir}">
<fileset dir="${test.classes.dir}" includes="**/*Test.class*"/>
<formatter type="plain"/>
</batchtest>
</junit>
</target>
<target name="-load.short.rev">
<exec executable="git" outputproperty="short_rev">
<arg line="describe --always"/>
</exec>
</target>
<target name="pkg" depends="test, -load.short.rev">
<property name="test.enough" value="test-enough"/>
<property name="test.enough.basename" value="${test.enough}-${short_rev}"/>
<property name="test.enough.basepath" value="${pkg.dir}/${test.enough}"/>
<property name="test.enough.jar.path" value="${test.enough.basepath}/${test.enough.basename}.jar"/>
<property name="test.enough.pkg.name" value="${test.enough.basename}.tar.gz"/>
<property name="test.enough.pkg.path" value="${pkg.dir}/${test.enough.basename}.tar"/>
<property name="test.enough.src.jar.name" value="${test.enough.basename}-src.jar"/>
<jar destfile="${test.enough.jar.path}">
<fileset dir="${classes.dir}"/>
<manifest>
<attribute name="Premain-Class" value="testenough.InstrumentingAgent"/>
<attribute name="Sealed" value="true"/>
</manifest>
</jar>
<zip basedir="${src.dir}" destfile="${test.enough.basepath}/${test.enough.src.jar.name}"/>
<copy todir="${test.enough.basepath}/lib">
<fileset dir="${lib.dir}" includes="*.jar"/>
</copy>
<copy todir="${test.enough.basepath}">
<fileset dir="${release.dir}" includes="*"/>
</copy>
<copy todir="${test.enough.basepath}" file="${basedir}/LICENSE"/>
<tar basedir="${pkg.dir}" destfile="${pkg.dir}/${test.enough.pkg.name}" compression="gzip" />
</target>
<target name="dog.food" depends="pkg, -load.short.rev">
<path id="dog.food.classpath">
<pathelement path="${test.classes.dir}"/>
<path refid="src.classpath"/>
<path refid="test.dependencies"/>
<pathelement path="${test.enough.jar.path}"/>
</path>
<typedef classname="testenough.ant.TestsPruner" classpathref="dog.food.classpath" name="prunedTestFiles"/>
<junit failureproperty="test.failure" printsummary="yes" haltonfailure="true" fork="true">
<classpath refid="test.classpath"/>
<jvmarg value="-Xbootclasspath/a:${lib.dir}/commons-io-2.0.1.jar"/>
<jvmarg value="-javaagent:${test.enough.jar.path}=configFilePath:${release.dir}/config.properties=lib:${lib.dir}" />
<batchtest todir="${test.reports.dir}">
<prunedTestFiles dir="${test.classes.dir}" includes="**/*Test.class*"/>
<formatter type="plain"/>
</batchtest>
</junit>
</target>
</project>