-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
182 lines (140 loc) · 5.93 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
<?xml version="1.0" ?>
<!--
Copyright (C) 2013 Quoc-Sang Phan
This file is part of jpf-utils.
jpf-utils is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
jpf-utils is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
jpf-utils. If not, see <http://www.gnu.org/licenses/>.
-->
<!--
build.xml - generic JPF extension build script
using Ant (http://jakarta.apache.org/ant)
public targets:
compile compile JPF and its specific (modeled) environment libraries
test run all JPF tests
jar build JPF jar files
dist build binary distribution
clean remove the files that have been generated by the build process
-->
<project name="jpf-utils" default="build" basedir=".">
<!-- ========================== COMMON SECTION ========================== -->
<!--
local props have to come first, because Ant properties are immutable
NOTE: this file is local - it is never in the repository!
-->
<!-- this is where we get the 'jpf.core' location from -->
<!-- <property file="${user.home}/.jpf/site.properties"/> -->
<!-- if there is none, default to a 'jpf-core' peer dir -->
<property name="jpf-core" value = "../jpf-core"/>
<!-- get the jpf-core path properties -->
<property file="${jpf-core}/jpf.properties"/>
<!-- if there is none, default to a 'jpf-core' peer dir -->
<property name="jpf-symbc" value = "../jpf-symbc"/>
<!-- get the jpf-symbc path properties -->
<property file="${jpf-symbc}/jpf.properties"/>
<!-- compiler settings -->
<property name="src_level" value="6"/>
<property name="debug" value="on"/>
<property name="deprecation" value="on"/>
<!-- generic classpath settings -->
<path id="lib.path">
<!-- our own classes and libs come first -->
<pathelement location="build/main"/>
<!-- we don't have these
<pathelement location="build/peers"/>
-->
<fileset dir=".">
<include name="lib/*.jar"/>
<!-- <include name="${jpf-symbc}/lib/com.microsoft.z3.jar"/> -->
</fileset>
<!-- add in what we need from the core -->
<pathelement path="${jpf-core.native_classpath}"/>
<!-- add in what we need from the symbc -->
<pathelement path="${jpf-symbc.native_classpath}"/>
<pathelement path="${jpf-symbc.classpath}"/>
</path>
<!-- init: common initialization -->
<target name="-init">
<tstamp/>
<mkdir dir="build"/> <!-- the build root -->
<!-- the things that have to be in the classpath of whatever runs Ant -->
<available property="have_javac" classname="com.sun.tools.javac.Main"/>
<fail unless="have_javac">no javac found</fail>
<available file="src/main" type="dir" property="have_main"/>
<available file="src/tests" type="dir" property="have_tests"/>
<available file="src/examples" type="dir" property="have_examples"/>
<condition property="have_jvm_code">
<or>
<isset property="have_main"/>
<isset property="have_peers"/>
</or>
</condition>
<condition property="have_jpf_code">
<or>
<isset property="have_classes"/>
<isset property="have_annotations"/>
</or>
</condition>
</target>
<!-- ======================= COMPILE SECTION ============================= -->
<!-- public compile -->
<target name="compile" depends="-init,-compile-main,-compile-tests,-compile-examples"
description="compile all JPF core sources" >
</target>
<target name="-compile-main" if="have_main">
<mkdir dir="build/main"/>
<!--TODO: remove src/examples from srcdir after configuring dynamically program inputs-->
<javac srcdir="src/main" destdir="build/main" includeantruntime="false"
debug="${debug}" source="${src_level}" deprecation="${deprecation}"
classpathref="lib.path"/>
</target>
<target name="-compile-tests" if="have_tests" depends="-compile-main">
<mkdir dir="build/tests"/>
<javac srcdir="src/tests" destdir="build/tests" includeantruntime="false"
debug="${debug}" source="${src_level}" deprecation="${deprecation}">
<classpath>
<path refid="lib.path"/>
<pathelement location="build/classes"/>
<pathelement location="build/annotations"/>
</classpath>
</javac>
</target>
<target name="-compile-examples" if="have_examples" depends="-compile-main">
<mkdir dir="build/examples" />
<javac srcdir="src/examples" destdir="build/examples" includeantruntime="false"
debug="${debug}" source="${src_level}" deprecation="${deprecation}">
<classpath>
<path refid="lib.path"/>
<pathelement location="build/classes"/>
<pathelement location="build/annotations"/>
</classpath>
</javac>
</target>
<!-- ======================= MISC SECTION ================================ -->
<!-- build jars -->
<target name="build" depends="compile,-jar-tool"
description="generate the ${ant.project.name} jar files" >
</target>
<target name="-jar-tool" if="have_jvm_code">
<jar jarfile="build/jpf-utils.jar">
<fileset dir="build/main">
</fileset>
</jar>
<chmod file="build/jpf-utils.jar" perm="ugo+rx"/>
</target>
<!-- public clean: cleanup from previous tasks/builds -->
<target name="clean">
<delete dir="build" />
<delete>
<fileset dir="." includes="**/*~" defaultexcludes="no" />
<fileset dir="." includes="**/*.bak" defaultexcludes="no" />
<fileset dir="." includes="**/error.xml" />
</delete>
</target>
</project>