-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
326 lines (293 loc) · 12.4 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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="TAJS" default="all" basedir=".">
<property name="project" value="tajs" />
<property name="version" value="0.14" />
<property name="optimize" value="on" />
<property name="debug" value="off" />
<property file="local-development.properties"/>
<path id="classpath">
<fileset dir=".">
<include name="lib/*.jar"/>
<include name="extras/jalangilogger/build/libs/*.jar"/>
<include name="extras/inspector/dist/*.jar"/>
</fileset>
</path>
<path id="classpath.test">
<fileset dir=".">
<include name="lib/*.jar"/>
<include name="extras/jalangilogger/build/libs/*.jar"/>
<include name="extras/inspector/dist/*.jar"/>
<include name="lib/test/*.jar"/>
</fileset>
<pathelement location="antbuild"/>
<pathelement location="test-resources"/>
<pathelement location="benchmarks"/>
</path>
<path id="classpath.run">
<fileset dir=".">
<include name="lib/*.jar"/>
</fileset>
<pathelement location="antbuild"/>
</path>
<target name="all" depends="clean,jar-all,tajs-functions,doc" />
<target name="compile">
<!--
<property name="cp" refid="classpath"/>
<echo message="Classpath is ${cp}"/>
-->
<mkdir dir="antbuild"/>
<javac srcdir="src" includes="**" destdir="antbuild" optimize="${optimize}"
debug="${debug}" includeantruntime="false" source="1.8">
<classpath refid="classpath" />
<compilerarg line="-encoding ISO-8859-1 -Xlint:deprecation" compiler="modern" />
<!--
<compilerarg line="-Xlint -Xlint:-serial -Xlint:-path" compiler="modern" />
-->
</javac>
<copy todir="antbuild">
<fileset dir="resources"/>
</copy>
</target>
<target name="tajs-functions" depends="compile">
<java classname="dk.brics.tajs.analysis.nativeobjects.TAJSFunctionEvaluator" fork="true" failonerror="true" maxmemory="2048m" output="TAJS-functions.md">
<classpath refid="classpath.run" />
</java>
</target>
<target name="jar" depends="clean,compile">
<mkdir dir="dist" />
<jar jarfile="dist/${project}.jar" basedir="antbuild" includes="**"/>
</target>
<target name="jar-all" depends="jar">
<jar jarfile="dist/${project}-all.jar">
<zipgroupfileset dir="lib" includes="*.jar"/>
<zipgroupfileset dir="extras/jalangilogger/build/libs" includes="*.jar"/>
<zipgroupfileset dir="extras/inspector/dist" includes="*.jar"/>
<zipfileset src="dist/${project}.jar"/>
<manifest>
<attribute name="Main-Class" value="dk.brics.tajs.Main" />
</manifest>
</jar>
</target>
<target name="clean">
<delete dir="antbuild"/>
<delete dir="doc" />
<delete dir="flowgraphs" />
<delete dir="dist" />
</target>
<target name="doc" depends="jar">
<mkdir dir="doc" />
<javadoc overview="src/overview.html" Package="true" sourcepath="src" destdir="doc" nodeprecated="true" author="true" notree="true" nohelp="true" windowtitle="TAJS" additionalparam="-Xdoclint:none">
<!-- for Java 8: additionalparam="-Xdoclint:none" -->
<doctitle>
<![CDATA[Type Analyzer for JavaScript (TAJS) API Specification]]>
</doctitle>
<bottom><![CDATA[<i> Copyright © 2009-2018 Aarhus University </i>]]></bottom>
<link href="http://docs.oracle.com/javase/8/docs/api/"/>
<link href="http://www.mozilla.org/rhino/apidocs/" />
<classpath refid="classpath" />
</javadoc>
</target>
<target name="zip" depends="all">
<fail message="option 'debug' should be disabled before making zip">
<condition>
<istrue value="${debug}" />
</condition>
</fail>
<property name="dir" value="${project}-${version}" />
<mkdir dir="${dir}" />
<copy todir="${dir}">
<fileset dir="." includes="README.md,LICENSE,build.xml,TAJS-functions.md" />
</copy>
<copy file="dist/${project}.jar" todir="${dir}/dist" />
<mkdir dir="${dir}/doc" />
<copy todir="${dir}/doc">
<fileset dir="doc" />
</copy>
<copy todir="${dir}/lib">
<fileset dir="lib" />
</copy>
<mkdir dir="${dir}/src" />
<copy todir="${dir}/src">
<fileset dir="src" excludes="**/*.class" />
</copy>
<zip zipfile="dist/${dir}.zip" basedir="." includes="${dir}/**" />
<!--
<tar tarfile="${dir}.tar" basedir="." includes="${dir}/**" />
<gzip zipfile="${dir}.tar.gz" src="${dir}.tar" />
<delete file="${dir}.tar" />
-->
<delete dir="${dir}" />
</target>
<target name="compile-test" depends="compile">
<javac srcdir="test/src" includes="**" destdir="antbuild" optimize="${optimize}" debug="${debug}"
includeantruntime="false" source="1.8">
<classpath refid="classpath.test"/>
<compilerarg line="-encoding ISO-8859-1" compiler="modern"/>
<compilerarg line="-Xlint -Xlint:-serial -Xlint:-path" compiler="modern"/>
</javac>
</target>
<target name="test-fast" depends="compile-test">
<junit fork="true" printsummary="yes" showoutput="yes" haltonfailure="no" haltonerror="no" failureproperty="test.failed" maxmemory="2048m">
<classpath refid="classpath.test" />
<test name="dk.brics.tajs.test.RunFast"/>
</junit>
<fail message="tests failed" if="test.failed"/>
</target>
<target name="test-medium" depends="compile-test">
<junit fork="true" printsummary="yes" showoutput="yes" haltonfailure="no" haltonerror="no" failureproperty="test.failed" maxmemory="2048m">
<classpath refid="classpath.test" />
<test name="dk.brics.tajs.test.RunMedium"/>
</junit>
<fail message="tests failed" if="test.failed"/>
</target>
<target name="test-slow" depends="compile-test">
<junit fork="true" printsummary="yes" showoutput="yes" haltonfailure="no" haltonerror="no" failureproperty="test.failed" maxmemory="2048m">
<classpath refid="classpath.test" />
<test name="dk.brics.tajs.test.RunSlow"/>
</junit>
<fail message="tests failed" if="test.failed"/>
</target>
<target name="test-papers" depends="compile-test">
<junit fork="true" printsummary="yes" showoutput="yes" haltonfailure="no" haltonerror="no" failureproperty="test.failed" maxmemory="2048m">
<classpath refid="classpath.test" />
<test name="dk.brics.tajs.test.RunPapers"/>
</junit>
<fail message="tests failed" if="test.failed"/>
</target>
<target name="test-all" depends="compile-test">
<junit fork="true" printsummary="yes" showoutput="yes" haltonfailure="no" haltonerror="no" failureproperty="test.failed" maxmemory="2048m">
<classpath refid="classpath.test" />
<test name="dk.brics.tajs.test.RunAll" />
</junit>
<fail message="tests failed" if="test.failed"/>
</target>
<target name="test-stats-standard" depends="compile-test">
<java classname="dk.brics.tajs.test.Stats$Standard" fork="true" failonerror="true" maxmemory="2048m">
<classpath refid="classpath.test" />
</java>
</target>
<target name="test-stats-extra" depends="compile-test">
<java classname="dk.brics.tajs.test.Stats$Extra" fork="true" failonerror="true" maxmemory="2048m">
<classpath refid="classpath.test" />
</java>
</target>
<target name="test-stats-libs" depends="compile-test">
<java classname="dk.brics.tajs.test.Stats$Libs" fork="true" failonerror="true" maxmemory="8192m">
<classpath refid="classpath.test" />
</java>
</target>
<target name="publish" depends="all">
<fail message="property 'public' should be set in local-development.properties">
<condition>
<not>
<isset property="public" />
</not>
</condition>
</fail>
<fail message="option 'debug' should be disabled before publishing">
<condition>
<istrue value="${debug}" />
</condition>
</fail>
<property name="doc" value="doc-${version}" />
<property name="dist" value="dist-${version}" />
<delete dir="${public}/${doc}" />
<mkdir dir="${public}/${doc}" />
<copy todir="${public}/${doc}">
<fileset dir="doc" />
</copy>
<mkdir dir="${public}/${dist}" />
<copy todir="${public}/${dist}">
<fileset dir="dist" includes="*.jar" />
</copy>
<copy todir="${public}/${dist}">
<fileset dir="lib" />
</copy>
<chmod dir="${public}" perm="go+r" includes="${doc}/**,${doc},${dist}/**,${dist}" type="both" />
<chmod dir="${public}" perm="go+x" includes="${doc}/**,${doc},${dist}/**,${dist}" type="dir" />
</target>
<target name="dotview">
<fail message="parameter 'dotfile' missing">
<condition>
<not>
<isset property="dotfile" />
</not>
</condition>
</fail>
<fail message="property 'dot' should be set in local-development.properties">
<condition>
<not>
<isset property="dot" />
</not>
</condition>
</fail>
<fail message="property 'imgviewer' should be set in local-development.properties">
<condition>
<not>
<isset property="imgviewer" />
</not>
</condition>
</fail>
<tempfile property="temp.file" suffix=".png" destdir="${java.io.tmpdir}" />
<exec executable="${dot}">
<arg value="-Tpng" />
<arg value="-o${temp.file}" />
<arg value="${dotfile}" />
</exec>
<echo message="Created PNG: ${temp.file}" />
<exec executable="${imgviewer}" spawn="true">
<arg value="${temp.file}" />
</exec>
</target>
<target name="view-callgraph">
<antcall target="dotview">
<param name="dotfile" value="out/callgraph.dot" />
</antcall>
</target>
<target name="view-state">
<antcall target="dotview">
<param name="dotfile" value="out/state.dot" />
</antcall>
</target>
<target name="view-flowgraph">
<antcall target="dotview">
<param name="dotfile" value="out/flowgraphs/final.dot" />
</antcall>
</target>
<target name="dotfiles">
<fail message="parameter 'dotdir' missing">
<condition>
<not>
<isset property="dotdir" />
</not>
</condition>
</fail>
<fail message="property 'dot' should be set in local-development.properties">
<condition>
<not>
<isset property="dot" />
</not>
</condition>
</fail>
<fileset dir="${dotdir}" id="dotfiles">
<include name="**/*.dot" />
</fileset>
<pathconvert pathsep=" " property="dotfiles_flattened" refid="dotfiles" />
<echo message="Converting dot files: ${dotfiles_flattened}" />
<exec executable="${dot}">
<arg value="-Tpng" />
<arg value="-O" />
<arg line="${dotfiles_flattened}" />
</exec>
</target>
<target name="dot-flowgraphs">
<antcall target="dotfiles">
<param name="dotdir" value="out/flowgraphs" />
</antcall>
</target>
<target name="dot-newflows">
<antcall target="dotfiles">
<param name="dotdir" value="out/newflows" />
</antcall>
</target>
</project>