forked from lszeremeta/bsbmtools-json
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
174 lines (137 loc) · 5.89 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
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="BSBM" default="build">
<!-- Configuration as a propertied file ? -->
<!-- <property file="tdb-build.properties"/> -->
<!-- ========================================== -->
<!-- ==== Configuration -->
<property name="Name" value="BSBM"/>
<property name="name" value="bsbm"/>
<property environment="env"/>
<!-- The major and minor version numbers -->
<property name="version-major" value="1"/>
<property name="version-minor" value="5"/>
<property name="version-revision" value="0"/>
<property name="version-status" value=""/>
<property name="version"
value="${version-major}.${version-minor}.${version-revision}${version-status}"/>
<!-- javadoc -->
<property name="copyright.text"
value="Copyright © Freie Universitat Berlin and Łukasz Szeremeta"/>
<property name="javadoc.packages" value="benchmark.*"/>
<target name="main" depends="jar"/>
<!-- Sources as a path -->
<property name="src.dir" value="src"/>
<!-- Source code -->
<path id="java.source.path.main">
<pathelement path="${src.dir}/main"/>
</path>
<path id="java.source.path">
<path refid="java.source.path.main"/>
</path>
<!-- Library code -->
<!-- Set version from components (if not already set) -->
<property name="version"
value="${version-major}.${version-minor}.${version-revision}${version-status}"/>
<!-- Artifacts -->
<property name="lib.dir" value="lib"/>
<property name="build.dir" value="bin"/>
<property name="build.classes.dir" value="${lib.dir}/classes"/>
<property name="jarfile" value="${name}.jar"/>
<property name="javadoc.dir" value="${doc.dir}/javadoc"/>
<property name="javadoc.all.dir" value="${doc.dir}/javadoc-all"/>
<property name="javadoc.title" value="${Name}"/>
<property name="javadoc.window.title" value="${Name}-${version-major}.${version-minor} Javadoc"/>
<!-- ========================================== -->
<!-- ==== Setup -->
<path id="java.run.class.path">
<fileset dir="${lib.dir}" includes="*.jar" excludes="${jarfile}"/>
</path>
<tstamp>
<format property="build.time.xsd" pattern="yyyy-MM-dd'T'HH:mm:ssZ"/>
<format property="build.time.txt" pattern="yyyy-MM-dd HH:mm Z"/>
</tstamp>
<!-- <echo message="Build: ${build.time.xsd}"/> -->
<filterset id="filters.build.metadata">
<filter token="VERSION" value="${version}" />
<filter token="BUILD_TIME" value="${build.time.txt}" />
<filter token="BUILD_TIME_XSD" value="${build.time.xsd}" />
</filterset>
<target name="javac-flags">
<!-- Target - so can have different javac flags (properties are set once) -->
<property name="java.debug" value="true"/>
<property name="java.debuglevel" value="source,lines,vars"/>
<property name="java.deprecation" value="true"/>
<property name="java.optimize" value="true"/>
<property name="java.encoding" value="UTF8"/>
<property name="java.source" value="1.6"/>
<property name="java.target" value="1.6"/>
</target>
<target name="resolve" description="ivy dependencies">
<ivy:retrieve/>
</target>
<target name="set-classpath" depends="resolve">
<!-- This must be after IVY has done it's dependence stuff, hence as a task -->
<path id="java.build.class.path">
<fileset dir="${lib.dir}" includes="*.jar" excludes="${jarfile}"/>
</path>
</target>
<target name="java-init" depends="javac-flags,set-classpath"/>
<!-- ========================================== -->
<!-- ==== Build, compile, jar, javadoc -->
<target name="compile" depends="java-init,compile-main" description="Compile project"/>
<target name="compile-main">
<mkdir dir="${build.classes.dir}" />
<mkdir dir="${lib.dir}" />
<javac destdir="${build.classes.dir}"
debug="${java.debug}"
deprecation="${java.debuglevel}"
optimize="${java.optimize}"
encoding="${java.encoding}"
source="${java.source}"
target="${java.target}"
>
<src refid="java.source.path"/>
<classpath refid="java.build.class.path" />
<compilerarg value="-Xlint:unchecked"/>
</javac>
</target>
<target name="copy-resources">
<copy todir="${build.dir}" flatten="true">
<resources>
<file file="${src.dir}/main/resources/generate"/>
<file file="${src.dir}/main/resources/qualification"/>
<file file="${src.dir}/main/resources/testdriver"/>
</resources>
</copy>
<chmod dir="${build.dir}" perm="+x" includes="*"/>
</target>
<target name="build.jar" depends="compile">
<antcall target="package.jar"/>
</target>
<target name="package.jar">
<delete file="${lib.dir}/${jarfile}" failonerror="false"/>
<jar destfile="${lib.dir}/${jarfile}" basedir="${build.classes.dir}" index="yes">
<!--<fileset file="${build.metadata.file.dest}"/>-->
</jar>
</target>
<!-- ========================================== -->
<!-- ==== Basic tasks -->
<!-- Not depends="build.jar" because that will always be run even if the body is "unless"'ed out -->
<target name="jar"
description="Compile and build the jar"
unless="jar.run">
<antcall target="build.jar"/>
<property name="jar.run" value="done"/>
</target>
<target name="build" depends="clean,jar,copy-resources" description="Clean build"/>
<target name="clean" description="Clean (build and reports)"
depends="clean-build-area">
</target>
<target name="clean-once" unless="clean.run">
<antcall target="clean"/>
<property name="clean.run" value="set"/>
</target>
<target name="clean-build-area">
<delete quiet="true" dir="${build.dir}"/>
<delete quiet="true" dir="${lib.dir}"/>
</target>
</project>