2012-12-21 20:36:24 +00:00
<?xml version="1.0" encoding="UTF-8"?>
2014-05-28 11:58:46 +00:00
2012-12-21 20:36:24 +00:00
<!--
2015-06-02 12:35:03 +00:00
Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
2012-12-21 20:36:24 +00:00
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 only, as
published by the Free Software Foundation.
This code is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
version 2 for more details (a copy is included in the LICENSE file that
accompanied this code).
You should have received a copy of the GNU General Public License version
2 along with this work; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
or visit www.oracle.com if you need additional information or have any
questions.
-->
2014-05-28 11:58:46 +00:00
2017-09-12 17:03:56 +00:00
<project name= "nashorn" default= "test" basedir= "../.." >
2012-12-21 20:36:24 +00:00
<import file= "build-nasgen.xml" />
2013-02-22 10:27:40 +00:00
<import file= "code_coverage.xml" />
2016-07-19 11:12:50 +00:00
<target name= "load-properties" >
2016-12-02 13:39:13 +00:00
<!-- set default values to run.test.jvmargs.external property -->
<condition property= "run.test.jvmargs.external" value= "" >
<not > <isset property= "run.test.jvmargs.external" /> </not>
</condition>
2013-02-22 10:27:40 +00:00
<!-- loading locally defined resources and properties. NB they owerwrite default ones defined later -->
<property file= "${user.home}/.nashorn.project.local.properties" />
2012-12-21 20:36:24 +00:00
2017-09-12 17:03:56 +00:00
<loadproperties srcFile= "make/nashorn/project.properties" />
2016-07-19 11:12:50 +00:00
</target>
<target name= "init-conditions" depends= "load-properties" >
2016-03-17 19:04:35 +00:00
<path id= "nashorn.jar.path" >
<pathelement location= "${nashorn.jar}" />
2014-08-25 13:38:53 +00:00
</path>
2013-01-09 17:02:40 +00:00
<condition property= "svn.executable" value= "/usr/local/bin/svn" else= "svn" >
<available file= "/usr/local/bin/svn" />
</condition>
<condition property= "hg.executable" value= "/usr/local/bin/hg" else= "hg" >
<available file= "/usr/local/bin/hg" />
</condition>
2014-03-28 07:54:07 +00:00
<condition property= "git.executable" value= "/usr/local/bin/git" else= "git" >
<available file= "/usr/local/bin/git" />
</condition>
2016-02-12 16:00:54 +00:00
<!-- check if TestNG and dependencies are available, and download them if they aren't -->
2015-07-22 07:28:28 +00:00
<antcall target= "get-testng" />
2016-02-12 16:00:54 +00:00
<condition property= "testng.available" value= "true" >
<and >
<available file= "${file.reference.testng.jar}" />
<available file= "${file.reference.jcommander.jar}" />
<available file= "${file.reference.bsh.jar}" />
<available file= "${file.reference.snakeyaml.jar}" />
</and>
</condition>
2015-11-24 09:19:34 +00:00
2015-12-14 13:02:59 +00:00
<!-- check if asmtools - 6.0.jar is available, and download it if it isn't -->
2015-11-24 09:19:34 +00:00
<!--
<available property= "asmtools.already.present" file= "${file.reference.asmtools.jar}" />
<antcall target= "get-asmtools" />
<available property= "asmtools.available" file= "${file.reference.asmtools.jar}" />
-->
2016-02-12 16:00:54 +00:00
<!-- check if Jemmy ang TestNG are avaiable -->
2013-10-21 09:31:03 +00:00
<condition property= "jemmy.jfx.testng.available" value= "true" >
2014-05-28 11:58:46 +00:00
<and >
2013-10-21 09:31:03 +00:00
<available file= "${file.reference.jemmyfx.jar}" />
<available file= "${file.reference.jemmycore.jar}" />
<available file= "${file.reference.jemmyawtinput.jar}" />
<available file= "${file.reference.jfxrt.jar}" />
<isset property= "testng.available" />
</and>
</condition>
2013-02-22 10:27:40 +00:00
2013-07-26 11:50:52 +00:00
<!-- enable/disable make code coverage -->
<condition property= "cc.enabled" >
<istrue value= "${make.code.coverage}" />
</condition>
2013-07-16 20:40:15 +00:00
<!-- exclude tests in exclude lists -->
2017-09-12 17:03:56 +00:00
<condition property= "exclude.list" value= "${nashorn.make.dir}/exclude/exclude_list_cc.txt" else= "${nashorn.make.dir}/exclude/exclude_list.txt" >
2013-07-16 20:40:15 +00:00
<istrue value= "${make.code.coverage}" />
</condition>
2013-11-25 13:10:02 +00:00
<condition property= "jfr.options" value= "${run.test.jvmargs.jfr}" else= "" >
<istrue value= "${jfr}" />
</condition>
2015-12-14 13:02:59 +00:00
<condition property= "test-sys-prop-no-security.os.not.windows" >
<not >
<os family= "windows" />
</not>
</condition>
2016-03-21 11:38:23 +00:00
<!-- set windows cygwin/cmd specific properties -->
<property environment= "env" />
<condition property= "test-sys-prop-no-security.os.not.windows.cmd" >
<not >
<and >
<os family= "windows" />
<not >
<isset property= "env.SHELL" />
</not>
</and>
</not>
</condition>
</target>
2014-10-20 07:57:22 +00:00
2017-11-28 14:55:50 +00:00
<!-- check minimum ant version required to be 1.9.5 -->
2014-10-20 07:57:22 +00:00
<target name= "check-ant-version" >
2017-11-28 14:55:50 +00:00
<property name= "ant.version.required" value= "1.9.5" />
2014-10-20 07:57:22 +00:00
<antversion property= "ant.current.version" />
2017-11-28 14:55:50 +00:00
<fail message= "The current ant version, ${ant.current.version}, is too old. Please use 1.9.5 or above." >
2014-10-20 07:57:22 +00:00
<condition >
<not >
<antversion atleast= "${ant.version.required}" />
</not>
</condition>
</fail>
</target>
<target name= "check-java-version" >
<!-- look for a Class that is available only in jdk1.8 or above -->
<!-- core/exposed API class is better than an implementation class -->
<available property= "jdk1.8+" classname= "java.util.stream.Stream" />
<!-- need jdk1.8 or above -->
<fail message= "Unsupported Java version: ${ant.java.version}. Please use Java version 1.8 or greater." unless= "jdk1.8+" >
</fail>
</target>
2015-03-09 14:44:10 +00:00
2014-10-20 07:57:22 +00:00
<target name= "init" depends= "check-ant-version, check-java-version, init-conditions, init-cc" >
2013-07-26 11:50:52 +00:00
<!-- extends jvm args -->
2013-11-25 13:10:02 +00:00
<property name= "run.test.jvmargs" value= "${run.test.jvmargs.main} ${run.test.cc.jvmargs} ${jfr.options}" />
<property name= "run.test.jvmargs.octane" value= "${run.test.jvmargs.octane.main} ${run.test.cc.jvmargs} ${jfr.options}" />
2013-02-22 10:27:40 +00:00
<echo message= "run.test.jvmargs=${run.test.jvmargs}" />
<echo message= "run.test.jvmargs.octane=${run.test.jvmargs.octane}" />
2013-09-19 13:39:01 +00:00
<echo message= "run.test.xms=${run.test.xms}" />
<echo message= "run.test.xmx=${run.test.xmx}" />
2013-02-22 10:27:40 +00:00
2012-12-21 20:36:24 +00:00
</target>
<target name= "prepare" depends= "init" >
<mkdir dir= "${build.dir}" />
<mkdir dir= "${build.classes.dir}" />
2016-03-17 19:04:35 +00:00
<mkdir dir= "${nashorn.module.classes.dir}" />
<mkdir dir= "${dynalink.module.classes.dir}" />
<mkdir dir= "${nashorn.shell.module.classes.dir}" />
<mkdir dir= "${nashorn.module.classes.dir}/META-INF/services" />
2012-12-21 20:36:24 +00:00
<mkdir dir= "${build.test.classes.dir}" />
<mkdir dir= "${dist.dir}" />
<mkdir dir= "${dist.javadoc.dir}" />
</target>
2013-02-22 10:27:40 +00:00
<target name= "clean" depends= "init, clean-nasgen, init-cc-cleanup" >
2012-12-21 20:36:24 +00:00
<delete includeemptydirs= "true" >
2013-02-14 12:22:26 +00:00
<fileset dir= "${build.dir}" erroronmissingdir= "false" />
2012-12-21 20:36:24 +00:00
</delete>
<delete dir= "${dist.dir}" />
2017-09-12 17:03:56 +00:00
<delete dir= "${jdk.build.dir}/nashorn_code_cache" />
<delete file= "${basedir}/NashornProfile.txt" />
2012-12-21 20:36:24 +00:00
</target>
2014-10-20 07:57:22 +00:00
<target name= "compile" depends= "prepare" description= "Compiles nashorn" >
2016-03-17 19:04:35 +00:00
<javac srcdir= "${dynalink.module.src.dir}"
destdir="${dynalink.module.classes.dir}"
2012-12-21 20:36:24 +00:00
debug="${javac.debug}"
encoding="${javac.encoding}"
2013-07-05 09:08:04 +00:00
includeantruntime="false" fork="true">
2014-07-01 12:07:39 +00:00
<compilerarg value= "-Xlint:all" />
2012-12-21 20:36:24 +00:00
<compilerarg value= "-XDignore.symbol.file" />
2014-03-17 12:32:00 +00:00
<compilerarg value= "-Xdiags:verbose" />
2014-08-19 12:44:45 +00:00
<compilerarg value= "-parameters" />
2012-12-21 20:36:24 +00:00
</javac>
2016-08-10 22:49:16 +00:00
<!-- patch - module does not like module - info.class files! -->
2016-05-03 15:57:00 +00:00
<delete >
<fileset dir= "${build.classes.dir}" includes= "**/module-info.class" />
</delete>
2016-03-17 19:04:35 +00:00
<javac srcdir= "${nashorn.module.src.dir}"
destdir="${nashorn.module.classes.dir}"
debug="${javac.debug}"
encoding="${javac.encoding}"
includeantruntime="false" fork="true">
<compilerarg value= "-Xlint:all" />
<compilerarg value= "-XDignore.symbol.file" />
<compilerarg value= "-Xdiags:verbose" />
<compilerarg value= "-parameters" />
2016-05-03 15:57:00 +00:00
<compilerarg line= "${nashorn.override.option}" />
2016-03-17 19:04:35 +00:00
</javac>
2016-08-10 22:49:16 +00:00
<!-- patch - module does not like module - info.class files! -->
2016-05-03 15:57:00 +00:00
<delete >
<fileset dir= "${build.classes.dir}" includes= "**/module-info.class" />
</delete>
2016-03-17 19:04:35 +00:00
<javac srcdir= "${nashorn.shell.module.src.dir}"
destdir="${nashorn.shell.module.classes.dir}"
debug="${javac.debug}"
encoding="${javac.encoding}"
includeantruntime="false" fork="true">
<compilerarg value= "-Xlint:all" />
<compilerarg value= "-XDignore.symbol.file" />
<compilerarg value= "-Xdiags:verbose" />
<compilerarg value= "-parameters" />
2016-05-03 15:57:00 +00:00
<compilerarg line= "${nashorn.override.option}" />
2016-03-17 19:04:35 +00:00
</javac>
2016-08-10 22:49:16 +00:00
<!-- patch - module does not like module - info.class files! -->
2016-03-17 19:04:35 +00:00
<delete >
<fileset dir= "${build.classes.dir}" includes= "**/module-info.class" />
</delete>
<copy todir= "${nashorn.module.classes.dir}/jdk/nashorn/api/scripting/resources" >
2015-08-13 13:37:27 +00:00
<fileset dir= "${nashorn.module.src.dir}/jdk/nashorn/api/scripting/resources/" />
2012-12-21 20:36:24 +00:00
</copy>
2016-03-17 19:04:35 +00:00
<copy todir= "${nashorn.module.classes.dir}/jdk/nashorn/internal/runtime/resources" >
2015-08-13 13:37:27 +00:00
<fileset dir= "${nashorn.module.src.dir}/jdk/nashorn/internal/runtime/resources/" />
2012-12-21 20:36:24 +00:00
</copy>
2016-03-17 19:04:35 +00:00
<copy todir= "${nashorn.module.classes.dir}/jdk/nashorn/tools/resources" >
2015-08-13 13:37:27 +00:00
<fileset dir= "${nashorn.module.src.dir}/jdk/nashorn/tools/resources/" />
2012-12-21 20:36:24 +00:00
</copy>
2016-03-17 19:04:35 +00:00
<copy file= "${dynalink.module.src.dir}/jdk/dynalink/support/messages.properties" todir= "${dynalink.module.classes.dir}/jdk/dynalink/support" />
<copy file= "${nashorn.module.src.dir}/jdk/nashorn/internal/codegen/anchor.properties" todir= "${nashorn.module.classes.dir}/jdk/nashorn/internal/codegen" />
2017-11-06 16:35:53 +00:00
<copy todir= "${nashorn.shell.module.classes.dir}/jdk/nashorn/tools/jjs/resources" >
<fileset dir= "${nashorn.shell.module.src.dir}/jdk/nashorn/tools/jjs/resources/" />
</copy>
2013-02-14 12:22:26 +00:00
2016-03-17 19:04:35 +00:00
<echo message= "version_string=${nashorn.fullversion}" file= "${nashorn.module.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties" />
<echo file= "${nashorn.module.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties" append= "true" > ${line.separator}</echo>
<echo message= "version_short=${nashorn.version}" file= "${nashorn.module.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties" append= "true" />
2012-12-21 20:36:24 +00:00
</target>
2013-07-02 10:45:16 +00:00
<target name= "jar" depends= "compile, run-nasgen, generate-cc-template" description= "Creates nashorn.jar" unless= "compile.suppress.jar" >
2016-03-17 19:04:35 +00:00
<jar jarfile= "${dynalink.jar}" >
<fileset dir= "${dynalink.module.classes.dir}" />
</jar>
<jar jarfile= "${nashorn.jar}" index= "true" filesetmanifest= "merge" >
<fileset dir= "${nashorn.module.classes.dir}" />
2012-12-21 20:36:24 +00:00
<manifest >
<attribute name= "Archiver-Version" value= "n/a" />
<attribute name= "Build-Jdk" value= "${java.runtime.version}" />
<attribute name= "Built-By" value= "n/a" />
<attribute name= "Created-By" value= "Ant jar task" />
<section name= "jdk/nashorn/" >
<attribute name= "Implementation-Title" value= "${nashorn.product.name}" />
<attribute name= "Implementation-Version" value= "${nashorn.version}" />
</section>
</manifest>
</jar>
2016-03-17 19:04:35 +00:00
<jar jarfile= "${jjs.jar}" >
<fileset dir= "${nashorn.shell.module.classes.dir}" />
</jar>
2012-12-21 20:36:24 +00:00
</target>
2013-07-02 10:45:16 +00:00
<target name= "use-promoted-nashorn" depends= "init" >
<delete file= "${dist.dir}/nashorn.jar" />
<copy file= "${java.home}/lib/ext/nashorn.jar" todir= "${dist.dir}" />
<property name= "compile.suppress.jar" value= "defined" />
</target>
2015-07-02 09:20:47 +00:00
<!-- generate javadoc for Nashorn classes -->
2017-12-12 13:04:05 +00:00
<target name= "javadoc" depends= "jar" unless= "test.class" >
2017-01-04 13:17:35 +00:00
<javadoc destdir= "${dist.javadoc.dir}" use= "yes"
2016-03-17 19:04:35 +00:00
windowtitle="${nashorn.product.name} ${nashorn.version}"
2017-09-21 09:07:47 +00:00
additionalparam="-quiet" failonerror="true" useexternalfile="true">
<arg value= "--patch-module" />
<arg value= "jdk.scripting.nashorn=${basedir}/${nashorn.module.src.dir}" />
<arg value= "--patch-module" />
<arg value= "jdk.dynalink=${basedir}/${dynalink.module.src.dir}" />
2017-09-12 17:03:56 +00:00
<arg value= "--module-source-path" />
2017-09-21 09:07:47 +00:00
<arg value= "." />
2016-02-25 08:26:23 +00:00
<arg value= "${javadoc.option}" />
2015-08-13 13:37:27 +00:00
<fileset dir= "${nashorn.module.src.dir}" includes= "**/*.java" />
2017-09-21 09:07:47 +00:00
<fileset dir= "${dynalink.module.src.dir}" includes= "**/*.java" />
2017-11-22 16:54:11 +00:00
<link offline= "true" href= "${javadoc.base.url}" packagelistLoc= "${javadoc.pkg.list}" />
2015-07-02 09:20:47 +00:00
</javadoc>
</target>
2014-05-30 11:52:38 +00:00
<!-- generate javadoc only for nashorn extension api classes -->
2016-05-31 15:42:34 +00:00
<target name= "nashornapi" depends= "jar" >
<mkdir dir= "${dist.nashornapi.javadoc.dir}" />
2017-01-04 13:17:35 +00:00
<javadoc destdir= "${dist.nashornapi.javadoc.dir}" use= "yes"
2017-09-21 09:07:47 +00:00
windowtitle="${nashorn.product.name} ${nashorn.version}"
2015-07-02 09:20:47 +00:00
additionalparam="-quiet" failonerror="true" useexternalfile="true">
2017-09-21 09:07:47 +00:00
<arg value= "--patch-module" />
<arg value= "jdk.scripting.nashorn=${basedir}/${nashorn.module.src.dir}" />
<arg value= "--patch-module" />
<arg value= "jdk.dynalink=${basedir}/${dynalink.module.src.dir}" />
2016-08-10 22:49:16 +00:00
<arg value= "--module-source-path" />
2017-09-21 09:07:47 +00:00
<arg value= "." />
2016-02-25 08:26:23 +00:00
<arg value= "${javadoc.option}" />
2015-09-30 14:50:11 +00:00
<fileset dir= "${nashorn.module.src.dir}" includes= "jdk/nashorn/api/**/*.java" />
2017-11-22 16:54:11 +00:00
<link offline= "true" href= "${javadoc.base.url}" packagelistLoc= "${javadoc.pkg.list}" />
2014-05-30 11:52:38 +00:00
</javadoc>
</target>
2015-11-24 09:19:34 +00:00
<!-- generate javadoc only for Dynalink API classes -->
<target name= "dynalinkapi" depends= "jar" >
2016-05-31 15:42:34 +00:00
<mkdir dir= "${dist.dynalinkapi.javadoc.dir}" />
<javadoc destdir= "${dist.dynalinkapi.javadoc.dir}" use= "yes"
2015-11-24 09:19:34 +00:00
windowtitle="Dynalink"
additionalparam="-quiet" failonerror="true" useexternalfile="true">
2017-09-21 09:07:47 +00:00
<arg value= "--patch-module" />
<arg value= "jdk.scripting.nashorn=${basedir}/${nashorn.module.src.dir}" />
<arg value= "--patch-module" />
<arg value= "jdk.dynalink=${basedir}/${dynalink.module.src.dir}" />
2016-08-10 22:49:16 +00:00
<arg value= "--module-source-path" />
2017-09-21 09:07:47 +00:00
<arg value= "." />
2016-02-25 08:26:23 +00:00
<arg value= "${javadoc.option}" />
2017-09-21 09:07:47 +00:00
<fileset dir= "${dynalink.module.src.dir}" includes= "**/*.java" />
2017-11-22 16:54:11 +00:00
<link offline= "true" href= "${javadoc.base.url}" packagelistLoc= "${javadoc.pkg.list}" />
2015-11-24 09:19:34 +00:00
</javadoc>
</target>
2014-05-30 11:52:38 +00:00
2016-05-31 15:42:34 +00:00
<target name= "javadocapi" depends= "nashornapi, dynalinkapi" />
2012-12-21 20:36:24 +00:00
<!-- generate all docs -->
2017-09-21 09:07:47 +00:00
<target name= "docs" depends= "javadoc" />
2012-12-21 20:36:24 +00:00
<!-- create .zip and .tar.gz for nashorn binaries and scripts. -->
<target name= "dist" depends= "jar" >
<zip destfile= "${build.zip}" basedir= ".."
excludes="nashorn/bin/*.sh" includes="nashorn/bin/** nashorn/dist/**"/>
<tar destfile= "${build.gzip}" basedir= ".." compression= "gzip"
excludes="nashorn/bin/*.sh" includes="nashorn/bin/** nashorn/dist/**"/>
</target>
<target name= "compile-test" depends= "compile, run-nasgen" if= "testng.available" >
<!-- testng task -->
<taskdef name= "testng" classname= "org.testng.TestNGAntTask"
2016-02-12 16:00:54 +00:00
classpath="${testng.ant.classpath}"/>
2012-12-21 20:36:24 +00:00
<javac srcdir= "${test.src.dir}"
destdir="${build.test.classes.dir}"
classpath="${javac.test.classpath}"
debug="${javac.debug}"
encoding="${javac.encoding}"
2013-07-11 11:04:55 +00:00
includeantruntime="false" fork="true">
2016-05-03 15:57:00 +00:00
<compilerarg line= "${nashorn.override.option}" />
2013-07-11 11:04:55 +00:00
<compilerarg value= "-Xlint:unchecked" />
<compilerarg value= "-Xlint:deprecation" />
2014-03-17 12:32:00 +00:00
<compilerarg value= "-Xdiags:verbose" />
2017-09-27 13:10:37 +00:00
<compilerarg line= "${test.module.imports.compile.time}" />
2013-05-20 17:34:01 +00:00
</javac>
2013-02-07 11:47:29 +00:00
2013-09-13 11:15:11 +00:00
<copy todir= "${build.test.classes.dir}/META-INF/services" >
<fileset dir= "${test.src.dir}/META-INF/services/" />
</copy>
2015-04-03 13:39:34 +00:00
<copy todir= "${build.test.classes.dir}/jdk/nashorn/internal/runtime/test/resources" >
<fileset dir= "${test.src.dir}/jdk/nashorn/internal/runtime/test/resources" />
2013-09-30 16:03:38 +00:00
</copy>
2015-11-11 14:22:14 +00:00
<copy todir= "${build.test.classes.dir}/jdk/nashorn/internal/runtime/doubleconv/test/resources" >
<fileset dir= "${test.src.dir}/jdk/nashorn/internal/runtime/doubleconv/test/resources" />
</copy>
2015-04-03 13:39:34 +00:00
<copy todir= "${build.test.classes.dir}/jdk/nashorn/api/scripting/test/resources" >
<fileset dir= "${test.src.dir}/jdk/nashorn/api/scripting/test/resources" />
2014-03-12 10:26:00 +00:00
</copy>
2013-02-07 11:47:29 +00:00
<!-- tests that check nashorn internals and internal API -->
<jar jarfile= "${nashorn.internal.tests.jar}" >
2015-11-24 09:19:34 +00:00
<fileset dir= "${build.test.classes.dir}" includes= "**/internal/**" />
<fileset dir= "${build.test.classes.dir}" includes= "**/test/tools/**" />
<fileset dir= "${build.test.classes.dir}" includes= "**/models/**" />
<fileset dir= "${build.test.classes.dir}" includes= "**/jdk/dynalink/test/Trusted**" />
<fileset dir= "${build.test.classes.dir}" includes= "**/META-INF/**" />
2013-02-07 11:47:29 +00:00
</jar>
2015-11-24 09:19:34 +00:00
<!-- tests that check nashorn script engine (jsr - 223) API and dynalink API -->
2013-02-07 11:47:29 +00:00
<jar jarfile= "${nashorn.api.tests.jar}" >
2015-11-24 09:19:34 +00:00
<fileset dir= "${build.test.classes.dir}" includes= "**/jdk/dynalink/**" excludes= "**/jdk/dynalink/test/Trusted**" />
2013-03-12 12:42:42 +00:00
<fileset dir= "${build.test.classes.dir}" includes= "**/api/**" />
2013-09-13 11:15:11 +00:00
<fileset dir= "${build.test.classes.dir}" includes= "**/META-INF/**" />
2013-09-30 16:03:38 +00:00
<fileset dir= "${build.test.classes.dir}" includes= "**/resources/*.js" />
2015-11-24 09:19:34 +00:00
<fileset dir= "${build.test.classes.dir}" includes= "**/UnnamedPackage**" />
2013-02-07 11:47:29 +00:00
</jar>
2012-12-21 20:36:24 +00:00
</target>
2017-01-24 12:38:04 +00:00
<target name= "generate-security-config" depends= "generate-policy-file, generate-security-properties-file" />
<target name= "generate-security-properties-file" depends= "prepare" >
<echo file= "${build.dir}/nashorn.security.properties" >
package.access=sun.misc.,\
sun.reflect.,\
jdk.nashorn.internal.
</echo>
</target>
2013-02-14 12:51:54 +00:00
<target name= "generate-policy-file" depends= "prepare" >
2013-07-03 10:39:28 +00:00
<echo file= "${build.dir}/nashorn.policy" >
2016-03-17 19:04:35 +00:00
grant codeBase "file:/${basedir}/${dynalink.module.classes.dir}" {
permission java.security.AllPermission;
};
grant codeBase "file:/${basedir}/${nashorn.module.classes.dir}" {
2014-05-14 13:50:04 +00:00
permission java.security.AllPermission;
};
2013-07-03 10:39:28 +00:00
grant codeBase "file:/${basedir}/${nashorn.internal.tests.jar}" {
permission java.security.AllPermission;
};
2015-03-09 14:44:10 +00:00
grant codeBase "file:/${basedir}/${nashorn.api.tests.jar}" {
permission java.util.PropertyPermission "parserapitest.*", "read";
permission java.util.PropertyPermission "test.*", "read";
permission java.util.PropertyPermission "test262.*", "read";
2017-09-12 17:03:56 +00:00
permission java.io.FilePermission "${basedir}/test/nashorn/-","read";
2015-03-09 14:44:10 +00:00
permission java.io.FilePermission "$${user.dir}", "read";
permission java.util.PropertyPermission "user.dir", "read";
};
2013-07-03 10:39:28 +00:00
grant codeBase "file:/${basedir}/${file.reference.testng.jar}" {
permission java.security.AllPermission;
};
2016-02-12 16:00:54 +00:00
grant codeBase "file:/${basedir}/${file.reference.jcommander.jar}" {
permission java.security.AllPermission;
};
grant codeBase "file:/${basedir}/${file.reference.bsh.jar}" {
permission java.security.AllPermission;
};
grant codeBase "file:/${basedir}/${file.reference.snakeyaml.jar}" {
permission java.security.AllPermission;
};
2014-07-18 11:23:17 +00:00
//// in case of absolute path:
grant codeBase "file:/${nashorn.internal.tests.jar}" {
permission java.security.AllPermission;
};
grant codeBase "file:/${file.reference.testng.jar}" {
permission java.security.AllPermission;
};
2016-02-12 16:00:54 +00:00
grant codeBase "file:/${file.reference.jcommander.jar}" {
permission java.security.AllPermission;
};
grant codeBase "file:/${file.reference.bsh.jar}" {
permission java.security.AllPermission;
};
grant codeBase "file:/${file.reference.snakeyaml.jar}" {
permission java.security.AllPermission;
};
2013-07-03 10:39:28 +00:00
2017-09-12 17:03:56 +00:00
grant codeBase "file:/${basedir}/${test.script.dir}/trusted/*" {
2013-07-03 10:39:28 +00:00
permission java.security.AllPermission;
};
2017-09-12 17:03:56 +00:00
grant codeBase "file:/${basedir}/${test.script.dir}/maptests/*" {
permission java.io.FilePermission "${basedir}/${test.script.dir}/maptests/*","read";
2014-02-06 12:14:37 +00:00
permission java.lang.RuntimePermission "nashorn.debugMode";
};
2017-09-12 17:03:56 +00:00
grant codeBase "file:/${basedir}/${test.script.dir}/basic/*" {
permission java.io.FilePermission "${basedir}/${test.script.dir}/-", "read";
2013-07-03 10:39:28 +00:00
permission java.io.FilePermission "$${user.dir}", "read";
permission java.util.PropertyPermission "user.dir", "read";
permission java.util.PropertyPermission "nashorn.test.*", "read";
};
2017-09-12 17:03:56 +00:00
grant codeBase "file:/${basedir}/${test.script.dir}/basic/apply_to_call/*" {
permission java.io.FilePermission "${basedir}/${test.script.dir}/-", "read";
2015-12-17 12:41:09 +00:00
permission java.io.FilePermission "$${user.dir}", "read";
permission java.util.PropertyPermission "user.dir", "read";
permission java.util.PropertyPermission "nashorn.test.*", "read";
};
2017-09-12 17:03:56 +00:00
grant codeBase "file:/${basedir}/${test.script.dir}/basic/parser/*" {
permission java.io.FilePermission "${basedir}/${test.script.dir}/-", "read";
2013-09-12 16:46:40 +00:00
permission java.io.FilePermission "$${user.dir}", "read";
permission java.util.PropertyPermission "user.dir", "read";
permission java.util.PropertyPermission "nashorn.test.*", "read";
2014-09-04 13:37:14 +00:00
};
2017-09-12 17:03:56 +00:00
grant codeBase "file:/${basedir}/${test.script.dir}/basic/es6/*" {
permission java.io.FilePermission "${basedir}/${test.script.dir}/-", "read";
2014-09-04 13:37:14 +00:00
permission java.io.FilePermission "$${user.dir}", "read";
permission java.util.PropertyPermission "user.dir", "read";
permission java.util.PropertyPermission "nashorn.test.*", "read";
2013-09-12 16:46:40 +00:00
};
2017-09-12 17:03:56 +00:00
grant codeBase "file:/${basedir}/${test.script.dir}/basic/JDK-8010946-privileged.js" {
2013-07-03 10:39:28 +00:00
permission java.util.PropertyPermission "java.security.policy", "read";
};
2013-07-18 14:47:45 +00:00
2017-09-12 17:03:56 +00:00
grant codeBase "file:/${basedir}/${test.script.dir}/basic/classloader.js" {
2013-07-18 14:47:45 +00:00
permission java.lang.RuntimePermission "nashorn.JavaReflection";
};
2017-09-12 17:03:56 +00:00
grant codeBase "file:/${basedir}/${test.script.dir}/markdown.js" {
permission java.io.FilePermission "${basedir}/${test.script.dir}/external/showdown/-", "read";
2013-12-12 13:32:43 +00:00
};
2017-09-12 17:03:56 +00:00
grant codeBase "file:/${basedir}/${test.script.dir}/basic/JDK-8158467.js" {
2016-06-02 09:26:20 +00:00
permission java.lang.RuntimePermission "nashorn.setConfig";
};
2013-07-03 10:39:28 +00:00
</echo>
2012-12-21 20:36:24 +00:00
<replace file= "${build.dir}/nashorn.policy" > <replacetoken > \</replacetoken> <replacevalue > /</replacevalue> </replace> <!-- hack for Windows - to make URLs with normal path separators -->
<replace file= "${build.dir}/nashorn.policy" > <replacetoken > //</replacetoken> <replacevalue > /</replacevalue> </replace> <!-- hack for Unix - to avoid leading // in URLs -->
</target>
<target name= "check-external-tests" >
<available file= "${test.external.dir}/prototype" property= "test-sys-prop.external.prototype" />
<available file= "${test.external.dir}/sunspider" property= "test-sys-prop.external.sunspider" />
<available file= "${test.external.dir}/underscore" property= "test-sys-prop.external.underscore" />
<available file= "${test.external.dir}/octane" property= "test-sys-prop.external.octane" />
<available file= "${test.external.dir}/yui" property= "test-sys-prop.external.yui" />
<available file= "${test.external.dir}/jquery" property= "test-sys-prop.external.jquery" />
<available file= "${test.external.dir}/test262" property= "test-sys-prop.external.test262" />
2013-12-12 13:32:43 +00:00
<available file= "${test.external.dir}/showdown" property= "test-sys-prop.external.markdown" />
2012-12-21 20:36:24 +00:00
</target>
<target name= "check-testng" unless= "testng.available" >
2016-02-12 16:00:54 +00:00
<echo message= "WARNING: TestNG not available, will not run tests. Please copy TestNG and dependency JARs to the ${test.lib} directory." />
2012-12-21 20:36:24 +00:00
</target>
2014-06-12 12:09:09 +00:00
<!-- only to be invoked as dependency of "test" target -->
<target name= "-test-classes-all" depends= "jar" unless= "test.class" >
<fileset id= "test.classes" dir= "${build.test.classes.dir}" >
2015-11-24 09:19:34 +00:00
<include name= "**/dynalink/beans/test/*Test.class" />
2016-11-17 12:39:30 +00:00
<include name= "**/dynalink/linker/support/test/*Test.class" />
<include name= "**/dynalink/support/test/*Test.class" />
<include name= "**/dynalink/test/*Test.class" />
2015-04-06 18:43:18 +00:00
<include name= "**/api/javaaccess/test/*Test.class" />
<include name= "**/api/scripting/test/*Test.class" />
<include name= "**/api/tree/test/*Test.class" />
<include name= "**/codegen/test/*Test.class" />
<include name= "**/parser/test/*Test.class" />
<include name= "**/runtime/test/*Test.class" />
2016-11-17 12:39:30 +00:00
<include name= "**/runtime/doubleconv/test/*Test.class" />
2015-04-06 18:43:18 +00:00
<include name= "**/runtime/regexp/test/*Test.class" />
<include name= "**/runtime/regexp/joni/test/*Test.class" />
2014-06-12 12:09:09 +00:00
<include name= "**/framework/*Test.class" />
</fileset>
</target>
2012-12-21 20:36:24 +00:00
2014-06-12 12:09:09 +00:00
<!-- only to be invoked as dependency of "test" target -->
<target name= "-test-classes-single" depends= "jar" if= "test.class" >
<fileset id= "test.classes" dir= "${build.test.classes.dir}" >
<include name= "${test.class}*" />
</fileset>
</target>
<!-- only to be invoked as dependency of "test" target -->
<target name= "-test-nosecurity" unless= "test.class" >
2014-05-20 03:02:09 +00:00
<fileset id= "test.nosecurity.classes" dir= "${build.test.classes.dir}" >
<include name= "**/framework/ScriptTest.class" />
2016-11-17 12:39:30 +00:00
<include name= "**/runtime/linker/test/*Test.class" />
2014-05-20 03:02:09 +00:00
</fileset>
2014-10-14 11:04:56 +00:00
<testng outputdir= "${build.nosecurity.test.results.dir}/${testResultsSubDir}" classfilesetref= "test.nosecurity.classes"
2012-12-21 20:36:24 +00:00
verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
2014-07-18 11:23:17 +00:00
<jvmarg line= "${run.test.jvmargs} -Xmx${run.test.xmx} -Dbuild.dir=${build.dir}" />
2014-07-17 11:17:06 +00:00
<sysproperty key= "nashorn.jar" value= "${dist.dir}/nashorn.jar" />
2013-11-25 13:10:02 +00:00
<propertyset >
<propertyref prefix= "nashorn." />
</propertyset>
2012-12-21 20:36:24 +00:00
<propertyset >
2014-06-12 12:09:09 +00:00
<propertyref prefix= "test-sys-prop-no-security." />
<mapper from= "test-sys-prop-no-security.*" to= "*" type= "glob" />
2012-12-21 20:36:24 +00:00
</propertyset>
2014-10-09 08:19:24 +00:00
<sysproperty key= "optimistic.override" value= "${optimistic}" />
2012-12-21 20:36:24 +00:00
<classpath >
<pathelement path= "${run.test.classpath}" />
</classpath>
</testng>
2014-06-12 12:09:09 +00:00
</target>
2014-05-28 14:53:43 +00:00
2014-06-12 12:09:09 +00:00
<!-- only to be invoked as dependency of "test" target -->
<target name= "-test-security" >
<delete dir= "${build.dir}/nashorn_code_cache" />
<property name= "debug.test.jvmargs" value= "" />
2014-10-14 11:04:56 +00:00
<testng outputdir= "${build.test.results.dir}/${testResultsSubDir}" classfilesetref= "test.classes"
2015-03-09 14:44:10 +00:00
verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
2014-07-18 11:23:17 +00:00
<jvmarg line= "${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}" />
2014-06-12 12:09:09 +00:00
<jvmarg line= "${debug.test.jvmargs}" />
2014-05-20 03:02:09 +00:00
<propertyset >
<propertyref prefix= "nashorn." />
</propertyset>
<propertyset >
2014-06-12 12:09:09 +00:00
<propertyref prefix= "test-sys-prop." />
<mapper from= "test-sys-prop.*" to= "*" type= "glob" />
2014-05-20 03:02:09 +00:00
</propertyset>
2014-10-09 08:19:24 +00:00
<sysproperty key= "optimistic.override" value= "${optimistic}" />
2014-06-12 12:09:09 +00:00
<sysproperty key= "test.js.excludes.file" value= "${exclude.list}" />
2014-05-20 03:02:09 +00:00
<classpath >
<pathelement path= "${run.test.classpath}" />
</classpath>
</testng>
2012-12-21 20:36:24 +00:00
</target>
2017-09-21 09:07:47 +00:00
<target name= "test" depends= "prepare, javadoc, test-pessimistic, test-optimistic" />
2014-10-09 08:19:24 +00:00
2017-01-24 12:38:04 +00:00
<target name= "test-optimistic" depends= "jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-security-config" if= "testng.available" >
2014-10-09 08:19:24 +00:00
<echo message= "Running test suite in OPTIMISTIC mode..." />
<antcall target= "-test-nosecurity" inheritRefs= "true" >
<param name= "optimistic" value= "true" />
2014-10-14 11:04:56 +00:00
<param name= "testResultsSubDir" value= "optimistic" />
2015-03-09 14:44:10 +00:00
</antcall>
2014-10-09 08:19:24 +00:00
<antcall target= "-test-security" inheritRefs= "true" >
<param name= "optimistic" value= "true" />
2014-10-14 11:04:56 +00:00
<param name= "testResultsSubDir" value= "optimistic" />
2014-10-09 08:19:24 +00:00
</antcall>
</target>
2017-01-24 12:38:04 +00:00
<target name= "test-pessimistic" depends= "jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-security-config" if= "testng.available" >
2014-10-09 08:19:24 +00:00
<echo message= "Running test suite in PESSIMISTIC mode..." />
<antcall target= "-test-nosecurity" inheritRefs= "true" >
<param name= "optimistic" value= "false" />
2014-10-14 11:04:56 +00:00
<param name= "testResultsSubDir" value= "pessimistic" />
2015-03-09 14:44:10 +00:00
</antcall>
2014-10-09 08:19:24 +00:00
<antcall target= "-test-security" inheritRefs= "true" >
<param name= "optimistic" value= "false" />
2014-10-14 11:04:56 +00:00
<param name= "testResultsSubDir" value= "pessimistic" />
2014-10-09 08:19:24 +00:00
</antcall>
</target>
2014-06-12 12:09:09 +00:00
2013-10-21 09:31:03 +00:00
<target name= "check-jemmy.jfx.testng" unless= "jemmy.jfx.testng.available" >
2016-02-12 16:00:54 +00:00
<echo message= "WARNING: Jemmy or JavaFX or TestNG not available, will not run tests. Please copy TestNG and dependency JARs, JemmyCore.jar, JemmyFX.jar, JemmyAWTInput.jar to the test${file.separator}lib directory. And make sure you have jfxrt.jar in ${java.home}${file.separator}lib${file.separator}ext dir." />
2013-10-21 09:31:03 +00:00
</target>
2015-07-22 07:28:28 +00:00
<target name= "testjfx" depends= "jar, check-jemmy.jfx.testng, compile-test" if= "jemmy.jfx.testng.available" >
2013-10-21 09:31:03 +00:00
<fileset id= "test.classes" dir= "${build.test.classes.dir}" >
<include name= "**/framework/*Test.class" />
</fileset>
2014-05-28 11:58:46 +00:00
2013-10-21 09:31:03 +00:00
<copy file= "${file.reference.jfxrt.jar}" todir= "dist" />
2014-05-28 11:58:46 +00:00
2013-11-05 09:09:40 +00:00
<condition property= "jfx.prism.order" value= "-Dprism.order=j2d" else= " " >
2014-05-28 11:58:46 +00:00
<not >
2013-11-05 09:09:40 +00:00
<os family= "mac" />
</not>
2014-05-28 11:58:46 +00:00
</condition>
2013-10-21 09:31:03 +00:00
<testng outputdir= "${build.test.results.dir}" classfilesetref= "test.classes"
verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
2014-07-18 11:23:17 +00:00
<jvmarg line= "${run.test.jvmargs} -Xmx${run.test.xmx} -Dbuild.dir=${build.dir}" />
2013-10-21 09:31:03 +00:00
<propertyset >
<propertyref prefix= "testjfx-test-sys-prop." />
<mapper from= "testjfx-test-sys-prop.*" to= "*" type= "glob" />
</propertyset>
2013-11-05 09:09:40 +00:00
<sysproperty key= "test.fork.jvm.options" value= "${testjfx-test-sys-prop.test.fork.jvm.options} ${jfx.prism.order}" />
2013-10-21 09:31:03 +00:00
<classpath >
<pathelement path= "${testjfx.run.test.classpath}" />
</classpath>
</testng>
</target>
2014-05-28 11:58:46 +00:00
2017-01-24 12:38:04 +00:00
<target name= "testmarkdown" depends= "jar, check-testng, check-external-tests, compile-test, generate-security-config" if= "testng.available" >
2013-12-12 13:32:43 +00:00
<fileset id= "test.classes" dir= "${build.test.classes.dir}" >
<include name= "**/framework/*Test.class" />
</fileset>
<testng outputdir= "${build.test.results.dir}" classfilesetref= "test.classes"
verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
2014-07-18 11:23:17 +00:00
<jvmarg line= "${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}" />
2013-12-12 13:32:43 +00:00
<propertyset >
<propertyref prefix= "testmarkdown-test-sys-prop." />
<mapper from= "testmarkdown-test-sys-prop.*" to= "*" type= "glob" />
</propertyset>
<classpath >
<pathelement path= "${run.test.classpath}" />
</classpath>
</testng>
</target>
2014-05-28 11:58:46 +00:00
2017-01-24 12:38:04 +00:00
<target name= "test262" depends= "jar, check-testng, check-external-tests, compile-test, generate-security-config" if= "testng.available" >
2012-12-21 20:36:24 +00:00
<fileset id= "test.classes" dir= "${build.test.classes.dir}" >
<include name= "**/framework/*Test.class" />
</fileset>
<testng outputdir= "${build.test.results.dir}" classfilesetref= "test.classes"
verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
2014-07-18 11:23:17 +00:00
<jvmarg line= "${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}" />
2013-11-25 13:10:02 +00:00
<propertyset >
<propertyref prefix= "nashorn." />
</propertyset>
2012-12-21 20:36:24 +00:00
<propertyset >
<propertyref prefix= "test262-test-sys-prop." />
<mapper from= "test262-test-sys-prop.*" to= "*" type= "glob" />
</propertyset>
<classpath >
<pathelement path= "${run.test.classpath}" />
</classpath>
</testng>
</target>
<target name= "test262parallel" depends= "test262-parallel" />
2017-01-24 12:38:04 +00:00
<target name= "test262-parallel" depends= "jar, check-testng, check-external-tests, compile-test, generate-security-config" if= "testng.available" >
2012-12-21 20:36:24 +00:00
<!-- use just build.test.classes.dir to avoid referring to TestNG -->
2015-11-26 13:32:59 +00:00
<java classname= "${parallel.test.runner}" dir= "${basedir}" fork= "true" failonerror= "true" >
2014-07-18 11:23:17 +00:00
<jvmarg line= "${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}" />
2014-08-13 09:30:24 +00:00
<!-- avoid too many typeinfo cache files. Each script is run only once anyway -->
<jvmarg line= "-Dnashorn.typeInfo.disabled=true" />
2013-02-14 03:44:31 +00:00
<classpath >
<pathelement path= "${run.test.classpath}" />
</classpath>
2012-12-21 20:36:24 +00:00
<syspropertyset >
<propertyref prefix= "test262-test-sys-prop." />
<mapper type= "glob" from= "test262-test-sys-prop.*" to= "*" />
</syspropertyset>
</java>
</target>
2014-02-26 12:17:57 +00:00
<target name= "testparallel" depends= "test-parallel" />
2017-01-24 12:38:04 +00:00
<target name= "test-parallel" depends= "jar, check-testng, check-external-tests, compile-test, generate-security-config" if= "testng.available" >
2014-02-26 12:17:57 +00:00
<!-- use just build.test.classes.dir to avoid referring to TestNG -->
<java classname= "${parallel.test.runner}" dir= "${basedir}"
2014-05-28 11:58:46 +00:00
failonerror="true"
fork="true">
2014-02-26 12:17:57 +00:00
<jvmarg line= "${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}" />
<classpath >
<pathelement path= "${run.test.classpath}" />
2014-05-28 11:58:46 +00:00
<pathelement path= "${build.test.classes.dir}" />
2014-02-26 12:17:57 +00:00
</classpath>
<syspropertyset >
<propertyref prefix= "test-sys-prop." />
<mapper type= "glob" from= "test-sys-prop.*" to= "*" />
</syspropertyset>
</java>
</target>
2012-12-21 20:36:24 +00:00
<target name= "all" depends= "test, docs"
description="Build, test and generate docs for nashorn"/>
<target name= "run" depends= "jar"
description="Run the shell with a sample script">
2017-09-21 09:07:47 +00:00
<java classname= "${nashorn.shell.tool}" fork= "true" dir= "${basedir}/src/sample/nashorn" >
2013-09-19 13:39:01 +00:00
<jvmarg line= "${run.test.jvmargs} -Xmx${run.test.xmx}" />
2012-12-21 20:36:24 +00:00
<arg value= "-dump-on-error" />
<arg value= "test.js" />
</java>
</target>
<target name= "debug" depends= "jar"
description="Debug the shell with a sample script">
2017-09-21 09:07:47 +00:00
<java classname= "${nashorn.shell.tool}" fork= "true" dir= "${basedir}/src/sample/nashorn" >
2013-09-19 13:39:01 +00:00
<jvmarg line= "${run.test.jvmargs} -Xmx${run.test.xmx}" />
2012-12-21 20:36:24 +00:00
<arg value= "--print-code" />
<arg value= "--verify-code" />
<arg value= "--print-symbols" />
<jvmarg value= "-Dnashorn.codegen.debug=true" />
<arg value= "test.js" />
</java>
</target>
2013-01-09 17:02:40 +00:00
<!-- targets to get external script tests -->
<!-- test262 test suite -->
<target name= "get-test262" depends= "init" unless= "${test-sys-prop.external.test262}" >
2014-03-28 07:54:07 +00:00
<!-- clone test262 git repo -->
<exec executable= "${git.executable}" >
2013-01-09 17:02:40 +00:00
<arg value= "clone" />
2014-08-07 13:49:46 +00:00
<arg value= "--branch" />
<arg value= "es5-tests" />
2014-03-28 07:54:07 +00:00
<arg value= "https://github.com/tc39/test262" />
2013-01-09 17:02:40 +00:00
<arg value= "${test.external.dir}/test262" />
</exec>
</target>
<target name= "update-test262" depends= "init" if= "${test-sys-prop.external.test262}" >
2014-03-28 07:54:07 +00:00
<!-- update test262 git repo -->
<exec executable= "${git.executable}" dir= "${test.external.dir}/test262" >
2013-01-09 17:02:40 +00:00
<arg value= "pull" />
</exec>
</target>
<!-- octane benchmark -->
<target name= "get-octane" depends= "init" unless= "${test-sys-prop.external.octane}" >
<!-- checkout octane benchmarks -->
2016-05-18 20:30:14 +00:00
<exec executable= "${git.executable}" >
<arg value= "clone" />
<arg value= "https://github.com/chromium/octane" />
2013-01-09 17:02:40 +00:00
<arg value= "${test.external.dir}/octane" />
</exec>
</target>
<target name= "update-octane" depends= "init" if= "${test-sys-prop.external.octane}" >
<!-- update octane benchmarks -->
2016-05-18 20:30:14 +00:00
<exec executable= "${git.executable}" dir= "${test.external.dir}/octane" >
<arg value= "pull" />
2013-01-09 17:02:40 +00:00
</exec>
</target>
<!-- sunspider benchmark -->
<target name= "get-sunspider" depends= "init" unless= "${test-sys-prop.external.sunspider}" >
<!-- checkout sunspider -->
<exec executable= "${svn.executable}" >
<arg value= "--non-interactive" />
<arg value= "--trust-server-cert" />
<arg value= "checkout" />
<arg value= "http://svn.webkit.org/repository/webkit/trunk/PerformanceTests/SunSpider" />
<arg value= "${test.external.dir}/sunspider" />
</exec>
</target>
<target name= "update-sunspider" depends= "init" if= "${test-sys-prop.external.sunspider}" >
<!-- update sunspider -->
<exec executable= "${svn.executable}" dir= "${test.external.dir}/sunspider" >
<arg value= "--non-interactive" />
<arg value= "--trust-server-cert" />
<arg value= "update" />
</exec>
</target>
<!-- get all external test scripts -->
2015-07-22 07:28:28 +00:00
<target name= "externals" depends= "init, check-external-tests, get-test262, get-octane, get-sunspider" >
2013-01-09 17:02:40 +00:00
<!-- make external test dir -->
2013-07-02 10:45:16 +00:00
<mkdir dir= "${test.external.dir}" />
2013-01-09 17:02:40 +00:00
<!-- jquery -->
2013-07-02 10:45:16 +00:00
<mkdir dir= "${test.external.dir}/jquery" />
2013-01-09 17:02:40 +00:00
<get src= "http://code.jquery.com/jquery-1.7.2.js" dest= "${test.external.dir}/jquery" skipexisting= "true" ignoreerrors= "true" />
<get src= "http://code.jquery.com/jquery-1.7.2.min.js" dest= "${test.external.dir}/jquery" skipexisting= "true" ignoreerrors= "true" />
<!-- prototype -->
2013-07-02 10:45:16 +00:00
<mkdir dir= "${test.external.dir}/prototype" />
2013-01-09 17:02:40 +00:00
<get src= "http://ajax.googleapis.com/ajax/libs/prototype/1.7.0/prototype.js" dest= "${test.external.dir}/prototype" usetimestamp= "true" skipexisting= "true" ignoreerrors= "true" />
<!-- underscorejs -->
2013-07-02 10:45:16 +00:00
<mkdir dir= "${test.external.dir}/underscore" />
2017-11-14 13:18:23 +00:00
<get src= "http://underscorejs.org/underscore.js" dest= "${test.external.dir}/underscore" skipexisting= "true" ignoreerrors= "true" tryGzipEncoding= "true" />
<get src= "http://underscorejs.org/underscore-min.js" dest= "${test.external.dir}/underscore" skipexisting= "true" ignoreerrors= "true" tryGzipEncoding= "true" />
2013-01-09 17:02:40 +00:00
<!-- yui -->
2013-07-02 10:45:16 +00:00
<mkdir dir= "${test.external.dir}/yui" />
2013-01-09 17:02:40 +00:00
<get src= "http://yui.yahooapis.com/3.5.1/build/yui/yui.js" dest= "${test.external.dir}/yui" skipexisting= "true" ignoreerrors= "true" />
<get src= "http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js" dest= "${test.external.dir}/yui" skipexisting= "true" ignoreerrors= "true" />
2014-05-28 11:58:46 +00:00
2013-12-12 13:32:43 +00:00
<!-- showdown -->
<mkdir dir= "${test.external.dir}/showdown" />
2015-06-02 12:34:37 +00:00
<get src= "https://raw.githubusercontent.com/showdownjs/showdown/0.5.4/src/showdown.js" dest= "${test.external.dir}/showdown" skipexisting= "true" ignoreerrors= "true" />
<get src= "https://raw.githubusercontent.com/showdownjs/showdown/0.5.4/src/extensions/table.js" dest= "${test.external.dir}/showdown" skipexisting= "true" ignoreerrors= "true" />
2013-01-09 17:02:40 +00:00
</target>
<!-- update external test suites that are pulled from source control systems -->
2013-01-11 15:04:22 +00:00
<target name= "update-externals" depends= "init, check-external-tests, update-test262, update-octane, update-sunspider" />
<!-- run all perf tests -->
<target name= "perf" depends= "externals, update-externals, sunspider, octane" />
2015-06-02 12:35:03 +00:00
<!-- download and install testng.jar -->
2016-02-12 16:00:54 +00:00
<target name= "get-testng" >
<get dest= "${test.lib}" skipexisting= "true" >
<url url= "http://central.maven.org/maven2/org/testng/testng/6.8/testng-6.8.jar" />
<url url= "http://central.maven.org/maven2/com/beust/jcommander/1.27/jcommander-1.27.jar" />
<url url= "http://central.maven.org/maven2/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar" />
<url url= "http://central.maven.org/maven2/org/yaml/snakeyaml/1.6/snakeyaml-1.6.jar" />
</get>
2015-06-02 12:35:03 +00:00
</target>
2015-11-24 09:19:34 +00:00
<!-- download and install asmtools.jar -->
<target name= "get-asmtools" unless= "asmtools.already.present" >
<get src= "https://adopt-openjdk.ci.cloudbees.com/view/OpenJDK/job/asmtools/lastSuccessfulBuild/artifact/asmtools-6.0.tar.gz" dest= "${test.lib}" skipexisting= "true" ignoreerrors= "true" />
<untar src= "${test.lib}${file.separator}asmtools-6.0.tar.gz" dest= "${test.lib}" compression= "gzip" />
<!-- they are tar.gz'ing a .zip file! -->
<unzip src= "${test.lib}${file.separator}asmtools-6.0.zip" dest= "${test.lib}" >
<patternset >
<include name= "asmtools-6.0/lib/asmtools.jar" />
</patternset>
</unzip>
<move file= "${test.lib}${file.separator}asmtools-6.0${file.separator}lib${file.separator}asmtools.jar" tofile= "${test.lib}${file.separator}asmtools.jar" />
<delete dir= "${test.lib}${file.separator}asmtools-6.0" />
</target>
2015-06-02 15:08:13 +00:00
<!-- run all tests -->
2015-07-22 07:28:28 +00:00
<target name= "alltests" depends= "externals, update-externals, test, test262parallel, testmarkdown, perf" />
2013-01-09 17:02:40 +00:00
2014-05-27 19:25:07 +00:00
<import file= "build-benchmark.xml" />
2012-12-21 20:36:24 +00:00
</project>