[203f99]: build.xml Maximize Restore History

Download this file

build.xml    282 lines (250 with data), 9.7 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
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<?xml version='1.0'?>
<project name="marauroa" default="dist" basedir="." xmlns:jacoco="antlib:org.jacoco.ant">
<property file="build.ant.properties"/>
<property name="jarname" value="marauroa-${version}.jar"/>
<property name="jarname_client" value="marauroa-client-only-${version}.jar"/>
<path id="compile-classpath">
<pathelement path="${log4j_jar}"/>
<pathelement path="${junit_jar}"/>
<pathelement path="${jnlp_jar}"/>
<pathelement path="${jython_jar}"/>
</path>
<path id="compile-tests-classpath">
<path refid="compile-classpath" />
<path location="${build-classes}" />
</path>
<path id="run-tests-classpath">
<path refid="compile-tests-classpath" />
<pathelement location="${h2_jar}"/>
<pathelement path="${build-tests}" />
<pathelement path="."/>
</path>
<!-- Clears the instalation -->
<target name="clean">
<delete dir="${build}"/>
<delete dir="${docs}"/>
<delete dir="${build-archive}"/>
<delete dir="${dist}"/>
</target>
<!-- Create the initial folders for the build -->
<target name="init">
<mkdir dir="${build-archive}" />
<mkdir dir="${build}" />
<mkdir dir="${build-classes}" />
<mkdir dir="${build-tests}" />
<mkdir dir="${build-tests-report}" />
<mkdir dir="${build-coverage}" />
<mkdir dir="${dist}" />
<mkdir dir="${docs}" />
</target>
<!-- Compiles the project -->
<target name="compile" depends="init">
<!-- Exclude python support if jython.jar is not present -->
<condition property="exclude.python" value="**/python/*.*">
<not>
<available file="${jython_jar}"/>
</not>
</condition>
<!-- Exclude junit support if junit is not present -->
<condition property="exclude.junit" value="**/*tests/*.*">
<not>
<available file="${junit_jar}"/>
</not>
</condition>
<!-- Update version number. -->
<replaceregexp file="${src}/marauroa/server/marauroad.java"
match="private static final String VERSION = &quot;.*&quot;;"
replace="private static final String VERSION = &quot;${version}&quot;;"
byline="true"/>
<!-- Compile it -->
<javac srcdir="${src}" source="1.5" target="1.5" destdir="${build-classes}" debug="true" debuglevel="source,lines" includes="**/marauroa/**" excludes="${exclude.python};${exclude.junit}" includeantruntime="false">
<compilerarg line="-encoding utf-8"/>
<classpath refid="compile-classpath" />
</javac>
<copy todir="${build-classes}/marauroa/server/">
<fileset dir="${src}/marauroa/server">
<include name="*.sql"/>
<include name="*.properties"/>
</fileset>
</copy>
</target>
<!-- Compiles the project -->
<target name="compile-client">
<delete dir="${build-client}" quiet="true" />
<mkdir dir="${build-client}"/>
<!-- Compile it -->
<javac srcdir="${src}" source="1.5" target="1.5" destdir="${build-client}" debug="true" debuglevel="source,lines" includeantruntime="false">
<compilerarg line="-encoding utf-8"/>
<include name="marauroa/client/**"/>
<include name="marauroa/common/**"/>
<classpath>
<pathelement path="${log4j_jar}"/>
<pathelement path="${jnlp_jar}"/>
</classpath>
</javac>
</target>
<!-- Generate Java docs -->
<target name="docs" depends="compile">
<javadoc packagenames="marauroa.*"
defaultexcludes="yes"
destdir="${docs}"
author="true"
version="true"
use="true"
windowtitle="Marauroa API Documentation Version: ${version}">
<classpath refid="compile-classpath" />
<packageset dir="src" defaultexcludes="yes" />
</javadoc>
</target>
<!-- Create jar file for Marauroa -->
<target name="jar-all" depends="compile">
<jar jarfile="${build-archive}/${jarname}" basedir="${build-classes}/">
<manifest>
<attribute name="Main-Class" value="marauroa.server.marauroad"/>
</manifest>
</jar>
<copy tofile="${build-archive}/marauroa.jar" file="${build-archive}/${jarname}"/>
</target>
<!-- Create jar file for Marauroa -->
<target name="jar-client" depends="compile-client">
<jar jarfile="${build-archive}/${jarname_client}" basedir="${build-client}/" />
</target>
<target name="jar" depends="jar-all, jar-client" />
<!-- Prepare the tarball for releases -->
<target name="dist_binary" depends="jar">
<replaceregexp file="${extras}/marauroad.bat"
match="set LOCALCLASSPATH=.*"
replace="set LOCALCLASSPATH=.;marauroa-${version}.jar;${jython_jar};${h2_jar};${connectorJ_jar};${log4j_jar}"
byline="true"/>
<replaceregexp file="${extras}/marauroad"
match="export LOCALCLASSPATH=.*"
replace="export LOCALCLASSPATH=.:libs/marauroa-${version}.jar:{jython_jar}:${h2_jar}:${connectorJ_jar}:${log4j_jar}"
byline="true"/>
<mkdir dir="marauroa-${version}"/>
<mkdir dir="marauroa-${version}/libs"/>
<copy todir="marauroa-${version}" file="${extras}/marauroad.bat"/>
<copy todir="marauroa-${version}" file="${extras}/marauroad"/>
<copy todir="marauroa-${version}" file="${build-archive}/${jarname}"/>
<copy todir="marauroa-${version}" file="${build-archive}/${jarname_client}"/>
<copy todir="marauroa-${version}/libs">
<fileset dir="${libdir}">
<exclude name="jnlp.jar" />
<exclude name="junit-4.4jar" />
</fileset>
</copy>
<copy todir="marauroa-${version}" file="AUTHORS.txt"/>
<copy todir="marauroa-${version}" file="CHANGES.txt"/>
<copy todir="marauroa-${version}" file="LICENSE.txt"/>
<copy todir="marauroa-${version}" file="README.txt"/>
<zip destfile="${dist}/marauroa-${version}.zip" basedir="marauroa-${version}"/>
<delete dir="marauroa-${version}"/>
</target>
<target name="dist_docs" depends="docs">
<mkdir dir="marauroa-${version}"/>
<copy todir="marauroa-${version}/${docs}">
<fileset dir="${docs}"/>
</copy>
<copy todir="marauroa-${version}" file="AUTHORS.txt"/>
<copy todir="marauroa-${version}" file="CHANGES.txt"/>
<copy todir="marauroa-${version}" file="LICENSE.txt"/>
<copy todir="marauroa-${version}" file="README.txt"/>
<zip destfile="${dist}/marauroa-${version}-docs.zip" basedir="marauroa-${version}"/>
<delete dir="marauroa-${version}"/>
</target>
<target name="dist_source" depends="docs">
<mkdir dir="marauroa-${version}"/>
<copy todir="marauroa-${version}/src">
<fileset dir="src"/>
</copy>
<copy todir="marauroa-${version}/tests">
<fileset dir="tests"/>
</copy>
<copy todir="marauroa-${version}/functional_tests">
<fileset dir="functional_tests"/>
</copy>
<copy todir="marauroa-${version}/extras">
<fileset dir="extras"/>
</copy>
<copy todir="marauroa-${version}/libs">
<fileset dir="libs"/>
</copy>
<copy todir="marauroa-${version}" file="build.xml"/>
<copy todir="marauroa-${version}" file="build.ant.properties"/>
<copy todir="marauroa-${version}" file="AUTHORS.txt"/>
<copy todir="marauroa-${version}" file="CHANGES.txt"/>
<copy todir="marauroa-${version}" file="LICENSE.txt"/>
<copy todir="marauroa-${version}" file="README.txt"/>
<tar destfile="${dist}/marauroa-${version}-src.tar.gz" compression="gzip">
<tarfileset dir="marauroa-${version}" prefix="marauroa-${version}">
<exclude name="**/CVS/**"/>
</tarfileset>
</tar>
<delete dir="marauroa-${version}"/>
</target>
<!-- builds the whole project for releasing -->
<target name="dist" depends="dist_binary, dist_docs, dist_source"/>
<!-- testing targets -->
<target name="compile-tests" depends="compile">
<javac srcdir="${src-test}" source="1.5" target="1.5" destdir="${build-tests}" debug="true" debuglevel="source,lines" includes="**/marauroa/**" excludes="${exclude.python};${exclude.junit}" includeantruntime="false">
<compilerarg line="-encoding utf-8"/>
<classpath refid="compile-tests-classpath" />
</javac>
<copy todir="${build-tests}">
<fileset dir="${src-test}">
<include name="**/*.*" />
<exclude name="**/*.java" />
<exclude name="**/*.ini" />
</fileset>
</copy>
<copy file="${test-server-ini}" tofile="./server.ini" />
</target>
<target name="run-tests" depends="compile-tests">
<junit printsummary="yes" fork="yes">
<jvmarg value="-Djava.awt.headless=true"/>
<classpath refid="run-tests-classpath" />
<formatter type="plain" usefile="false"/>
<formatter type="xml"/>
<batchtest todir="${build-tests-report}">
<fileset dir="${src-test}">
<include name="**/*Test.java"/>
<include name="**/Test*.java"/>
</fileset>
</batchtest>
</junit>
<delete file="./server.ini" />
</target>
<target name="coverage" depends="compile-tests">
<jacoco:coverage>
<junit printsummary="yes" fork="yes">
<jvmarg value="-Djava.awt.headless=true"/>
<classpath refid="run-tests-classpath" />
<formatter type="plain" usefile="false"/>
<formatter type="xml"/>
<batchtest todir="${build-tests-report}">
<fileset dir="${src-test}">
<include name="**/*Test.java"/>
<include name="**/Test*.java"/>
</fileset>
</batchtest>
</junit>
</jacoco:coverage>
<delete file="./server.ini" />
</target>
<target name="coverage-report" depends="coverage">
<jacoco:report>
<executiondata>
<file file="jacoco.exec" />
</executiondata>
<structure name="${ant.project.name}">
<classfiles>
<fileset dir="${build-classes}" />
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${src}" />
</sourcefiles>
</structure>
<html destdir="${build-coverage}" />
<xml destfile="${build-coverage}/jacoco.xml" />
</jacoco:report>
</target>
</project>