forked from pruivo/IspnPerfTest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
193 lines (154 loc) · 6.76 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<?xml version="1.0"?>
<project name="IspnPerfTest" default="compile" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<description>
Ant/ivy based build.xml file for IsnPerfTest. Needs ant to run
</description>
<property name="version" value="1.0.0"/>
<property name="root.dir" value="${basedir}"/>
<property name="src.dir" value="${root.dir}/src"/>
<property name="compile.dir" value="${root.dir}/classes"/>
<property name="lib.dir" value="${root.dir}/lib"/>
<property name="dist.dir" value="${root.dir}/dist"/>
<property name="tmp.dir" value="${root.dir}/tmp"/>
<property name="conf.dir" value="${root.dir}/conf"/>
<property name="bin.dir" value="${root.dir}/bin"/>
<property name="ivy.version" value="2.5.0" />
<path id="jg.classpath">
<pathelement location="${compile.dir}"/>
<pathelement location="${conf.dir}"/>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<target name="check-lib-exists">
<available file="${lib.dir}" type="dir" property="lib.dir.exists"/>
</target>
<target name="check-ivy-exists">
<mkdir dir="${lib.dir}"/>
<pathconvert property="ivy.exists" pathsep=" " setonempty="false">
<path>
<fileset dir="${lib.dir}" includes="ivy*.jar" />
</path>
</pathconvert>
</target>
<target name="check-jars-exist">
<mkdir dir="${lib.dir}"/>
<pathconvert property="jars.exist" pathsep=" " setonempty="false">
<path>
<fileset dir="${lib.dir}" excludes="ivy*.jar" />
</path>
</pathconvert>
</target>
<target name="get-ivy" description="Fetches ivy from a maven repo" depends="check-ivy-exists" unless="ivy.exists">
<get src="https://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar"
dest="${lib.dir}" usetimestamp="true"/>
</target>
<target name="retrieve" depends="check-jars-exist,get-ivy,define-ivy-task" unless="jars.exist"
description="Retrieves all dependent libs defined in ivy.xml unless already present">
<ivy:resolve file="ivy.xml"/>
<ivy:retrieve type="jar,bundle" />
<!-- Move byteman-x.y.z.jar to byteman.jar (needed by -javaagent:byteman.jar in byteman tests) -->
<move todir="${lib.dir}">
<fileset dir="${lib.dir}">
<include name="byteman-*.jar"/>
<exclude name="byteman-bmunit-*.jar"/>
<exclude name="byteman-install-*.jar"/>
<exclude name="byteman-submit-*.jar"/>
</fileset>
<globmapper from="byteman*.jar" to="byteman.jar"/>
</move>
</target>
<target name="retrieve-sources" depends="define-ivy-task" unless="jars.exist"
description="Retrieves the source JARs for the libs defined in ivy.xml">
<ivy:resolve file="ivy.xml"/>
<ivy:retrieve type="source" />
</target>
<target name="retrieve-coh" depends="define-ivy-task"
description="Retrieves the Coherence lib defined in ivy-coh.xml unless already present">
<ivy:resolve file="ivy-coh.xml"/>
<ivy:retrieve type="jar,bundle,source" />
</target>
<target name="define-ivy-task">
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpathref="jg.classpath"/>
</target>
<target name="prepare" depends="retrieve">
<property environment="env"/>
<mkdir dir="${compile.dir}"/>
</target>
<target name="compile" depends="prepare" description="Compiles all Java files">
<javac destdir="${compile.dir}"
source="1.8"
target="1.8"
classpathref="jg.classpath"
includeantruntime="false"
debug="on"
deprecation="off"
optimize="off"
listfiles="false"
excludes="org/cache/impl/coh/Coherence*">
<src path="${src.dir}"/>
</javac>
</target>
<target name="compile-coh" depends="compile,retrieve-coh" description="Compiles all Java files plus the coherence classes">
<javac destdir="${compile.dir}"
source="1.8"
target="1.8"
classpathref="jg.classpath"
includeantruntime="false"
debug="on"
deprecation="off"
optimize="off"
listfiles="false"
includes="org/cache/impl/coh/**">
<src path="${src.dir}"/>
</javac>
</target>
<target name="jar"
description="Compiles and creates JARs in ./dist"
depends="IspnPerfTest.jar">
</target>
<target name="IspnPerfTest.jar"
description="Creates the JAR (includes everything)"
depends="clean">
<mkdir dir="${dist.dir}"/>
<xmlproperty file="${ant.file}" collapseAttributes="true" prefix="bnd"/>
<property name="-savemanifest" value="${conf.dir}/MANIFEST.MF"/>
<property name="-output" value="${conf.dir}"/>
<jar destfile="${dist.dir}/jgroups-${version}.jar"
basedir="${compile.dir}"
manifest="${conf.dir}/MANIFEST.MF"
includes="org/jgroups/**">
<fileset dir="${conf.dir}" includes="*.dtd, *.xml, jg-messages*.properties" excludes="*-service.xml"/>
<fileset dir="${compile.dir}/schema">
<include name="*.xsd"/>
</fileset>
<fileset dir="${root.dir}">
<include name="INSTALL.html"/>
<include name="LICENSE"/>
<include name="README"/>
</fileset>
<fileset dir="${lib.dir}">
<include name="licenses/thirdparty*"/>
</fileset>
</jar>
</target>
<target name="clean"
description="Removes all class files and ./dist">
<delete dir="${compile.dir}" failonerror="false"/>
<delete dir="${dist.dir}" failonerror="false"/>
<delete dir="${tmp.dir}" failonerror="false"/>
<delete dir="${root.dir}/test-output" failonerror="false"/>
<delete dir="${root.dir}/target" failonerror="false"/>
<delete file="${root.dir}/velocity.log*" failonerror="false"/>
<delete file="${conf.dir}/MANIFEST.MF" failonerror="false"/>
<delete>
<fileset dir="${root.dir}" defaultexcludes="no">
<include name="**/*~"/>
</fileset>
</delete>
</target>
<target name="clean-all" depends="clean" description="Also removes lib">
<delete dir="${lib.dir}" failonerror="false"/>
</target>
</project>