-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
189 lines (164 loc) · 7.26 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
<project name="PlanningBasedAlignment" 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="${major_minor}.${env.BUILD_NUMBER}" />
<property name="project" value="PlanningBasedAlignment" />
<property name="author" value="Giacomo Lanciano" />
<property name="organization" value="Sapienza University of Rome" />
<property name="description" value="PlanningBasedAlignment" />
<property name="license" value="GPL" />
<property name="logo" value="https://corsidilaurea.uniroma1.it/sites/default/files/logo_rosso_sapienza.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" />
<!-- 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" />
</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="${bytecode_format}" target="${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">
<ivy:retrieve type="jar,bundle" sync="true" />
<!-- Uncomment next line if libraries need to be copied from ivy to lib folder. -->
<!-- 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" />
<!-- 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>