-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
164 lines (147 loc) · 6.4 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
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
<?xml version="1.0"?>
<project name="caliper" default="install">
<!-- can be overridden at the command line with -Dversion=
or in IDEA, in the ant properties dialog -->
<property name="version" value="0.0"/> <!-- subversion revision? -->
<property name="frameworkclasses" value="build/classes/framework"/>
<property name="testclasses" value="build/classes/test"/>
<property name="installroot" value="build/caliper-${version}"/>
<property name="javadocroot" value="${installroot}/docs/api"/>
<property name="allocation" value="lib/allocation.jar"/>
<property name="jsr305" value="lib/jsr305.jar"/>
<property name="guava" value="lib/guava-r09.jar"/>
<property name="gson" value="lib/gson.jar"/>
<path id="dependencies">
<pathelement location="${allocation}"/>
<pathelement location="${guava}"/>
<pathelement location="${gson}"/>
<pathelement location="${jsr305}"/>
</path>
<path id="testdependencies">
<path refid="dependencies"/>
<pathelement location="${frameworkclasses}"/>
<pathelement location="lib/junit.jar"/>
</path>
<target name="compile"
description="Compile all Java source code">
<mkdir dir="${frameworkclasses}"/>
<javac srcdir="caliper/src/main/java"
includes="com/**"
destdir="${frameworkclasses}"
debug="on"
source="1.5"
target="1.5"
includeantruntime="false"
classpathref="dependencies">
<compilerarg value="-Xlint"/>
<!--compilerarg value="-Werror"/-->
</javac>
<mkdir dir="${testclasses}"/>
<javac srcdir="caliper/src/test/java"
debug="on"
destdir="${testclasses}"
source="1.5"
target="1.5"
includeantruntime="false">
<compilerarg value="-Xlint"/>
<!--compilerarg value="-Werror"/-->
<classpath>
<path refid="testdependencies"/>
</classpath>
</javac>
</target>
<target name="test"
depends="compile"
description="Run unit tests">
<junit fork="true" printsummary="true" haltonfailure="true">
<assertions><enable/></assertions>
<classpath>
<pathelement location="${testclasses}"/>
<path refid="testdependencies"/>
</classpath>
<batchtest>
<fileset dir="${testclasses}" includes="**/*Test.class"/>
</batchtest>
</junit>
</target>
<target name="buildjar"
depends="compile"
description="Build JAR archive of caliper framework">
<mkdir dir="${installroot}/lib"/>
<taskdef name="jarjar"
classname="com.tonicsystems.jarjar.JarJarTask"
classpath="lib/jarjar-1.0rc8.jar"/>
<jarjar jarfile="${installroot}/lib/caliper-${version}.jar">
<fileset dir="${frameworkclasses}"/>
<zipfileset src="${guava}"/>
<zipfileset src="${gson}"/>
<rule pattern="com.google.common.**" result="com.google.caliper.internal.guava.@1"/>
<rule pattern="com.google.gson.**" result="com.google.caliper.internal.gson.@1"/>
<keep pattern="com.google.caliper.**"/>
<!-- include some files for GWT's benefit -->
<zipfileset dir="caliper/src/main/java">
<!-- Adding a file? Don't forget to update CaliperCore.gwt.xml! -->
<include name="com/google/caliper/LinearTranslation.java"/>
<include name="com/google/caliper/Environment.java"/>
<include name="com/google/caliper/Run.java"/>
<include name="com/google/caliper/Measurement.java"/>
<include name="com/google/caliper/MeasurementSet.java"/>
<include name="com/google/caliper/ScenarioResult.java"/>
<include name="com/google/caliper/MeasurementType.java"/>
<include name="com/google/caliper/Scenario.java"/>
</zipfileset>
<zipfileset dir="caliper/src/main/resources">
<include name="CaliperCore.gwt.xml" />
</zipfileset>
</jarjar>
</target>
<target name="javadoc"
description="Generate API documentation to ${javadocroot}">
<delete dir="${javadocroot}"/> <!-- TODO: figure out how to make this more incremental -->
<mkdir dir="${javadocroot}"/>
<javadoc packagenames="com.google.caliper"
destdir="${javadocroot}"
use="true"
author="true"
protected="true"
windowtitle="Caliper ${version}">
<sourcepath>
<pathelement location="caliper/src/main/java"/>
</sourcepath>
<classpath refid="dependencies"/>
<link href="http://guava-libraries.googlecode.com/svn/trunk/javadoc/"/>
<link href="http://java.sun.com/javase/6/docs/api"/>
</javadoc>
</target>
<target name="install" depends="buildjar, javadoc"
description="Create a complete installation tree in ./build/caliper-*">
<mkdir dir="${installroot}"/>
<zip zipfile="${installroot}/src-${version}.zip">
<fileset dir="caliper/src/main/java"/>
</zip>
<copy toDir="${installroot}" file="COPYING"/>
<copy toDir="${installroot}" file="scripts/caliper">
<filterset>
<filter token="VERSION" value="${version}"/>
</filterset>
</copy>
<copy toDir="${installroot}/lib" file="lib/allocation.jar"/>
<chmod perm="ugo=rx" file="${installroot}/caliper"/>
</target>
<target name="dist"
depends="install"
description="Create a zipped distribution for upload to Google Code">
<zip destfile="build/caliper-${version}.zip">
<zipfileset dir="build/caliper-${version}"
excludes="caliper"
prefix="caliper-${version}"/>
<zipfileset file="build/caliper-${version}/caliper"
prefix="caliper-${version}"
filemode="555"/>
</zip>
</target>
<target name="clean"
description="Remove all generated files.">
<delete dir="build"/>
</target>
</project>