-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
251 lines (230 loc) · 8.55 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
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="TAJS" default="all" basedir=".">
<property name="project" value="tajs"/>
<property name="version" value="1.0"/>
<property name="release" value="pre3"/>
<property name="optimize" value="on"/>
<property name="debug" value="off"/>
<property file="local.properties"/>
<path id="classpath">
<fileset dir="." includes="lib/**/*.jar"/>
</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="**" source="1.6" target="1.6" destdir="build" optimize="${optimize}" debug="${debug}">
<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/js.jar" dest="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="dist/${project}.jar" dest="temp" />
<jar jarfile="dist/${project}-all.jar" manifest="manifest.txt" basedir="temp" includes="**/*.*" />
<delete dir="temp" />
</target>
<target name="clean">
<delete dir="build"/>
<delete dir="doc"/>
<delete dir="flowgraphs"/>
<delete file="javascript.js"/>
</target>
<target name="rebuild" depends="clean, compile">
</target>
<target name="doc" depends="jar">
<mkdir dir="doc"/>
<javadoc packagenames="dk.brics.tajs,
dk.brics.tajs.analysis,
dk.brics.tajs.analysis.dom,
dk.brics.tajs.analysis.dom.ajax,
dk.brics.tajs.analysis.dom.core,
dk.brics.tajs.analysis.dom.event,
dk.brics.tajs.analysis.dom.html,
dk.brics.tajs.analysis.dom.html5,
dk.brics.tajs.analysis.dom.style,
dk.brics.tajs.analysis.dom.view,
dk.brics.tajs.analysis.nativeobjects,
dk.brics.tajs.dependency,
dk.brics.tajs.dependency.graph,
dk.brics.tajs.dependency.graph.interfaces,
dk.brics.tajs.dependency.graph.nodes,
dk.brics.tajs.dependency.graph.visitor,
dk.brics.tajs.dependency.interfaces,
dk.brics.tajs.flowgraph,
dk.brics.tajs.flowgraph.nodes,
dk.brics.tajs.js2flowgraph,
dk.brics.tajs.lattice,
dk.brics.tajs.optimizer,
dk.brics.tajs.optimizer.dataflow,
dk.brics.tajs.options,
dk.brics.tajs.solver,
dk.brics.tajs.util,
dk.brics.tajs.gui"
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 © 2008-2010 Anders Møller, Simon Holm Jensen, Peter Thiemann, Magnus Madsen, Matthias Diehn Ingesman, Roman Matthias Keil. </i>]]></bottom>
<link href="http://java.sun.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-all" depends="rebuild">
<junit fork="true" printsummary="yes" showoutput="yes" haltonfailure="no" haltonerror="no">
<classpath refid="classpath"/>
<test name="dk.brics.tajs.test.TestMicro"/>
<test name="dk.brics.tajs.test.TestDOM"/>
</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 'gifviewer' should be set in local.properties">
<condition>
<not>
<isset property="gifviewer"/>
</not>
</condition>
</fail>
<tempfile property="temp.file" suffix=".gif" destdir="${java.io.tmpdir}"/>
<exec executable="${dot}">
<arg value="-Tgif"/>
<arg value="-o${temp.file}"/>
<arg value="${dotfile}"/>
</exec>
<echo message="Created GIF: ${temp.file}"/>
<exec executable="${gifviewer}" 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/flowgraph.dot"/>
</antcall>
</target>
<target name="dot-flowgraphs">
<fail message="property 'dot' should be set in local.properties">
<condition>
<not>
<isset property="dot"/>
</not>
</condition>
</fail>
<fileset dir="out/flowgraphs" 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="-Tgif"/>
<arg value="-O"/>
<arg line="${dotfiles_flattened}"/>
</exec>
</target>
</project>