forked from cs-au-dk/TAJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
279 lines (255 loc) · 10.7 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
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="TAJS" default="all" basedir=".">
<property name="project" value="tajs" />
<property name="version" value="0.9" />
<property name="release" value="1" />
<property name="optimize" value="on" />
<property name="debug" value="off" />
<property file="local.properties" />
<path id="classpath">
<fileset dir="." includes="lib/**/*.jar" />
</path>
<path id="classpath.test">
<fileset dir="." includes="lib/**/*.jar" />
<pathelement location="build" />
</path>
<target name="all" depends="clean,jar-all,doc" />
<target name="compile">
<!--
<property name="cp" refid="classpath"/>
<echo message="Classpath is ${cp}"/>
-->
<mkdir dir="build" />
<javac srcdir="src" includes="**" destdir="build" optimize="${optimize}"
debug="${debug}" includeantruntime="false" source="1.7">
<classpath refid="classpath" />
<compilerarg line="-encoding ISO-8859-1" compiler="modern" />
<!--
<compilerarg line="-Xlint -Xlint:-serial -Xlint:-path" compiler="modern" />
-->
</javac>
</target>
<target name="jar" depends="compile">
<mkdir dir="dist" />
<jar jarfile="dist/${project}.jar" basedir="build" includes="**" />
</target>
<target name="jar-all" depends="jar">
<mkdir dir="temp" />
<unzip src="lib/jtidy.jar" dest="temp" />
<unzip src="lib/jdom-1.1.1.jar" dest="temp" />
<unzip src="lib/jdom-contrib-1.1.1.jar" dest="temp" />
<unzip src="lib/compiler.jar" dest="temp" />
<unzip src="lib/log4j.jar" dest="temp" />
<unzip src="dist/${project}.jar" dest="temp" />
<jar jarfile="dist/${project}-all.jar" basedir="temp" includes="**/*.*">
<manifest>
<attribute name="Main-Class" value="dk.brics.tajs.Main" />
</manifest>
</jar>
<delete dir="temp" />
</target>
<target name="clean">
<delete dir="build" />
<delete dir="doc" />
<delete dir="flowgraphs" />
<delete file="javascript.js" />
</target>
<target name="doc" depends="jar">
<mkdir dir="doc" />
<javadoc packagenames="dk.brics.tajs,
dk.brics.tajs.analysis,
dk.brics.tajs.analysis.js,
dk.brics.tajs.analysis.nativeobjects,
dk.brics.tajs.analysis.uneval,
dk.brics.tajs.flowgraph,
dk.brics.tajs.flowgraph.jsnodes,
dk.brics.tajs.js2flowgraph,
dk.brics.tajs.htmlparser,
dk.brics.tajs.lattice,
dk.brics.tajs.monitoring,
dk.brics.tajs.options,
dk.brics.tajs.solver,
dk.brics.tajs.unevalizer,
dk.brics.tajs.util,
dk.brics.tajs.gui"
overview="src/overview.html" Package="true" sourcepath="src" destdir="doc" nodeprecated="true" author="true" notree="true" nohelp="true" windowtitle="TAJS">
<doctitle>
<![CDATA[Type Analyzer for JavaScript (TAJS) API Specification]]>
</doctitle>
<bottom><![CDATA[<i> Copyright © 2012 Aarhus University </i>]]></bottom>
<link href="http://docs.oracle.com/javase/6/docs/api/" />
<link href="http://www.mozilla.org/rhino/apidocs/" />
<classpath refid="classpath" />
</javadoc>
</target>
<target name="zip" depends="clean,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,COPYING,build.xml" />
</copy>
<copy file="dist/${project}.jar" todir="${dir}/dist" />
<mkdir dir="${dir}/doc" />
<copy todir="${dir}/doc">
<fileset dir="doc" />
</copy>
<mkdir dir="${dir}/src" />
<copy todir="${dir}/src">
<fileset dir="src" includes="dk/**,*.txt" excludes="**/*.class" />
</copy>
<zip zipfile="dist/${dir}-${release}.zip" basedir="." includes="${dir}/**" />
<!--
<tar tarfile="${dir}-${release}.tar" basedir="." includes="${dir}/**" />
<gzip zipfile="${dir}-${release}.tar.gz" src="${dir}-${release}.tar" />
<delete file="${dir}-${release}.tar" />
-->
<delete dir="${dir}" />
</target>
<target name="test">
<javac srcdir="test/src" includes="**" destdir="build" optimize="${optimize}" debug="${debug}"
includeantruntime="false" source="1.7">
<classpath refid="classpath" />
<compilerarg line="-encoding ISO-8859-1" compiler="modern" />
<compilerarg line="-Xlint -Xlint:-serial -Xlint:-path" compiler="modern" />
</javac>
<junit fork="true" printsummary="yes" showoutput="yes" haltonfailure="no" haltonerror="no">
<classpath refid="classpath.test" />
<test name="dk.brics.tajs.test.RunRegression" />
</junit>
</target>
<target name="test-all" depends="clean,compile">
<javac srcdir="test/src" includes="**" destdir="build" optimize="${optimize}" debug="${debug}"
includeantruntime="false" source="1.7">
<classpath refid="classpath" />
<compilerarg line="-encoding ISO-8859-1" compiler="modern" />
<compilerarg line="-Xlint -Xlint:-serial -Xlint:-path" compiler="modern" />
</javac>
<junit fork="true" printsummary="yes" showoutput="yes" haltonfailure="no" haltonerror="no">
<classpath refid="classpath.test" />
<test name="dk.brics.tajs.test.RunAll" />
</junit>
</target>
<target name="publish" depends="all">
<fail message="property 'public' should be set in local.properties">
<condition>
<not>
<isset property="public" />
</not>
</condition>
</fail>
<fail message="option 'debug' should be disabled before publishing">
<condition>
<istrue value="${debug}" />
</condition>
</fail>
<delete dir="${public}/doc" />
<mkdir dir="${public}/doc" />
<copy todir="${public}/doc">
<fileset dir="doc" />
</copy>
<mkdir dir="${public}/dist" />
<copy todir="${public}/dist">
<!-- NOTE: excluding zip at publish
<fileset dir="dist" includes="*.zip" />
-->
<fileset dir="dist" includes="*.jar" />
</copy>
<copy file="${public}/dist/${project}.jar" tofile="${public}/dist/${project}-${version}-${release}.jar" />
<copy file="${public}/dist/${project}-all.jar" tofile="${public}/dist/${project}-${version}-${release}-all.jar" />
<mkdir dir="${public}/lib" />
<copy todir="${public}/lib">
<fileset dir="lib" />
</copy>
<chmod dir="${public}" perm="go+r" includes="doc/**,doc,dist/**,dist,lib/**,lib,*.zip" type="both" />
<chmod dir="${public}" perm="go+x" includes="dist/**,dist,lib/**,lib" 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.properties">
<condition>
<not>
<isset property="dot" />
</not>
</condition>
</fail>
<fail message="property 'imgviewer' should be set in local.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.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>