-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
executable file
·246 lines (204 loc) · 7.75 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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<?xml version="1.0"?>
<project name="stack-trunk" default="all" basedir=".">
<!-- =================================================================== -->
<!-- Initializes some variables -->
<!-- =================================================================== -->
<property name="project" value="axiom"/>
<property name="home.dir" value="."/>
<property name="build.dir" value="${home.dir}/build"/>
<property name="build.test" value="${build.dir}/test"/>
<property name="lib.dir" value="${home.dir}/lib"/>
<property name="src.dir" value="${home.dir}/src"/>
<property name="src.tests" value="${src.dir}/java/test"/>
<property name="apps.dir" value="${home.dir}/apps"/>
<property name="modules.dir" value="${home.dir}/modules"/>
<property name="jsdoc.dir" value="${home.dir}/doc"/>
<property name="javadoc.dir" value="${home.dir}/javadoc"/>
<property name="utils.dir" value="${home.dir}/utils"/>
<property name="examples.dir" value="${home.dir}/examples"/>
<property name="reports.dir" value="${home.dir}/reports"/>
<property name="axiom-jar.name" value="axiom.jar"/>
<property name="launcher-jar.name" value="launcher.jar"/>
<property name="js-jar.name" value="js.zip"/>
<property name="test.app" value="test"/>
<property name="reports.test" value="${reports.dir}/test"/>
<property environment="env"/>
<path id="classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
<!-- <fileset dir="${env.JAVA_HOME}/lib"> -->
<!-- <include name="tools.jar"/> -->
<!-- </fileset> -->
</path>
<target name="all" depends="build"/>
<target name="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.dir}/classes"/>
</target>
<target name="clean">
<delete file="${home.dir}/${launcher-jar.name}"/>
<delete file="${lib.dir}/${axiom-jar.name}"/>
<delete file="${lib.dir}/${js-jar.name}"/>
<delete dir="${build.dir}"/>
<delete dir="${jsdoc.dir}"/>
<delete dir="${javadoc.dir}"/>
</target>
<target name="build" depends="clean, init">
<antcall target="jar"/>
<antcall target="jsdoc"/>
<antcall target="javadoc"/>
</target>
<target name="compile" depends="init">
<property name="deprecation" value="off"/>
<property name="debug" value="on"/>
<property name="optimize" value="on"/>
<property name="encoding" value="utf-8" />
<javac srcdir="${src.dir}/java"
encoding="${encoding}"
destdir="${build.dir}/classes"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
excludes="${src.dir}/test/**/*Test*.java">
<classpath refid="classpath" />
</javac>
</target>
<target name="jar" depends="compile" description="Packages the JAR file">
<!-- Build axiom.jar-->
<jar jarfile="${lib.dir}/${axiom-jar.name}"
basedir="${build.dir}/classes"
excludes="**/test/**, **/main/launcher/**"/>
<!-- build js.zip -->
<zip compress="false" destfile="${lib.dir}/js.zip"
basedir="${src.dir}/js"/>
<!-- Build launcher.jar -->
<jar jarfile="${home.dir}/${launcher-jar.name}"
basedir="${build.dir}/classes"
includes="**/main/launcher/**"
manifest="${src.dir}/java/axiom/main/launcher/manifest.txt"/>
</target>
<target name="junits" depends="clean,jar">
<mkdir dir="${build.test}"/>
<mkdir dir="${reports.test}"/>
<junit printsummary="yes" haltonfailure="yes">
<classpath>
<pathelement location="${build.test}"/>
<pathelement location="${build.dir}/classes"/>
<path refid="classpath"/>
</classpath>
<formatter type="xml"/>
<batchtest fork="yes" todir="${reports.test}">
<fileset dir="${src.tests}">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="test">
<delete failonerror="false" ><fileset dir="${home.dir}/db" /></delete>
<move file="${apps.dir}/${test.app}/app.properties.test" tofile="${apps.dir}/${test.app}/app.properties"/>
<move todir="${apps.dir}" includeemptydirs="false">
<fileset dir="${apps.dir}" casesensitive="yes">
<exclude name="**/${test.app}/*"/>
<include name="**/app.properties"/>
</fileset>
<mapper type="glob" from="*" to="*.testing"/>
</move>
<antcall target="clean">
<param name="version" value="${java_version}"/>
</antcall>
<antcall target="jar">
<param name="version" value="${java_version}"/>
</antcall>
<antcall target="junits"></antcall>
<java jar="${home.dir}/launcher.jar" fork="true" timeout="150000">
<sysproperty key="file.encoding" value="UTF-8"/>
<sysproperty key="org.apache.lucene.FSDirectory.class" value="org.apache.lucene.store.TransFSDirectory"/>
<arg line="-w 8081 -h ${home.dir}"/>
</java>
<move todir="${apps.dir}" includeemptydirs="false">
<fileset dir="${apps.dir}" casesensitive="yes">
<exclude name="**/${test.app}/*"/>
<include name="**/app.properties.testing"/>
</fileset>
<mapper type="glob" from="*.testing" to="*"/>
</move>
<move file="${apps.dir}/test/app.properties" tofile="${apps.dir}/${test.app}/app.properties.test"/>
</target>
<target name="javadoc">
<javadoc sourcepath="${src.dir}/java"
destdir="${javadoc.dir}"
packagenames="*"
classpathref="classpath"/>
</target>
<target name="jsdoc" depends="compile">
<javadoc
doclet="axiom.util.JSDoclet"
docletpath="${build.dir}/classes/"
sourcepath="${src.dir}/java"
classpathref="classpath">
<packageset dir="${src.dir}/java" defaultexcludes="yes">
<include name="axiom/**"/>
</packageset>
</javadoc>
<java jar="${utils.dir}/jsdoc-toolkit/jsrun.jar" fork="true">
<arg line="${utils.dir}/jsdoc-toolkit/app/run.js -t=${utils.dir}/jsdoc-toolkit/templates/jsdoc/ -d=${jsdoc.dir} alldoc.js ${src.dir}/js/Global"/>
</java>
<delete file="alldoc.js"/>
</target>
<target name="loadtest-start">
<exec executable="./loadtest.sh" spawn="true"/>
<exec executable="sleep">
<arg value="10"/>
</exec>
</target>
<target name="loadtest-stop">
<exec executable="./loadtest-stop.sh"/>
</target>
<target name="loadtest-remote-deploy">
<exec executable="./utils/loadtest-remote-deploy.sh"/>
<exec executable="sleep">
<arg value="10"/>
</exec>
</target>
<target name="loadtest-remote-cleanup">
<exec executable="./loadtest.sh"/>
</target>
<target name="loadtest-tsung-cached" >
<exec executable="utils/tsung_ctl.sh">
<env key="OUTPUT_PREFIX" value="tsung-cached"/>
<env key="TSUNG_LOG" value="tsunglog-cached"/>
<env key="TSUNG_TIME" value="4"/>
<env key="TSUNG_CONFIG" value="loadtesting/tsung/tsung-cached.xml"/>
</exec>
</target>
<target name="loadtest-tsung-notcached" >
<exec executable="utils/tsung_ctl.sh">
<env key="OUTPUT_PREFIX" value="tsung-notcached"/>
<env key="TSUNG_LOG" value="tsunglog-notcached"/>
<env key="TSUNG_TIME" value="4"/>
<env key="TSUNG_CONFIG" value="loadtesting/tsung/tsung-notcached.xml"/>
</exec>
</target>
<target name="loadtest-jmeter-tests">
<copy file="loadtesting/jmeter/tests.jmx" tofile="jmeter_conf.jmx"/>
<exec executable="utils/jmeter_config.sh">
<arg value="jmeter_conf.jmx"/>
</exec>
<exec executable="/opt/jmeter/bin/jmeter">
<arg value="-n"/>
<arg line="-t jmeter_conf.jmx"/>
<arg line="-p /opt/jmeter/bin/jmeter.properties"/>
<arg line="-l loadtesting/jmeter.jtl"/>
<arg line="-j loadtesting/jmeter.log"/>
<arg value="-r"/>
</exec>
</target>
<target name="loadtest-tsung" depends="loadtest-start, loadtest-tsung-notcached, loadtest-tsung-cached, loadtest-stop">
</target>
<target name="loadtest-jmeter" depends="loadtest-start, loadtest-jmeter-tests, loadtest-stop">
</target>
<target name="loadtest-all" depends="loadtest-jmeter, loadtest-tsung">
</target>
</project>