-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
223 lines (192 loc) · 8.73 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
<project name="ExogenousData" default="Compile Sources" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<!-- set global properties for this build -->
<property environment="env" />
<property name="src" location="src" />
<property name="build" location="bindist" />
<property name="doc" location="doc" />
<property name="lib" location="lib" />
<property name="dist" location="dist" />
<property name="release" location="latestrelease" />
<property name="version" value="${env.major_minor}.${env.GITHUB_RUN_NUMBER}" />
<property name="project" value="ExogenousData" />
<property name="author" value="Sander Leemans and Adam Banham" />
<property name="organization" value="Queensland University of Technology" />
<property name="description" value="Exogenous Data" />
<!-- See https://svn.win.tue.nl/trac/prom/browser/Packages/ProM-Contexts/Trunk/src/org/processmining/contexts/uitopia/packagemanager/PMPackageView.java for a list of known licenses. -->
<property name="license" value="GPL" />
<property name="logo" value="prom_subtitle_hat_300.png" />
<property name="ivy.lib.dir" value="ivy" />
<!--property name="ivy.cache.dir" value="/var/lib/hudson/.ivy2/cache/${env.EXECUTOR_NUMBER}" /-->
<!-- Set the os to win32, win64, lin32, lin64, mac, or all -->
<property name="os" value="all" />
<property name="ivy.install.version" value="2.1.0-rc2" />
<condition property="ivy.home" value="${env.IVY_HOME}">
<isset property="env.IVY_HOME" />
</condition>
<property name="ivy.home" value="${user.home}/.ant" />
<property name="ivy.jar.dir" value="${ivy.home}/lib" />
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
<target name="download-ivy" unless="offline">
<mkdir dir="${ivy.jar.dir}"/>
<!-- download Ivy from web site so that it can be used even without any special installation -->
<get src="https://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="init-ivy" depends="download-ivy">
<!-- try to load ivy here from ivy home, in case the user has not already dropped
it into ant's lib dir (note that the latter copy will always take precedence).
We will not fail as long as local lib dir exists (it may be empty) and
ivy is in at least one of ant's lib dir or the local lib dir. -->
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" />
</target>
<!-- Compilation macro
This Macro compiles the sources is one ${src}-... folder.
The sources are compiled into the ${build} folder.
-->
<path id="classpath">
<pathelement path="${build}" />
<pathelement path="${java.class.path}" />
<fileset dir=".">
<include name="ivy/**/*.jar" />
<include name="lib/**/*.jar" />
<!--include name="stdlib/**/*.jar" />
<include name="packagelib/**/*.jar" /-->
</fileset>
</path>
<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="true" debuglevel="lines,vars,source" deprecation="yes" source="${env.bytecode_format}" target="${env.bytecode_format}">
<!-- Check for unsafe operations -->
<compilerarg value="-Xlint:unchecked" />
</javac>
</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}-${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" />
</manifest>
</jar>
<copy file="${dist}/${project}-${DSTAMP}.jar" tofile="${dist}/${project}.jar" overwrite="true" />
</sequential>
</macrodef>
<target name="clean">
<echo message="[build] Cleaning binaries and distributions" />
<delete dir="${build}" />
<delete dir="${dist}" />
</target>
<target name="resolve" depends="init-ivy">
<ivy:retrieve type="jar,bundle" sync="true" haltonfailure="false" />
<!--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="makejar">
<echo message="[build] Creating jar" />
<tstamp />
<makejar />
</target>
<target name="archive">
<echo message="[build] Packaging the project" />
<sequential>
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${release}" includes="${project}-*-${os}.zip" />
</delete>
<zip destfile="${release}/${project}-${version}-${os}.zip">
<!--zipfileset dir="${lib}" prefix="lib">
<include name="**" />
</zipfileset-->
<zipfileset dir="${dist}" prefix="">
<include name="${project}.jar" />
</zipfileset>
</zip>
<copy file="${dist}/${project}.jar" tofile="${release}/${project}.jar" overwrite="true" />
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${release}/lib" includes="**/*" />
</delete>
<!--mkdir dir="${release}/lib" />
<copy todir="${release}/lib" overwrite="true">
<fileset dir="${lib}" />
</copy-->
<exec executable="grep">
<redirector output="ivypack.xml" />
<arg value="<dependency .*org="prom" " />
<arg value="ivy.xml" />
</exec>
<echo file="${release}/packages.xml">
<packages>
<package name="${project}" version="${version}" os="${os}" url="${project}/${project}-${version}-${os}.zip" desc="${description}" org="${organization}" license="${license}" author="${author}" auto="false" hasPlugins="true" logo="${logo}">
</echo>
<concat destfile="${release}/packages.xml" append="true">
<filelist files="ivypack.xml" />
</concat>
<echo file="${release}/packages.xml" append="true">
</package>
</packages>
</echo>
<copy file="ivy.xml" tofile="${release}/ivy.xml" overwrite="true" />
<replace file="${release}/ivy.xml" token="VERSION" value="${version}" />
</sequential>
</target>
<!-- Target to use to build the project on Hudson -->
<target name="buildHudson" depends="clean,resolve,javadoc,compile,makejar,archive" />
<!-- 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" />
<!-- targt used to build a lightweight version for testing -->
<target name="buildForTest" depends="clean,resolve,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" />
<!-- export distribution archive -->
<target name="Create downloadable archive" depends="Compile Sources,archive" />
<target name="Compile Sources" depends="resolve,compile,makejar" />
</project>