Debian Codegraph @

rhino/build.xml

raw symbols SCIP
1 <?xml version="1.0" encoding="utf-8"?>
2 <!-- This Source Code Form is subject to the terms of the Mozilla Public
3 - License, v. 2.0. If a copy of the MPL was not distributed with this
4 - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
5
6
7 <!--
8 Build file for Rhino using Ant (see http://jakarta.apache.org/ant/index.html)
9 Requires Ant version 1.2 or later
10
11 Compilation currently requires JDK 1.5 or later. Can cross-compile to
12 support JDK 1.4.
13 -->
14
15 <project name="Rhino" default="help" basedir=".">
16
17 <target name="properties">
18 <!-- Allow user to override default settings from build.properties -->
19 <property file="build.local.properties" />
20 <tstamp>
21 <!-- Specify date part of Context#getImplementationVersion() -->
22 <format property="implementation.date" pattern="yyyy MM dd"/>
23 </tstamp>
24 <property file="build.properties"/>
25
26 <property name="dist.file" value="rhino${version}.zip"/>
27 <property name="dist.source-only-zip" value="rhino${version}-sources.zip"/>
28
29 <property file="apiClasses.properties"/>
30 <property name="xmlimplsrc-build-file"
31 location="xmlimplsrc/build.xml"/>
32
33 <available property="xmlimplsrc-present?"
34 file="${xmlimplsrc-build-file}" />
35
36 </target>
37
38 <target name="init" depends="properties">
39 <mkdir dir="${build.dir}"/>
40 <mkdir dir="${classes}"/>
41 <mkdir dir="${dist.dir}"/>
42 </target>
43
44 <target name="compile" depends="init">
45 <ant antfile="src/build.xml" target="compile"/>
46 <ant antfile="toolsrc/build.xml" target="compile"/>
47 <antcall target="xmlimplsrc-compile" />
48 </target>
49
50 <target name="compile-all" depends="compile"/>
51
52 <target name="graph" depends="init">
53 <ant antfile="src/build.xml" target="graph"/>
54 </target>
55
56 <target name="shell" depends="compile">
57 <ant antfile="src/build.xml" target="shell"/>
58 </target>
59
60 <target name="copy-source" depends="init">
61 <ant antfile="src/build.xml" target="copy-source"/>
62 <ant antfile="toolsrc/build.xml" target="copy-source"/>
63 <ant antfile="testsrc/build.xml" target="copy-source"/>
64 <antcall target="xmlimplsrc-copy-source" />
65 <copy todir="${dist.dir}" file="build.xml"/>
66 <copy todir="${dist.dir}" file="build.properties"/>
67 <copy todir="${dist.dir}" file="apiClasses.properties"/>
68 <copy todir="${dist.dir}" file="LICENSE.txt"/>
69 </target>
70
71 <target name="xmlimplsrc-compile" if="xmlimplsrc-present?">
72 <echo>Calling ${xmlimplsrc-build-file}</echo>
73 <!-- Ignore compilation errors under JDK less then 1.4 -->
74 <property name="xmlimpl.compile.failonerror" value="no"/>
75 <ant antfile="${xmlimplsrc-build-file}" target="compile"/>
76 </target>
77
78 <target name="xmlimplsrc-copy-source" if="xmlimplsrc-present?">
79 <echo>Calling ${xmlimplsrc-build-file}</echo>
80 <ant antfile="${xmlimplsrc-build-file}" target="copy-source"/>
81 </target>
82
83 <target name="jar" depends="compile-all">
84 <copy todir="${classes}" file="LICENSE.txt"/>
85 <property name="jarfile" location="${dist.dir}/${rhino.jar}"/>
86 <jar jarfile="${jarfile}"
87 basedir="${classes}"
88 manifest="src/manifest"
89 compress="${jar-compression}"
90 />
91 </target>
92
93 <target name="console" depends="jar">
94 <property name="jarfile" location="${dist.dir}/${rhino.jar}"/>
95 <java jar="${jarfile}"
96 fork="true">
97 <arg line="-version 170"/>
98 </java>
99 </target>
100
101 <target name="smalljar" depends="compile">
102 <property name="smalljarfile" location="${dist.dir}/${small-rhino.jar}"/>
103 <jar basedir="${classes}" destfile="${smalljarfile}"
104 compress="${jar-compression}">
105 <include name="org/mozilla/javascript/*.class"/>
106
107 <include name="org/mozilla/javascript/debug/*.class"/>
108 <include name="org/mozilla/javascript/resources/*.properties"/>
109 <include name="org/mozilla/javascript/xml/*.class"/>
110 <include name="org/mozilla/javascript/continuations/*.class"/>
111 <include name="org/mozilla/javascript/jdk13/*.class"/>
112 <include name="org/mozilla/javascript/ast/*.class"/>
113 <include name="org/mozilla/javascript/json/*.class"/>
114 <include name="org/mozilla/javascript/annotations/*.class"/>
115 <include name="org/mozilla/javascript/v8dtoa/*.class"/>
116
117 <!-- exclude classes that uses class generation library -->
118 <exclude name="org/mozilla/javascript/JavaAdapter*.class"/>
119
120 <include name="org/mozilla/javascript/regexp/*.class"
121 unless="no-regexp"/>
122 </jar>
123 </target>
124
125 <target name="copy-examples" depends="init">
126 <mkdir dir="${dist.dir}/examples"/>
127 <copy todir="${dist.dir}/examples">
128 <fileset dir="examples" includes="**/*.java,**/*.js,**/*.html" />
129 </copy>
130 </target>
131
132 <target name="copy-misc" depends="init">
133 <filter token="datestamp" value="${TODAY}"/>
134 <copy todir="${dist.dir}" filtering="yes">
135 <fileset dir=".">
136 <patternset>
137 <include name="build-date"/>
138 </patternset>
139 </fileset>
140 </copy>
141 </target>
142
143 <target name="copy-all" depends="copy-source,copy-examples,copy-misc">
144 </target>
145
146 <target name="javadoc" depends="init">
147 <mkdir dir="${dist.dir}/javadoc"/>
148 <javadoc sourcefiles="${apiClasses}"
149 sourcepath="src"
150 destdir="${dist.dir}/javadoc"
151 version="true"
152 author="true"
153 windowtitle="${Name}" />
154 <zip destfile="${dist.dir}/javadoc.zip" basedir="${dist.dir}/javadoc"/>
155 </target>
156
157 <target name="dev-javadoc" depends="init">
158 <mkdir dir="${dist.dir}/javadoc"/>
159 <javadoc sourcepath="src"
160 destdir="${dist.dir}/javadoc"
161 version="true"
162 package="true"
163 author="true"
164 windowtitle="${Name}">
165 <fileset
166 dir="."
167 includes="**/*.java"
168 excludes="**/testsrc/**/*.java"
169 />
170 </javadoc>
171 </target>
172
173 <!--
174 Compiles and tests all sources and then creates the distribution file
175 -->
176 <target name="all" depends="deepclean,compile-all,junit-all,dist">
177 </target>
178
179 <target name="dist" depends="deepclean,jar,copy-all,javadoc">
180 <delete file="${dist.file}" />
181 <zip destfile="${dist.file}">
182 <fileset dir="${build.dir}" includes="${dist.name}/**"/>
183 </zip>
184 </target>
185
186 <target name="source-zip" depends="copy-source,copy-examples,javadoc">
187 <delete file="${dist.source-only-zip}" />
188 <zip destfile="${dist.source-only-zip}">
189 <zipfileset prefix="${dist.name}" dir="${dist.dir}">
190 <include name="*src/**"/>
191 <include name="build.xml"/>
192 <include name="*.properties"/>
193 <include name="examples/**"/>
194 </zipfileset>
195 </zip>
196 </target>
197
198 <target name="compile-debugger">
199 <ant antfile="toolsrc/build.xml" target="compile-debugger"/>
200 </target>
201
202 <target name="clean" depends="properties">
203 <delete quiet="true" file="${dist.dir}/${rhino.jar}"/>
204 <delete quiet="true" file="${dist.dir}/${small-rhino.jar}"/>
205 <delete quiet="true" dir="${build.dir}"/>
206 </target>
207
208 <target name="deepclean" depends="properties">
209 <delete quiet="true" dir="${build.dir}"/>
210 <delete quiet="true" file="${dist.file}"/>
211 <delete quiet="true" file="${dist.source-only-zip}"/>
212 </target>
213
214 <!--
215 The next two targets run the JavaScript Test Library tests. Note that these tests are quite extensive and take a long time
216 to run. They are not documented in the 'help' target for now.
217 -->
218
219 <!--
220 Run the tests using JUnit. Beware that if you are using Ant from the command-line, there are some difficulties you may
221 encounter setting this up correctly; see http://ant.apache.org/faq.html#delegating-classloader
222
223 IDEs that use Ant as the build system probably handle this fine.
224 -->
225 <target name="junit-all" depends="compile">
226 <ant antfile="testsrc/build.xml" target="junit-coveragereport"/>
227 </target>
228 <target name="junit" depends="compile">
229 <ant antfile="testsrc/build.xml" target="junit"/>
230 </target>
231
232 <target name="junit-benchmarks" depends="compile">
233 <ant antfile="testsrc/build.xml" target="junit-benchmarks"/>
234 </target>
235
236 <!--
237 Run the tests using the Java port of jsdriver.pl. Note that running this port
238 from the command-line may be more useful running this Ant target, as running
239 from the command line allows configuration options, such as running with a
240 non-default optimization level, or running only a subset of the tests.
241 -->
242 <target name="jsdriver-run" depends="compile">
243 <ant antfile="testsrc/build.xml" target="jsdriver" />
244 </target>
245
246 <!--
247 Compile the JsDriver test driver.
248 -->
249 <target name="jsdriver" depends="compile">
250 <ant antfile="testsrc/build.xml" target="clean" />
251 <ant antfile="testsrc/build.xml" target="compile" />
252 </target>
253
254 <target name="benchmark-v8-opt-1" depends="jar">
255 <property name="jarfile" location="${dist.dir}/${rhino.jar}"/>
256 <java jar="${jarfile}" dir="testsrc/benchmarks/v8-benchmarks-v5" fork="true">
257 <jvmarg value="-server"/>
258 <arg line="-opt -1 run.js"/>
259 </java>
260 </target>
261
262 <target name="benchmark-v8-opt0" depends="jar">
263 <property name="jarfile" location="${dist.dir}/${rhino.jar}"/>
264 <java jar="${jarfile}" dir="testsrc/benchmarks/v8-benchmarks-v5" fork="true">
265 <jvmarg value="-server"/>
266 <arg line="-opt 0 run.js"/>
267 </java>
268 </target>
269
270 <target name="benchmark-v8-opt9" depends="jar">
271 <property name="jarfile" location="${dist.dir}/${rhino.jar}"/>
272 <java jar="${jarfile}" dir="testsrc/benchmarks/v8-benchmarks-v5" fork="true">
273 <jvmarg value="-server"/>
274 <arg line="-opt 9 run.js"/>
275 </java>
276 </target>
277
278 <target name="benchmark-sunspider-opt-1" depends="jar">
279 <property name="jarfile" location="${dist.dir}/${rhino.jar}"/>
280 <java jar="${jarfile}" dir="testsrc/benchmarks/sunspider-0.9.1" fork="true">
281 <jvmarg value="-server"/>
282 <arg line="-opt -1 run.js"/>
283 </java>
284 </target>
285
286 <target name="benchmark-sunspider-opt0" depends="jar">
287 <property name="jarfile" location="${dist.dir}/${rhino.jar}"/>
288 <java jar="${jarfile}" dir="testsrc/benchmarks/sunspider-0.9.1" fork="true">
289 <jvmarg value="-server"/>
290 <arg line="-opt 0 run.js"/>
291 </java>
292 </target>
293
294 <target name="benchmark-sunspider-opt9" depends="jar">
295 <property name="jarfile" location="${dist.dir}/${rhino.jar}"/>
296 <java jar="${jarfile}" dir="testsrc/benchmarks/sunspider-0.9.1" fork="true">
297 <jvmarg value="-server"/>
298 <arg line="-opt 9 run.js"/>
299 </java>
300 </target>
301
302 <target name="help" depends="properties">
303 <echo>The following targets are available with this build file:
304
305 clean remove all compiled classes and copied property files
306
307 compile compile classes and copy all property files
308 into ${classes} directory
309 excluding deprecated code
310
311 compile-all compile all classes and copy all property files
312 into ${classes} directory
313 including deprecated code
314
315 deepclean remove all generated files and directories
316
317 dist create ${dist.file} with full Rhino distribution
318
319 help print this help
320
321 jar create ${rhino.jar} in ${dist.dir}
322
323 smalljar create ${small-rhino.jar} in ${dist.dir} with
324 minimalist set of Rhino classes. See footprint.html
325 from the doc directory for details.
326
327 javadoc generate Rhino API documentation
328 in ${dist.dir}/javadoc
329
330 source-zip create ${dist.source-only-zip} with all Rhino
331 source files necessary to recreate ${dist.file}
332 </echo>
333 </target>
334
335 </project>