18 2 along with this work; if not, write to the Free Software Foundation,
19 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
21 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 or visit www.oracle.com if you need additional information or have any
23 questions.
24 -->
25
26 <project name="nashorn" default="test" basedir="..">
27 <import file="build-nasgen.xml"/>
28 <import file="code_coverage.xml"/>
29
30 <target name="init-conditions">
31 <!-- loading locally defined resources and properties. NB they owerwrite default ones defined later -->
32 <property file="${user.home}/.nashorn.project.local.properties"/>
33
34 <loadproperties srcFile="make/project.properties"/>
35 <path id="nashorn.jar.path">
36 <pathelement location="${nashorn.jar}"/>
37 </path>
38 <property name="nashorn.override.option" value="-Xpatch:${build.classes.dir}"/>
39 <condition property="svn.executable" value="/usr/local/bin/svn" else="svn">
40 <available file="/usr/local/bin/svn"/>
41 </condition>
42 <condition property="hg.executable" value="/usr/local/bin/hg" else="hg">
43 <available file="/usr/local/bin/hg"/>
44 </condition>
45 <condition property="git.executable" value="/usr/local/bin/git" else="git">
46 <available file="/usr/local/bin/git"/>
47 </condition>
48 <!-- check if TestNG and dependencies are available, and download them if they aren't -->
49 <antcall target="get-testng"/>
50 <condition property="testng.available" value="true">
51 <and>
52 <available file="${file.reference.testng.jar}"/>
53 <available file="${file.reference.jcommander.jar}"/>
54 <available file="${file.reference.bsh.jar}"/>
55 <available file="${file.reference.snakeyaml.jar}"/>
56 </and>
57 </condition>
58
159 <target name="clean" depends="init, clean-nasgen, init-cc-cleanup">
160 <delete includeemptydirs="true">
161 <fileset dir="${build.dir}" erroronmissingdir="false"/>
162 </delete>
163 <delete dir="${dist.dir}"/>
164 </target>
165
166 <target name="compile" depends="prepare" description="Compiles nashorn">
167 <javac srcdir="${dynalink.module.src.dir}"
168 destdir="${dynalink.module.classes.dir}"
169 source="${javac.source}"
170 target="${javac.target}"
171 debug="${javac.debug}"
172 encoding="${javac.encoding}"
173 includeantruntime="false" fork="true">
174 <compilerarg value="-Xlint:all"/>
175 <compilerarg value="-XDignore.symbol.file"/>
176 <compilerarg value="-Xdiags:verbose"/>
177 <compilerarg value="-parameters"/>
178 </javac>
179 <javac srcdir="${nashorn.module.src.dir}"
180 destdir="${nashorn.module.classes.dir}"
181 source="${javac.source}"
182 target="${javac.target}"
183 debug="${javac.debug}"
184 encoding="${javac.encoding}"
185 includeantruntime="false" fork="true">
186 <compilerarg value="-Xlint:all"/>
187 <compilerarg value="-XDignore.symbol.file"/>
188 <compilerarg value="-Xdiags:verbose"/>
189 <compilerarg value="-parameters"/>
190 <compilerarg value="${nashorn.override.option}"/>
191 </javac>
192 <javac srcdir="${nashorn.shell.module.src.dir}"
193 destdir="${nashorn.shell.module.classes.dir}"
194 source="${javac.source}"
195 target="${javac.target}"
196 debug="${javac.debug}"
197 encoding="${javac.encoding}"
198 includeantruntime="false" fork="true">
199 <compilerarg value="-Xlint:all"/>
200 <compilerarg value="-XDignore.symbol.file"/>
201 <compilerarg value="-Xdiags:verbose"/>
202 <compilerarg value="-parameters"/>
203 <compilerarg value="${nashorn.override.option}"/>
204 </javac>
205 <!-- -Xpatch does not like module-info.class files! -->
206 <delete>
207 <fileset dir="${build.classes.dir}" includes="**/module-info.class"/>
208 </delete>
209 <copy todir="${nashorn.module.classes.dir}/jdk/nashorn/api/scripting/resources">
210 <fileset dir="${nashorn.module.src.dir}/jdk/nashorn/api/scripting/resources/"/>
211 </copy>
212 <copy todir="${nashorn.module.classes.dir}/jdk/nashorn/internal/runtime/resources">
213 <fileset dir="${nashorn.module.src.dir}/jdk/nashorn/internal/runtime/resources/"/>
214 </copy>
215 <copy todir="${nashorn.module.classes.dir}/jdk/nashorn/tools/resources">
216 <fileset dir="${nashorn.module.src.dir}/jdk/nashorn/tools/resources/"/>
217 </copy>
218 <copy file="${dynalink.module.src.dir}/jdk/dynalink/support/messages.properties" todir="${dynalink.module.classes.dir}/jdk/dynalink/support"/>
219 <copy file="${nashorn.module.src.dir}/jdk/nashorn/internal/codegen/anchor.properties" todir="${nashorn.module.classes.dir}/jdk/nashorn/internal/codegen"/>
220
221 <echo message="version_string=${nashorn.fullversion}" file="${nashorn.module.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties"/>
222 <echo file="${nashorn.module.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties" append="true">${line.separator}</echo>
223 <echo message="version_short=${nashorn.version}" file="${nashorn.module.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties" append="true"/>
331 <target name="dist" depends="jar">
332 <zip destfile="${build.zip}" basedir=".."
333 excludes="nashorn/bin/*.sh" includes="nashorn/bin/** nashorn/dist/**"/>
334 <tar destfile="${build.gzip}" basedir=".." compression="gzip"
335 excludes="nashorn/bin/*.sh" includes="nashorn/bin/** nashorn/dist/**"/>
336 </target>
337
338 <target name="compile-test" depends="compile, run-nasgen" if="testng.available">
339 <!-- testng task -->
340 <taskdef name="testng" classname="org.testng.TestNGAntTask"
341 classpath="${testng.ant.classpath}"/>
342
343 <javac srcdir="${test.src.dir}"
344 destdir="${build.test.classes.dir}"
345 classpath="${javac.test.classpath}"
346 source="${javac.source}"
347 target="${javac.target}"
348 debug="${javac.debug}"
349 encoding="${javac.encoding}"
350 includeantruntime="false" fork="true">
351 <compilerarg value="${nashorn.override.option}"/>
352 <compilerarg value="-Xlint:unchecked"/>
353 <compilerarg value="-Xlint:deprecation"/>
354 <compilerarg value="-Xdiags:verbose"/>
355 <compilerarg value="-XaddExports:${test.module.imports}"/>
356 </javac>
357
358 <copy todir="${build.test.classes.dir}/META-INF/services">
359 <fileset dir="${test.src.dir}/META-INF/services/"/>
360 </copy>
361
362 <copy todir="${build.test.classes.dir}/jdk/nashorn/internal/runtime/test/resources">
363 <fileset dir="${test.src.dir}/jdk/nashorn/internal/runtime/test/resources"/>
364 </copy>
365
366 <copy todir="${build.test.classes.dir}/jdk/nashorn/internal/runtime/doubleconv/test/resources">
367 <fileset dir="${test.src.dir}/jdk/nashorn/internal/runtime/doubleconv/test/resources"/>
368 </copy>
369
370 <copy todir="${build.test.classes.dir}/jdk/nashorn/api/scripting/test/resources">
371 <fileset dir="${test.src.dir}/jdk/nashorn/api/scripting/test/resources"/>
372 </copy>
373
374 <!-- tests that check nashorn internals and internal API -->
375 <jar jarfile="${nashorn.internal.tests.jar}">
|
18 2 along with this work; if not, write to the Free Software Foundation,
19 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
21 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 or visit www.oracle.com if you need additional information or have any
23 questions.
24 -->
25
26 <project name="nashorn" default="test" basedir="..">
27 <import file="build-nasgen.xml"/>
28 <import file="code_coverage.xml"/>
29
30 <target name="init-conditions">
31 <!-- loading locally defined resources and properties. NB they owerwrite default ones defined later -->
32 <property file="${user.home}/.nashorn.project.local.properties"/>
33
34 <loadproperties srcFile="make/project.properties"/>
35 <path id="nashorn.jar.path">
36 <pathelement location="${nashorn.jar}"/>
37 </path>
38 <condition property="svn.executable" value="/usr/local/bin/svn" else="svn">
39 <available file="/usr/local/bin/svn"/>
40 </condition>
41 <condition property="hg.executable" value="/usr/local/bin/hg" else="hg">
42 <available file="/usr/local/bin/hg"/>
43 </condition>
44 <condition property="git.executable" value="/usr/local/bin/git" else="git">
45 <available file="/usr/local/bin/git"/>
46 </condition>
47 <!-- check if TestNG and dependencies are available, and download them if they aren't -->
48 <antcall target="get-testng"/>
49 <condition property="testng.available" value="true">
50 <and>
51 <available file="${file.reference.testng.jar}"/>
52 <available file="${file.reference.jcommander.jar}"/>
53 <available file="${file.reference.bsh.jar}"/>
54 <available file="${file.reference.snakeyaml.jar}"/>
55 </and>
56 </condition>
57
158 <target name="clean" depends="init, clean-nasgen, init-cc-cleanup">
159 <delete includeemptydirs="true">
160 <fileset dir="${build.dir}" erroronmissingdir="false"/>
161 </delete>
162 <delete dir="${dist.dir}"/>
163 </target>
164
165 <target name="compile" depends="prepare" description="Compiles nashorn">
166 <javac srcdir="${dynalink.module.src.dir}"
167 destdir="${dynalink.module.classes.dir}"
168 source="${javac.source}"
169 target="${javac.target}"
170 debug="${javac.debug}"
171 encoding="${javac.encoding}"
172 includeantruntime="false" fork="true">
173 <compilerarg value="-Xlint:all"/>
174 <compilerarg value="-XDignore.symbol.file"/>
175 <compilerarg value="-Xdiags:verbose"/>
176 <compilerarg value="-parameters"/>
177 </javac>
178 <!-- -Xpatch does not like module-info.class files! -->
179 <delete>
180 <fileset dir="${build.classes.dir}" includes="**/module-info.class"/>
181 </delete>
182 <javac srcdir="${nashorn.module.src.dir}"
183 destdir="${nashorn.module.classes.dir}"
184 source="${javac.source}"
185 target="${javac.target}"
186 debug="${javac.debug}"
187 encoding="${javac.encoding}"
188 includeantruntime="false" fork="true">
189 <compilerarg value="-Xlint:all"/>
190 <compilerarg value="-XDignore.symbol.file"/>
191 <compilerarg value="-Xdiags:verbose"/>
192 <compilerarg value="-parameters"/>
193 <compilerarg line="${nashorn.override.option}"/>
194 </javac>
195 <!-- -Xpatch does not like module-info.class files! -->
196 <delete>
197 <fileset dir="${build.classes.dir}" includes="**/module-info.class"/>
198 </delete>
199 <javac srcdir="${nashorn.shell.module.src.dir}"
200 destdir="${nashorn.shell.module.classes.dir}"
201 source="${javac.source}"
202 target="${javac.target}"
203 debug="${javac.debug}"
204 encoding="${javac.encoding}"
205 includeantruntime="false" fork="true">
206 <compilerarg value="-Xlint:all"/>
207 <compilerarg value="-XDignore.symbol.file"/>
208 <compilerarg value="-Xdiags:verbose"/>
209 <compilerarg value="-parameters"/>
210 <compilerarg line="${nashorn.override.option}"/>
211 </javac>
212 <!-- -Xpatch does not like module-info.class files! -->
213 <delete>
214 <fileset dir="${build.classes.dir}" includes="**/module-info.class"/>
215 </delete>
216 <copy todir="${nashorn.module.classes.dir}/jdk/nashorn/api/scripting/resources">
217 <fileset dir="${nashorn.module.src.dir}/jdk/nashorn/api/scripting/resources/"/>
218 </copy>
219 <copy todir="${nashorn.module.classes.dir}/jdk/nashorn/internal/runtime/resources">
220 <fileset dir="${nashorn.module.src.dir}/jdk/nashorn/internal/runtime/resources/"/>
221 </copy>
222 <copy todir="${nashorn.module.classes.dir}/jdk/nashorn/tools/resources">
223 <fileset dir="${nashorn.module.src.dir}/jdk/nashorn/tools/resources/"/>
224 </copy>
225 <copy file="${dynalink.module.src.dir}/jdk/dynalink/support/messages.properties" todir="${dynalink.module.classes.dir}/jdk/dynalink/support"/>
226 <copy file="${nashorn.module.src.dir}/jdk/nashorn/internal/codegen/anchor.properties" todir="${nashorn.module.classes.dir}/jdk/nashorn/internal/codegen"/>
227
228 <echo message="version_string=${nashorn.fullversion}" file="${nashorn.module.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties"/>
229 <echo file="${nashorn.module.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties" append="true">${line.separator}</echo>
230 <echo message="version_short=${nashorn.version}" file="${nashorn.module.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties" append="true"/>
338 <target name="dist" depends="jar">
339 <zip destfile="${build.zip}" basedir=".."
340 excludes="nashorn/bin/*.sh" includes="nashorn/bin/** nashorn/dist/**"/>
341 <tar destfile="${build.gzip}" basedir=".." compression="gzip"
342 excludes="nashorn/bin/*.sh" includes="nashorn/bin/** nashorn/dist/**"/>
343 </target>
344
345 <target name="compile-test" depends="compile, run-nasgen" if="testng.available">
346 <!-- testng task -->
347 <taskdef name="testng" classname="org.testng.TestNGAntTask"
348 classpath="${testng.ant.classpath}"/>
349
350 <javac srcdir="${test.src.dir}"
351 destdir="${build.test.classes.dir}"
352 classpath="${javac.test.classpath}"
353 source="${javac.source}"
354 target="${javac.target}"
355 debug="${javac.debug}"
356 encoding="${javac.encoding}"
357 includeantruntime="false" fork="true">
358 <compilerarg line="${nashorn.override.option}"/>
359 <compilerarg value="-Xlint:unchecked"/>
360 <compilerarg value="-Xlint:deprecation"/>
361 <compilerarg value="-Xdiags:verbose"/>
362 <compilerarg line="${test.module.imports}"/>
363 </javac>
364
365 <copy todir="${build.test.classes.dir}/META-INF/services">
366 <fileset dir="${test.src.dir}/META-INF/services/"/>
367 </copy>
368
369 <copy todir="${build.test.classes.dir}/jdk/nashorn/internal/runtime/test/resources">
370 <fileset dir="${test.src.dir}/jdk/nashorn/internal/runtime/test/resources"/>
371 </copy>
372
373 <copy todir="${build.test.classes.dir}/jdk/nashorn/internal/runtime/doubleconv/test/resources">
374 <fileset dir="${test.src.dir}/jdk/nashorn/internal/runtime/doubleconv/test/resources"/>
375 </copy>
376
377 <copy todir="${build.test.classes.dir}/jdk/nashorn/api/scripting/test/resources">
378 <fileset dir="${test.src.dir}/jdk/nashorn/api/scripting/test/resources"/>
379 </copy>
380
381 <!-- tests that check nashorn internals and internal API -->
382 <jar jarfile="${nashorn.internal.tests.jar}">
|