-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
285 lines (250 loc) · 10.6 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
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
283
284
285
<project name="spndiscover" default="test" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<!-- set global properties for this build -->
<property environment="env" />
<property name="src" location="src" />
<property name="src.tests" location="tests/src-test" />
<property name="build" location="bindist" />
<property name="config" location="config" />
<property name="doc" location="doc" />
<property name="dist" location="dist" />
<property name="lib" location="lib" />
<property name="ldlib" location="ldlib" />
<property name="scripts" location="scripts" />
<property name="reports.tests" location="reports" />
<property name="release" location="latestrelease" />
<property name="major_minor" value="1.1.1" />
<property name="version" value="${major_minor}" />
<property name="project" value="spndiscover" />
<!-- Set the os to win32, win64, lin32, lin64, mac, or all -->
<property name="os" value="all" />
<!-- Easier to just use the standard ivy cache across Eclipse and ivy
command line, especially given the slow state of the prom repo.
May need to clear this directory if refreshing dependencies, as
it behaves like a secondary ivy cache.
This is not great, tbh. However the makezip task depends on this
for now. Unless you have specific ivy use case, like a ProM
plugin, suggest using a gradle build process instead. See
spm_dim or prob-process-tree on github for an example. -->
<property name="ivy.lib.dir" value="ivy" />
<property name="author" value="Adam Burke" />
<property name="organization" value="QUT, Australia" />
<property name="description" value="Compare stochastic discovery techniques" />
<property name="license" value="GPL" />
<property name="java.source.version" value="8" />
<property name="java.target.version" value="${java.source.version}" />
<property environment="env"/>
<property name="spd_we.prom.plugin.src.path" value="c:/working/source/eclipse-workspace/StochasticWeightEstimation" />
<property name="main.class" value="au.edu.qut.pm.spn_discover.ModelRunner" />
<path id="classpath">
<fileset dir=".">
<include name="ivy/**/*.jar" />
</fileset>
</path>
<pathconvert property="jarclasspath" pathsep=" " refid="classpath">
<mapper>
<chainedmapper>
<flattenmapper />
</chainedmapper>
</mapper>
</pathconvert>
<!-- Compilation macro
This Macro compiles the sources is one ${src}-... folder.
The sources are compiled into the ${build} folder.
-->
<macrodef name="compile">
<sequential>
<!-- Compile the java code from ${src}-@{module} into ${build} -->
<javac srcdir="${src}" classpathref="classpath"
destdir="${build}" nowarn="false" verbose="no"
debug="false" debuglevel="lines,vars,source" deprecation="yes"
source="${java.source.version}" target="${java.target.version}">
<!-- Check for unsafe operations -->
<compilerarg value="-Xlint:unchecked" />
</javac>
<!-- Tests -->
<javac srcdir="${src.tests}" classpathref="classpath"
destdir="${build}" nowarn="false" verbose="no"
debug="false" debuglevel="lines,vars,source" deprecation="yes"
source="${java.source.version}" target="${java.target.version}">
<!-- Check for unsafe operations -->
<compilerarg value="-Xlint:unchecked" />
</javac>
<!-- Not strictly compilation but makes running simpler -->
<mkdir dir="var" />
</sequential>
</macrodef>
<!-- Jar macro
This Macro builds a jar file from compiled sources in the ${dist} folder.
-->
<macrodef name="makejar">
<sequential>
<!-- Create the distribution directory -->
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
<jar jarfile="${dist}/${project}-${version}-${DSTAMP}.jar">
<fileset dir="${build}">
<include name="**" />
<exclude name="test**" />
</fileset>
<fileset dir="${src}">
<include name="**" />
<exclude name="test**" />
</fileset>
<fileset dir="${doc}">
<include name="**" />
<exclude name="test**" />
</fileset>
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Specification-Title" value="${project}-@{module}" />
<attribute name="Specification-Version" value="${version}" />
<!-- attribute name="Specification-Vendor" value="www.processmining.org" / -->
<attribute name="Implementation-Title" value="${project}" />
<attribute name="Implementation-Version" value="${version} ${TODAY}" />
<!-- attribute name="Implementation-Vendor" value="www.processmining.org" / -->
<attribute name="Sealed" value="false" />
<attribute name="Main-Class" value="${main.class}" />
<attribute name="Class-Path" value="${jarclasspath}" />
</manifest>
</jar>
<copy file="${dist}/${project}-${version}-${DSTAMP}.jar" tofile="${dist}/${project}.jar" overwrite="true" />
</sequential>
</macrodef>
<macrodef name="makezip">
<sequential>
<echo message="Version ${version} built on ${DSTAMP}" file="${dist}/buildid.txt" />
<zip destfile="${dist}/${project}-${version}-${DSTAMP}.zip" >
<zipfileset dir="${ldlib}" prefix="lib">
<include name="**" />
</zipfileset>
<zipfileset dir="${ivy.lib.dir}" prefix="lib">
<include name="**" />
</zipfileset>
<zipfileset file="${dist}/${project}.jar" prefix="lib" />
<zipfileset file="${dist}/${buildid.txt}" prefix="config" />
<zipfileset dir="${config}" prefix="config">
<include name="**" />
<exclude name="**.swp" />
</zipfileset>
<fileset dir="${scripts}">
<include name="**" />
<exclude name="**.swp" />
</fileset>
<fileset file="${dist}/buildid.txt" />
<!-- Plus runner batch files and shell scripts -->
</zip>
</sequential>
</macrodef>
<target name="clean">
<echo message="[build] Cleaning binaries and distributions" />
<delete dir="${build}" />
<delete dir="${dist}" />
<mkdir dir="var" />
</target>
<target name="resolve">
<ivy:retrieve sync="true" />
<!-- ivy:retrieve type="jar,bundle" sync="true" / -->
<!--ivy:retrieve pattern="lib/[artifact]-[revision].[ext]" conf="lib" type="jar,bundle" sync="true" /-->
</target>
<target name="javadoc">
<echo message="[build] Creating javadoc" />
<javadoc packagenames="**" classpathref="classpath" useexternalfile="true" defaultexcludes="yes" destdir="${doc}" author="true" version="true" verbose="false" use="true" windowtitle="${project}">
<fileset dir=".">
<include name="src/**/*.java" />
<exclude name="src/test/**/*.java" />
</fileset>
</javadoc>
</target>
<target name="compile">
<echo message="[build] Compiling the sources" />
<mkdir dir="${build}" />
<mkdir dir="${dist}" />
<compile />
</target>
<target name="test" depends="compile">
<junit printsummary="yes" haltonfailure="yes" showoutput="true">
<classpath>
<fileset dir=".">
<include name="ivy/**/*.jar" />
</fileset>
<pathelement path="${build}" />
</classpath>
<batchtest fork="no" todir="${reports.tests}">
<fileset dir="${src.tests}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="makejar" depends="test,javadoc">
<echo message="[build] Creating jar" />
<tstamp />
<echo message="jarclasspath : ${jarclasspath} " />
<makejar />
</target>
<target name="makezip" depends="makejar">
<echo message="[build] Creating zip" />
<tstamp />
<makezip />
</target>
<!-- Target to use to prepare for a downstream build -->
<!-- The upstream changes will be copied in following this target -->
<target name="prepareDownstream" depends="clean,resolve" />
<!-- Target to use to do the downstram build -->
<!-- The upstream changes will be copied in preceding this target -->
<target name="buildDownstream" depends="compile" />
<!-- Targets for sake of backwards compatibility -->
<!-- clean all binaries and distributions -->
<target name="Clean build and dist folders" description="clean up" id="1" depends="clean" />
<!-- create the project's javadoc from all existing sources. Note that only org.processmining.** is included -->
<target name="Create Javadoc" description="Generated javadoc" depends="javadoc" />
<target name="Compile Sources" depends="resolve,compile,test" />
<target name="Create Zip" depends="clean,Compile Sources,makezip" />
<target name="ivy-depend" depends="resolve" >
<ivy:report graph="false"/>
</target>
<target name="prepare-plugin-src">
<!-- The ProM release has only a subset of the needed code. The usual way to represent this would be a library dependency,
but it seems like overkill at this level of maturity. We copy the relevant packages to a local folder with a known name.
-->
<copy todir="${spd_we.prom.plugin.src.path}/src/au/edu/qut/pm/stochastic" >
<fileset dir="src/au/edu/qut/pm/stochastic">
<include name="**/*.java"/>
</fileset>
</copy>
<copy todir="${spd_we.prom.plugin.src.path}/src/au/edu/qut/pm/spn_estimator" >
<fileset dir="src/au/edu/qut/pm/spn_estimator">
<include name="**/*.java"/>
</fileset>
</copy>
<copy todir="${spd_we.prom.plugin.src.path}/src/au/edu/qut/prom" >
<fileset dir="src/au/edu/qut/prom">
<include name="**/*.java"/>
</fileset>
</copy>
<copy todir="${spd_we.prom.plugin.src.path}/src/au/edu/qut/xes" >
<fileset dir="src/au/edu/qut/xes">
<include name="**/*.java"/>
</fileset>
</copy>
<copy todir="${spd_we.prom.plugin.src.path}/src/org/processmining" >
<fileset dir="src/org/processmining">
<include name="**/*.java"/>
</fileset>
</copy>
<copy todir="${spd_we.prom.plugin.src.path}/tests/src-test/au/edu/qut/pm/spn_estimator" >
<fileset dir="tests/src-test/au/edu/qut/pm/spn_estimator">
<include name="**/*.java"/>
</fileset>
</copy>
<copy todir="${spd_we.prom.plugin.src.path}/tests/src-test/au/edu/qut/prom" >
<fileset dir="tests/src-test/au/edu/qut/prom">
<include name="**/*.java"/>
</fileset>
</copy>
<copy todir="${spd_we.prom.plugin.src.path}/tests/src-test/au/edu/qut/xes" >
<fileset dir="tests/src-test/au/edu/qut/xes">
<include name="**/*.java"/>
</fileset>
</copy>
</target>
</project>