forked from uuverifiers/eldarica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
293 lines (264 loc) · 13.5 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
286
287
288
289
290
291
292
293
<?xml version="1.0" encoding="UTF-8" ?>
<project name="Scala Lazy Abstraction" default="dist" basedir=".">
<description>
The Scala Lazy Abstraction Framework
</description>
<!-- The settings can be overridden in local.properties. -->
<property environment="env" />
<property file="local.properties"/>
<property name="scala.home" value="${env.SCALA_HOME}" />
<property name="java.home" value="${env.JAVA_HOME}" />
<property name="scala-library.jar" value="${scala.home}/lib/scala-library.jar" />
<property name="scala-compiler.jar" value="${scala.home}/lib/scala-compiler.jar" />
<property name="scala-reflect.jar" value="${scala.home}/lib/scala-reflect.jar"/>
<property name="scala-actors.jar" value="${scala.home}/lib/scala-actors-2.11.0.jar"/>
<property name="scala-xml.jar" value="${scala.home}/lib/scala-xml_2.11-1.0.4.jar"/>
<property name="scala-parser-combinators.jar" value="${scala.home}/lib/scala-parser-combinators_2.11-1.0.4.jar"/>
<property name="scala-compiler.jar" value="${scala.home}/lib/scala-compiler.jar" />
<property name="scalac.default.params" value="-deprecation -unchecked" />
<!-- paths -->
<property name="base.dir" value="${basedir}" />
<property name="sources.dir" value="${base.dir}/src" />
<property name="dist.dir" value="${base.dir}/dist" />
<property name="lib.dir" value="${basedir}/lib" />
<property name="flata.dir" value="${basedir}/flata" />
<property name="build.dir" value="${base.dir}/bin" />
<property name="bindist.dir" value="${base.dir}/binary-dist" />
<property name="regtests.dir" value="${base.dir}/regression-tests" />
<!-- BIP libraries -->
<!-- BIP support is disabled for the time being
<path id="bip.jars">
<fileset dir="${base.dir}/bip-lib">
<include name="*.jar"/>
</fileset>
</path>
-->
<!-- libraries -->
<property name="java-cup.jar" value="${lib.dir}/java-cup-11a.jar" />
<property name="java-cup-runtime.jar" value="${lib.dir}/java-cup-11a-runtime.jar" />
<property name="jflex.jar" value="${lib.dir}/JFlex.jar" />
<!-- <property name="z3.jar" value="${lib.dir}/z3.jar" /> -->
<property name="princess.jar" value="${lib.dir}/princess.jar" />
<property name="smt-parser.jar" value="${lib.dir}/smt-parser.jar" />
<property name="pri-parser.jar" value="${lib.dir}/pri-parser.jar" />
<property name="tplspec-parser.jar" value="${lib.dir}/tplspec-parser.jar" />
<property name="cc-parser.jar" value="${lib.dir}/cc-parser.jar" />
<property name="flata.jar" value="${flata.dir}/flata.jar" />
<property name="acceleration.jar" value="${flata.dir}/acceleration.jar" />
<property name="antlr.jar" value="${lib.dir}/antlr-3.3-complete.jar" />
<property name="nts.jar" value="${flata.dir}/nts.jar" />
<property name="proguard.jar" value="${lib.dir}/nts.jar" />
<!-- other properties -->
<property name="dist.jar" value="${dist.dir}/lazabs.jar" />
<property name="immed.jar" value="${dist.dir}/immed.jar" />
<property name="main.class" value="lazabs.Main" />
<!-- required to use the tasks scalac, fsc and scaladoc -->
<taskdef resource="scala/tools/ant/antlib.xml">
<classpath>
<pathelement location="${scala-compiler.jar}" />
<pathelement location="${scala-library.jar}" />
<pathelement location="${scala-reflect.jar}" />
</classpath>
</taskdef>
<!-- required to use the task jflex -->
<taskdef name="jflex" classname="JFlex.anttask.JFlexTask">
<classpath>
<pathelement location="${jflex.jar}" />
</classpath>
</taskdef>
<!-- required to use the task java cup -->
<taskdef name="cup" classname="java_cup.anttask.CUPTask">
<classpath>
<pathelement location="${java-cup.jar}" />
</classpath>
</taskdef>
<target name="cupparser" description="compiles the Cup parser" depends="pre-parse">
<mkdir dir="${build.dir}" />
<jflex file="${sources.dir}/lazabs/parser/Lexer.jflex" />
<cup srcfile="${sources.dir}/lazabs/parser/Parser.cup" destdir="${sources.dir}" parser="Parser" symbols="Symbols" />
<!-- <javac srcdir="${sources.dir}" target="1.5" destdir="${build.dir}">-->
<javac srcdir="${sources.dir}" destdir="${build.dir}">
<include name="lazabs/parser/*.java" />
<classpath>
<pathelement location="${scala-library.jar}" />
<pathelement location="${java-cup.jar}" />
<pathelement location="${java-cup-runtime.jar}" />
<pathelement location="${jflex.jar}" />
<pathelement location="${build.dir}/lazabs/ast" />
</classpath>
</javac>
</target>
<target name="hornparser" description="compiles the Cup parser for Horn clauses" depends="pre-parse">
<mkdir dir="${build.dir}" />
<jflex file="${sources.dir}/lazabs/horn/parser/HornLexer.jflex" />
<cup srcfile="${sources.dir}/lazabs/horn/parser/HornParser.cup" destdir="${sources.dir}" parser="Parser" symbols="Symbols" />
<!-- <javac srcdir="${sources.dir}" target="1.5" destdir="${build.dir}">-->
<javac srcdir="${sources.dir}" destdir="${build.dir}">
<include name="lazabs/horn/parser/*.java" />
<classpath>
<pathelement location="${scala-library.jar}" />
<pathelement location="${java-cup.jar}" />
<pathelement location="${java-cup-runtime.jar}" />
<pathelement location="${jflex.jar}" />
<pathelement location="${build.dir}/lazabs/ast" />
</classpath>
</javac>
</target>
<target name="pre-parse" description="compiles the required sources to be able to compile the Cup parser">
<mkdir dir="${build.dir}" />
<scalac srcdir="${sources.dir}" destdir="${build.dir}">
<include name="lazabs/ast/*" />
<include name="lazabs/types/*" />
<include name="lazabs/horn/global/Horn.scala" />
<classpath>
<pathelement location="${scala-library.jar}" />
</classpath>
</scalac>
</target>
<target name="compile" description="compiles the files" depends="cupparser, hornparser">
<mkdir dir="${build.dir}" />
<mkdir dir="${dist.dir}" />
<scalac srcdir="${sources.dir}" destdir="${build.dir}" force="changed" addparams="${scalac.default.params}">
<include name="**/*.scala" />
<classpath>
<pathelement location="${scala-library.jar}" />
<pathelement location="${scala-reflect.jar}" />
<pathelement location="${scala-actors.jar}" />
<pathelement location="${scala-xml.jar}" />
<pathelement location="${scala-parser-combinators.jar}" />
<pathelement location="${java-cup-runtime.jar}" />
<pathelement location="${jflex.jar}" />
<!-- <pathelement location="${z3.jar}" /> -->
<pathelement location="${princess.jar}" />
<pathelement location="${smt-parser.jar}" />
<pathelement location="${pri-parser.jar}" />
<pathelement location="${cc-parser.jar}" />
<pathelement location="${tplspec-parser.jar}" />
<pathelement location="${flata.jar}" />
<pathelement location="${acceleration.jar}" />
<pathelement location="${antlr.jar}" />
<pathelement location="${nts.jar}" />
<pathelement location="${build.dir}" />
</classpath>
<!-- <classpath refid="bip.jars" /> -->
</scalac>
</target>
<target name="dist" depends="compile" description="build the plugin jar file and a script to use it">
<manifest file="${dist.dir}/MANIFEST.MF">
<attribute name="Built-By" value="lara.epfl.ch" />
<attribute name="Main-Class" value="${main.class}" />
<attribute name="Class-Path" value="${scala-library.jar}"/>
</manifest>
<jar destfile="${dist.jar}" manifest="${dist.dir}/MANIFEST.MF">
<fileset dir="${build.dir}" includes="**/*.class" />
</jar>
</target>
<target name="optim" depends="compile" description="build an optimized jar file">
<manifest file="${dist.dir}/MANIFEST.MF">
<attribute name="Built-By" value="lara.epfl.ch" />
<attribute name="Main-Class" value="${main.class}" />
<attribute name="Class-Path" value="${scala-library.jar}"/>
</manifest>
<jar destfile="${immed.jar}" manifest="${dist.dir}/MANIFEST.MF">
<fileset dir="${build.dir}" includes="**/*.class" />
</jar>
<taskdef resource="proguard/ant/task.properties"
classpath="lib/proguard.jar" />
<proguard>
-libraryjars ${java.home}/lib/rt.jar
-libraryjars ${scala-library.jar}
-libraryjars ${nts.jar}
-libraryjars ${flata.jar}
-libraryjars ${princess.jar}
-libraryjars ${smt-parser.jar}
-libraryjars ${pri-parser.jar}
-libraryjars ${antlr.jar}
-libraryjars ${java-cup-runtime.jar}
-libraryjars ${z3.jar}
-libraryjars ${acceleration.jar}
-injars ${immed.jar}
-outjars ${dist.jar}
-keepclasseswithmembers public class * {
public static void main(java.lang.String[]);
}
</proguard>
<delete file="${immed.jar}" quiet="yes" failonerror="no" />
</target>
<target name="standalone" depends="compile" description="build a stand-alone jar file">
<manifest file="${dist.dir}/MANIFEST.MF">
<attribute name="Built-By" value="lara.epfl.ch" />
<attribute name="Main-Class" value="${main.class}" />
</manifest>
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask">
<classpath>
<pathelement location="${lib.dir}/jarjar-1.3.jar" />
</classpath>
</taskdef>
<jarjar destfile="${dist.jar}" manifest="${dist.dir}/MANIFEST.MF">
<fileset dir="${build.dir}" includes="**/*.class" />
<zipfileset src="${scala-library.jar}" />
<zipfileset src="${scala-reflect.jar}" />
<zipfileset src="${scala-actors.jar}" />
<zipfileset src="${scala-xml.jar}" />
<zipfileset src="${scala-parser-combinators.jar}" />
<zipfileset src="${nts.jar}" />
<zipfileset src="${flata.jar}" />
<zipfileset src="${princess.jar}" />
<zipfileset src="${smt-parser.jar}" />
<zipfileset src="${pri-parser.jar}" />
<zipfileset src="${cc-parser.jar}" />
<zipfileset src="${tplspec-parser.jar}" />
<zipfileset src="${antlr.jar}" />
<zipfileset src="${java-cup-runtime.jar}" />
<zipfileset src="${acceleration.jar}" />
</jarjar>
</target>
<target name="clean" description="cleans up" depends="clean-cupparser">
<delete dir="${build.dir}" includeemptydirs="yes" quiet="yes" failonerror="no" />
<delete dir="${dist.dir}" includeemptydirs="yes" quiet="yes" failonerror="no" />
<delete>
<fileset dir="${basedir}" includes="**/*.class" />
<fileset dir="${regtests.dir}" includes="**/Output*" />
<fileset dir="${regtests.dir}" includes="**/*.dot" />
</delete>
<delete dir="${bindist.dir}" includeemptydirs="yes" quiet="yes" failonerror="no" />
</target>
<target name="clean-cupparser" description="removes the files generated for the Cup parser">
<delete file="${sources.dir}/lazabs/parser/Lexer.java" quiet="yes" failonerror="no" />
<delete file="${sources.dir}/lazabs/parser/Lexer.java~" quiet="yes" failonerror="no" />
<delete file="${sources.dir}/lazabs/parser/Parser.java" quiet="yes" failonerror="no" />
<delete file="${sources.dir}/lazabs/parser/Symbols.java" quiet="yes" failonerror="no" />
<delete file="${sources.dir}/lazabs/horn/parser/HornLexer.java" quiet="yes" failonerror="no" />
<delete file="${sources.dir}/lazabs/horn/parser/HornLexer.java~" quiet="yes" failonerror="no" />
<delete file="${sources.dir}/lazabs/horn/parser/Parser.java" quiet="yes" failonerror="no" />
<delete file="${sources.dir}/lazabs/horn/parser/Symbols.java" quiet="yes" failonerror="no" />
</target>
<target name="new" description="clean and rebuilds" />
<!-- Run test cases -->
<target name="test" depends="standalone" description="compile and test">
<exec executable="${regtests.dir}/runalldirs"
dir="${regtests.dir}"
failonerror="true" />
</target>
<!-- Assemble all files for a binary distribution -->
<target name="binary-distribution" depends="standalone"
description="create binary Eldarica distribution">
<mkdir dir="${bindist.dir}"/>
<mkdir dir="${bindist.dir}/dist"/>
<copy file="${base.dir}/AUTHORS" todir="${bindist.dir}"/>
<copy file="${base.dir}/eld" todir="${bindist.dir}"/>
<copy file="${base.dir}/eld-client" todir="${bindist.dir}"/>
<copy file="${base.dir}/eldEnv" todir="${bindist.dir}"/>
<copy file="${base.dir}/LICENSE" todir="${bindist.dir}"/>
<copy file="${base.dir}/README.md" todir="${bindist.dir}"/>
<copy file="${dist.jar}" todir="${bindist.dir}/dist"/>
<copy todir="${bindist.dir}/regression-tests">
<fileset dir="${regtests.dir}"/> </copy>
<exec executable="sh" dir="${bindist.dir}" failonerror="true">
<arg line='-c "chmod +x eld eld-client regression-tests/run* regression-tests/*/run*"'/>
</exec>
<delete>
<fileset dir="${bindist.dir}/regression-tests" includes="**/*~" />
</delete>
</target>
</project>