-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.xml
More file actions
171 lines (152 loc) · 6.28 KB
/
build.xml
File metadata and controls
171 lines (152 loc) · 6.28 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<project default="test">
<property name="version" value="0.3"/>
<!--
<property name="build.compiler" value="gcj"/>
-->
<target name="clean">
<delete dir="build"/>
</target>
<path id="classpath">
<fileset dir="src/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="compile">
<mkdir dir="build/classes"/>
<javac srcdir="src" destdir="build/classes" debug="on"
source="1.5" target="1.5" deprecation="on">
<classpath refid="classpath"/>
</javac>
</target>
<!-- Although we use javadoc syntax for the benefit of tools like Eclipse and IDEA,
we generate the actual documentation with doxygen. javadoc/gjdoc provide very little help
for things like @internal, so going with doxygen seems nicer than writing
a bunch of custom doclets. -->
<!-- TODO: Somehow get ${version} into the generated documentation -->
<target name="doc" description="regenerate documentation from source">
<mkdir dir="build/doc"/>
<exec executable="doxygen">
<arg value="doc/Doxyfile"/>
</exec>
</target>
<path id="test.classpath">
<path refid="classpath"/>
<fileset dir="test/lib">
<include name="**/*.jar"/>
</fileset>
<pathelement location="build/classes"/>
</path>
<path id="runtest.classpath">
<path refid="test.classpath"/>
<pathelement location="build/test-classes"/>
</path>
<target name="compile-tests" depends="compile">
<mkdir dir="build/test-classes"/>
<javac srcdir="test" destdir="build/test-classes"
deprecation="on" source="1.5" target="1.5">
<classpath refid="test.classpath"/>
</javac>
</target>
<target name="test" depends="compile-tests" description="run unit tests">
<junit haltonfailure="true" haltonerror="true">
<classpath refid="runtest.classpath"/>
<formatter usefile="false" type="brief"/>
<batchtest>
<fileset dir="test">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- Profile a test with JIP ( http://jiprof.sourceforge.net/ ). -->
<target name="profile-test" depends="compile-tests"
description="Profile tests - may require manual editing of PerformanceTest.java">
<junit haltonfailure="true" haltonerror="true">
<classpath refid="runtest.classpath"/>
<jvmarg value="-javaagent:test/lib/jiprof-1.0.7.jar"/>
<jvmarg value="-Dprofile.properties=profile.properties"/>
<formatter usefile="false" type="brief"/>
<batchtest>
<fileset dir="test">
<include name="**/PerformanceTest.java"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- A work in progress. In particular, I think we need to figure out
how to instrument mayfly without instrumenting all the jars (or, I
suppose, the tests). Or maybe that isn't the right fix. But the
point is that linking is sometimes prohibitively slow (to the point
that it didn't finish on my machine despite causing much swapping). -->
<target name="gprof-link" depends="compile-tests">
<exec executable="gcj">
<arg value="-pg" />
<arg value="-g" />
<arg value="--main=net.sourceforge.mayfly.acceptance.PerformanceTest" />
<arg value="-I" />
<arg value="build/classes" />
<arg value="-I" />
<arg value="build/test-classes" />
<!-- There's probably a way to just refer to the path
runtest.classpath which is the intent, but until I figure out
the ant magic for that... -->
<!--<arg value="- -classpath=src/lib/commons-collections-3.1.jar:src/lib/commons-lang-2.1.jar:src/lib/joda-time-1.3.jar:test/lib/junit.jar:build/classes:build/test-classes" />-->
<arg value="-o" />
<arg value="build/profiled-executable" />
<arg value="build/test-classes/net/sourceforge/mayfly/acceptance/PerformanceTest.class" />
<!--
<arg value="src/lib/commons-collections-3.1.jar" />
<arg value="src/lib/commons-lang-2.1.jar" />
<arg value="src/lib/joda-time-1.3.jar" />
-->
<arg value="test/lib/junit.jar" />
</exec>
</target>
<target name="gprof" depends="gprof-link"
description="Run PerformanceTest#main and generate a gprof profile">
<exec executable="build/profiled-executable"></exec>
<exec executable="gprof"></exec>
</target>
<target name="jar" depends="compile,test"
description="Build the Mayfly jar">
<!-- TODO: Should put ${version} into the META-INF/MANIFEST.MF file
like Hibernate does. -->
<jar jarfile="build/mayfly-${version}.jar">
<fileset dir="build/classes"/>
</jar>
</target>
<target name="dist" depends="clean,jar,doc"
description="Build .zip file for distribution">
<zip destfile="build/mayfly-${version}-src-ide.zip">
<fileset dir="src">
<include name="net/**" />
</fileset>
</zip>
<zip destfile="build/mayfly-${version}.zip">
<fileset dir="build">
<include name="mayfly-${version}.jar"/>
<include name="mayfly-${version}-src-ide.zip"/>
<include name="doc/**"/>
</fileset>
<fileset dir="src/lib">
<include name="*.jar"/>
</fileset>
<fileset dir=".">
<include name="DESCRIPTION.txt"/>
<include name="IDEAS.txt"/>
<include name="LICENSE-2.0.txt"/>
</fileset>
</zip>
<zip destfile="build/mayfly-${version}-src.zip">
<fileset dir=".">
<include name="src/**"/>
<include name="test/**"/>
</fileset>
<fileset dir=".">
<include name="DESCRIPTION.txt"/>
<include name="IDEAS.txt"/>
<include name="LICENSE-2.0.txt"/>
</fileset>
</zip>
</target>
</project>