1 <?xml version="1.0" encoding="UTF-8"?>
   2 <!--
   3  Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
   4  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5 
   6  This code is free software; you can redistribute it and/or modify it
   7  under the terms of the GNU General Public License version 2 only, as
   8  published by the Free Software Foundation.
   9 
  10  This code is distributed in the hope that it will be useful, but WITHOUT
  11  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  version 2 for more details (a copy is included in the LICENSE file that
  14  accompanied this code).
  15 
  16  You should have received a copy of the GNU General Public License version
  17  2 along with this work; if not, write to the Free Software Foundation,
  18  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19 
  20  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  or visit www.oracle.com if you need additional information or have any
  22  questions.
  23 -->
  24 <project name="nashorn" default="test" basedir="..">
  25   <import file="build-nasgen.xml"/>
  26   <import file="build-benchmark.xml"/>
  27   <import file="code_coverage.xml"/>
  28 
  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.ext.path">
  36       <pathelement location="${dist.dir}"/>
  37     </path>
  38     <property name="ext.class.path" value="-Djava.ext.dirs=&quot;${toString:nashorn.ext.path}&quot;"/>
  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 JDK already has ASM classes -->
  49     <available property="asm.available" classname="jdk.internal.org.objectweb.asm.Type"/>
  50     <!-- check if testng.jar is avaiable -->
  51     <available property="testng.available" file="${file.reference.testng.jar}"/>
  52     <!-- check if Jemmy ang testng.jar are avaiable -->
  53     <condition property="jemmy.jfx.testng.available" value="true">
  54       <and> 
  55         <available file="${file.reference.jemmyfx.jar}"/>
  56         <available file="${file.reference.jemmycore.jar}"/>
  57         <available file="${file.reference.jemmyawtinput.jar}"/>
  58         <available file="${file.reference.jfxrt.jar}"/>
  59         <isset property="testng.available"/>
  60       </and>
  61     </condition>
  62 
  63     <!-- enable/disable make code coverage -->
  64     <condition property="cc.enabled">
  65         <istrue value="${make.code.coverage}" />
  66     </condition>
  67 
  68     <!-- exclude tests in exclude lists -->
  69     <condition property="exclude.list" value="./exclude/exclude_list_cc.txt" else="./exclude/exclude_list.txt">
  70       <istrue value="${make.code.coverage}" />
  71     </condition>
  72 
  73     <condition property="jfr.options" value="${run.test.jvmargs.jfr}" else="">
  74       <istrue value="${jfr}"/>
  75     </condition>
  76   </target>
  77 
  78   <target name="init" depends="init-conditions, init-cc">
  79     <!-- extends jvm args -->
  80     <property name="run.test.jvmargs" value="${run.test.jvmargs.main} ${run.test.cc.jvmargs} ${jfr.options}"/>
  81     <property name="run.test.jvmargs.octane" value="${run.test.jvmargs.octane.main} ${run.test.cc.jvmargs} ${jfr.options}"/>
  82 
  83     <echo message="run.test.jvmargs=${run.test.jvmargs}"/>
  84     <echo message="run.test.jvmargs.octane=${run.test.jvmargs.octane}"/>
  85     <echo message="run.test.xms=${run.test.xms}"/>
  86     <echo message="run.test.xmx=${run.test.xmx}"/>
  87 
  88   </target>
  89 
  90   <target name="prepare" depends="init">
  91     <mkdir dir="${build.dir}"/>
  92     <mkdir dir="${build.classes.dir}"/>
  93     <mkdir dir="${build.classes.dir}/META-INF/services"/>
  94     <mkdir dir="${build.test.classes.dir}"/>
  95     <mkdir dir="${dist.dir}"/>
  96     <mkdir dir="${dist.javadoc.dir}"/>
  97   </target>
  98 
  99   <target name="clean" depends="init, clean-nasgen, init-cc-cleanup">
 100     <delete includeemptydirs="true">
 101       <fileset dir="${build.dir}" erroronmissingdir="false"/>
 102     </delete>
 103     <delete dir="${dist.dir}"/>
 104   </target>
 105 
 106   <!-- do it only if ASM is not available -->
 107   <target name="compile-asm" depends="prepare" unless="asm.available">
 108     <javac srcdir="${jdk.asm.src.dir}"
 109            destdir="${build.classes.dir}"
 110            excludes="**/optimizer/* **/xml/* **/attrs/*"
 111            source="${javac.source}"
 112            target="${javac.target}"
 113            debug="${javac.debug}"
 114            encoding="${javac.encoding}"
 115            includeantruntime="false"/>
 116   </target>
 117 
 118   <target name="compile" depends="compile-asm" description="Compiles nashorn">
 119     <javac srcdir="${src.dir}"
 120            destdir="${build.classes.dir}"
 121            classpath="${javac.classpath}"
 122            source="${javac.source}"
 123            target="${javac.target}"
 124            debug="${javac.debug}"
 125            encoding="${javac.encoding}"
 126            includeantruntime="false" fork="true">
 127       <compilerarg value="-J-Djava.ext.dirs="/>
 128       <compilerarg value="-Xlint:unchecked"/>
 129       <compilerarg value="-Xlint:deprecation"/>
 130       <compilerarg value="-XDignore.symbol.file"/>
 131       <compilerarg value="-Xdiags:verbose"/>
 132     </javac>
 133     <copy todir="${build.classes.dir}/META-INF/services">
 134        <fileset dir="${meta.inf.dir}/services/"/>
 135     </copy>
 136      <copy todir="${build.classes.dir}/jdk/nashorn/api/scripting/resources">
 137        <fileset dir="${src.dir}/jdk/nashorn/api/scripting/resources/"/>
 138     </copy>
 139     <copy todir="${build.classes.dir}/jdk/nashorn/internal/runtime/resources">
 140        <fileset dir="${src.dir}/jdk/nashorn/internal/runtime/resources/"/>
 141     </copy>
 142     <copy todir="${build.classes.dir}/jdk/nashorn/tools/resources">
 143        <fileset dir="${src.dir}/jdk/nashorn/tools/resources/"/>
 144     </copy>
 145     <copy file="${src.dir}/jdk/internal/dynalink/support/messages.properties" todir="${build.classes.dir}/jdk/internal/dynalink/support"/>
 146 
 147     <echo message="full=${nashorn.fullversion}" file="${build.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties"/>
 148     <echo file="${build.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties" append="true">${line.separator}</echo>
 149     <echo message="release=${nashorn.version}" file="${build.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties" append="true"/>
 150   </target>
 151 
 152   <target name="jar" depends="compile, run-nasgen, generate-cc-template" description="Creates nashorn.jar" unless="compile.suppress.jar">
 153     <jar jarfile="${dist.jar}" manifest="${meta.inf.dir}/MANIFEST.MF" index="true" filesetmanifest="merge">
 154       <fileset dir="${build.classes.dir}"/>
 155       <manifest>
 156         <attribute name="Archiver-Version" value="n/a"/>
 157         <attribute name="Build-Jdk" value="${java.runtime.version}"/>
 158         <attribute name="Built-By" value="n/a"/>
 159         <attribute name="Created-By" value="Ant jar task"/>
 160         <section name="jdk/nashorn/">
 161           <attribute name="Implementation-Title" value="${nashorn.product.name}"/>
 162           <attribute name="Implementation-Version" value="${nashorn.version}"/>
 163         </section>
 164       </manifest>
 165     </jar>
 166   </target>
 167 
 168   <target name="use-promoted-nashorn" depends="init">
 169     <delete file="${dist.dir}/nashorn.jar"/>
 170     <copy file="${java.home}/lib/ext/nashorn.jar" todir="${dist.dir}"/>
 171     <property name="compile.suppress.jar" value="defined"/>
 172   </target>
 173 
 174   <target name="build-fxshell" depends="jar">
 175     <description>Builds the javafx shell.</description>
 176     <mkdir dir="${fxshell.classes.dir}"/>
 177     <javac srcdir="${fxshell.dir}"
 178            destdir="${fxshell.classes.dir}"
 179            classpath="${dist.jar}:${javac.classpath}"
 180            debug="${javac.debug}"
 181            encoding="${javac.encoding}"
 182            includeantruntime="false">
 183     </javac>
 184     <jar jarfile="${fxshell.jar}" manifest="${meta.inf.dir}/MANIFEST.MF" index="true" filesetmanifest="merge">
 185       <fileset dir="${fxshell.classes.dir}"/>
 186       <manifest>
 187         <attribute name="Archiver-Version" value="n/a"/>
 188         <attribute name="Build-Jdk" value="${java.runtime.version}"/>
 189         <attribute name="Built-By" value="n/a"/>
 190         <attribute name="Created-By" value="Ant jar task"/>
 191         <section name="jdk/nashorn/">
 192           <attribute name="Implementation-Title" value="Oracle Nashorn FXShell"/>
 193           <attribute name="Implementation-Version" value="${nashorn.version}"/>
 194         </section>
 195       </manifest>
 196     </jar>
 197   </target>
 198 
 199   <target name="javadoc" depends="prepare">
 200     <javadoc destdir="${dist.javadoc.dir}" use="yes" overview="src/overview.html" windowtitle="${nashorn.product.name} ${nashorn.version}" additionalparam="-quiet" failonerror="true">
 201       <classpath>
 202         <pathelement location="${build.classes.dir}"/>
 203       </classpath>
 204       <fileset dir="${src.dir}" includes="**/*.java"/>
 205       <fileset dir="${jdk.asm.src.dir}" includes="**/*.java"/>
 206       <link href="http://docs.oracle.com/javase/7/docs/api/"/>
 207       <!-- The following tags are used only in ASM sources - just ignore these -->
 208       <tag name="label" description="label tag in ASM sources" enabled="false"/>
 209       <tag name="linked" description="linked tag in ASM sources" enabled="false"/>
 210       <tag name="associates" description="associates tag in ASM sources" enabled="false"/>
 211     </javadoc>
 212   </target>
 213 
 214   <!-- generate shell.html for shell tool documentation -->
 215   <target name="shelldoc" depends="jar">
 216     <java classname="${nashorn.shell.tool}" dir="${basedir}" output="${dist.dir}/shell.html" failonerror="true" fork="true">
 217       <jvmarg line="${ext.class.path}"/>
 218       <arg value="-scripting"/>
 219       <arg value="docs/genshelldoc.js"/>
 220     </java>
 221   </target>
 222 
 223   <!-- generate all docs -->
 224   <target name="docs" depends="javadoc, shelldoc"/>
 225 
 226   <!-- create .zip and .tar.gz for nashorn binaries and scripts. -->
 227   <target name="dist" depends="jar">
 228       <zip destfile="${build.zip}" basedir=".."
 229           excludes="nashorn/bin/*.sh" includes="nashorn/bin/** nashorn/dist/**"/>
 230       <tar destfile="${build.gzip}" basedir=".." compression="gzip"
 231           excludes="nashorn/bin/*.sh" includes="nashorn/bin/** nashorn/dist/**"/>
 232   </target>
 233 
 234   <target name="compile-test" depends="compile, run-nasgen" if="testng.available">
 235     <!-- testng task -->
 236     <taskdef name="testng" classname="org.testng.TestNGAntTask"
 237         classpath="${file.reference.testng.jar}"/>
 238 
 239     <javac srcdir="${test.src.dir}"
 240            destdir="${build.test.classes.dir}"
 241            classpath="${javac.test.classpath}"
 242            source="${javac.source}"
 243            target="${javac.target}"
 244            debug="${javac.debug}"
 245            encoding="${javac.encoding}"
 246            includeantruntime="false" fork="true">
 247         <compilerarg value="-J-Djava.ext.dirs="/>
 248         <compilerarg value="-Xlint:unchecked"/>
 249         <compilerarg value="-Xlint:deprecation"/>
 250         <compilerarg value="-Xdiags:verbose"/>
 251     </javac>
 252 
 253     <copy todir="${build.test.classes.dir}/META-INF/services">
 254        <fileset dir="${test.src.dir}/META-INF/services/"/>
 255     </copy>
 256 
 257     <copy todir="${build.test.classes.dir}/jdk/nashorn/internal/runtime/resources">
 258        <fileset dir="${test.src.dir}/jdk/nashorn/internal/runtime/resources"/>
 259     </copy>
 260 
 261     <copy todir="${build.test.classes.dir}/jdk/nashorn/api/scripting/resources">
 262        <fileset dir="${test.src.dir}/jdk/nashorn/api/scripting/resources"/>
 263     </copy>
 264 
 265     <!-- tests that check nashorn internals and internal API -->
 266     <jar jarfile="${nashorn.internal.tests.jar}">
 267       <fileset dir="${build.test.classes.dir}" excludes="**/api/**"/>
 268     </jar>
 269 
 270     <!-- tests that check nashorn script engine (jsr-223) API -->
 271     <jar jarfile="${nashorn.api.tests.jar}">
 272       <fileset dir="${build.test.classes.dir}" includes="**/api/**"/>
 273       <fileset dir="${build.test.classes.dir}" includes="**/META-INF/**"/>
 274       <fileset dir="${build.test.classes.dir}" includes="**/resources/*.js"/>
 275     </jar>
 276 
 277   </target>
 278 
 279   <target name="generate-policy-file" depends="prepare">
 280     <echo file="${build.dir}/nashorn.policy">
 281 




 282 grant codeBase "file:/${basedir}/${nashorn.internal.tests.jar}" {
 283     permission java.security.AllPermission;
 284 };
 285 
 286 grant codeBase "file:/${basedir}/${file.reference.testng.jar}" {
 287     permission java.security.AllPermission;
 288 };
 289 
 290 grant codeBase "file:/${basedir}/test/script/trusted/*" {
 291     permission java.security.AllPermission;
 292 };
 293 
 294 grant codeBase "file:/${basedir}/test/script/maptests/*" {
 295     permission java.io.FilePermission "${basedir}/test/script/maptests/*","read";
 296     permission java.lang.RuntimePermission "nashorn.debugMode";
 297 };
 298 
 299 grant codeBase "file:/${basedir}/test/script/basic/*" {
 300     permission java.io.FilePermission "${basedir}/test/script/-", "read";
 301     permission java.io.FilePermission "$${user.dir}", "read";
 302     permission java.util.PropertyPermission "user.dir", "read";
 303     permission java.util.PropertyPermission "nashorn.test.*", "read";
 304 };
 305 
 306 grant codeBase "file:/${basedir}/test/script/basic/parser/*" {
 307     permission java.io.FilePermission "${basedir}/test/script/-", "read";
 308     permission java.io.FilePermission "$${user.dir}", "read";
 309     permission java.util.PropertyPermission "user.dir", "read";
 310     permission java.util.PropertyPermission "nashorn.test.*", "read";
 311 };
 312 
 313 grant codeBase "file:/${basedir}/test/script/basic/JDK-8010946-privileged.js" {
 314     permission java.util.PropertyPermission "java.security.policy", "read";
 315 };
 316 
 317 grant codeBase "file:/${basedir}/test/script/basic/classloader.js" {
 318     permission java.lang.RuntimePermission "nashorn.JavaReflection";
 319 };
 320 
 321 grant codeBase "file:/${basedir}/test/script/markdown.js" {
 322     permission java.io.FilePermission "${basedir}/test/script/external/showdown/-", "read";
 323 };
 324 
 325     </echo>
 326 
 327     <replace file="${build.dir}/nashorn.policy"><replacetoken>\</replacetoken><replacevalue>/</replacevalue></replace>    <!--hack for Windows - to make URLs with normal path separators -->
 328     <replace file="${build.dir}/nashorn.policy"><replacetoken>//</replacetoken><replacevalue>/</replacevalue></replace>   <!--hack for Unix - to avoid leading // in URLs -->
 329 
 330   </target>
 331 
 332   <target name="check-external-tests">
 333       <available file="${test.external.dir}/prototype" property="test-sys-prop.external.prototype"/>
 334       <available file="${test.external.dir}/sunspider" property="test-sys-prop.external.sunspider"/>
 335       <available file="${test.external.dir}/underscore" property="test-sys-prop.external.underscore"/>
 336       <available file="${test.external.dir}/octane" property="test-sys-prop.external.octane"/>
 337       <available file="${test.external.dir}/yui" property="test-sys-prop.external.yui"/>
 338       <available file="${test.external.dir}/jquery" property="test-sys-prop.external.jquery"/>
 339       <available file="${test.external.dir}/test262" property="test-sys-prop.external.test262"/>
 340       <available file="${test.external.dir}/showdown" property="test-sys-prop.external.markdown"/>
 341   </target>
 342 
 343   <target name="check-testng" unless="testng.available">
 344     <echo message="WARNING: TestNG not available, will not run tests. Please copy testng.jar under test/lib directory."/>
 345   </target>
 346 
 347   <target name="test" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
 348     <fileset id="test.classes" dir="${build.test.classes.dir}">
 349       <include name="**/api/javaaccess/*Test.class"/>
 350       <include name="**/api/scripting/*Test.class"/>
 351       <include name="**/codegen/*Test.class"/>
 352       <include name="**/parser/*Test.class"/>
 353       <include name="**/runtime/*Test.class"/>
 354       <include name="**/runtime/regexp/*Test.class"/>
 355       <include name="**/runtime/regexp/joni/*Test.class"/>
 356       <include name="**/framework/*Test.class"/>
 357     </fileset>
 358 
 359     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
 360        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
 361       <jvmarg line="${ext.class.path}"/>
 362       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
 363       <propertyset>
 364         <propertyref prefix="nashorn."/>
 365       </propertyset>
 366       <propertyset>
 367         <propertyref prefix="test-sys-prop."/>
 368         <mapper from="test-sys-prop.*" to="*" type="glob"/>
 369       </propertyset>
 370       <sysproperty key="test.js.excludes.file" value="${exclude.list}"/>
 371       <classpath>
 372           <pathelement path="${run.test.classpath}"/>
 373       </classpath>
 374     </testng>
 375   </target>
 376 
 377   <target name="test-basicparallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file">
 378       <!-- use just build.test.classes.dir to avoid referring to TestNG -->
 379       <java classname="${parallel.test.runner}" dir="${basedir}" classpath="${build.test.classes.dir}" failonerror="true" fork="true">
 380       <jvmarg line="${ext.class.path}"/>
 381       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
 382       <syspropertyset>
 383           <propertyref prefix="test-sys-prop."/>
 384           <mapper type="glob" from="test-sys-prop.*" to="*"/>
 385       </syspropertyset>
 386       </java>
 387   </target>
 388 
 389   <target name="check-jemmy.jfx.testng" unless="jemmy.jfx.testng.available">
 390     <echo message="WARNING: Jemmy or JavaFX or TestNG not available, will not run tests. Please copy testng.jar, JemmyCore.jar, JemmyFX.jar, JemmyAWTInput.jar under test${file.separator}lib directory. And make sure you have jfxrt.jar in ${java.home}${file.separator}lib${file.separator}ext dir."/>
 391   </target>
 392 
 393   <target name="testjfx" depends="jar, check-jemmy.jfx.testng, compile-test" if="jemmy.jfx.testng.available">
 394     <fileset id="test.classes" dir="${build.test.classes.dir}">
 395        <include name="**/framework/*Test.class"/>
 396     </fileset>
 397     
 398     <copy file="${file.reference.jfxrt.jar}" todir="dist"/>
 399     
 400     <condition property="jfx.prism.order" value="-Dprism.order=j2d" else=" ">
 401                 <not>
 402             <os family="mac"/>
 403         </not>
 404         </condition>
 405     
 406     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
 407        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
 408       <jvmarg line="${ext.class.path}"/>
 409       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
 410       <propertyset>
 411         <propertyref prefix="testjfx-test-sys-prop."/>
 412         <mapper from="testjfx-test-sys-prop.*" to="*" type="glob"/>
 413       </propertyset>
 414       <sysproperty key="test.fork.jvm.options" value="${testjfx-test-sys-prop.test.fork.jvm.options} ${jfx.prism.order}"/>
 415       <classpath>
 416           <pathelement path="${testjfx.run.test.classpath}"/>
 417       </classpath>
 418     </testng>
 419   </target>
 420   
 421   <target name="testmarkdown" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
 422     <fileset id="test.classes" dir="${build.test.classes.dir}">
 423        <include name="**/framework/*Test.class"/>
 424     </fileset>
 425 
 426     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
 427        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
 428       <jvmarg line="${ext.class.path}"/>
 429       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
 430       <propertyset>
 431         <propertyref prefix="testmarkdown-test-sys-prop."/>
 432         <mapper from="testmarkdown-test-sys-prop.*" to="*" type="glob"/>
 433       </propertyset>
 434       <classpath>
 435           <pathelement path="${run.test.classpath}"/>
 436       </classpath>
 437     </testng>
 438   </target>
 439   
 440   <target name="test262" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
 441     <fileset id="test.classes" dir="${build.test.classes.dir}">
 442        <include name="**/framework/*Test.class"/>
 443     </fileset>
 444 
 445     <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
 446        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
 447       <jvmarg line="${ext.class.path}"/>
 448       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
 449       <propertyset>
 450         <propertyref prefix="nashorn."/>
 451       </propertyset>
 452       <propertyset>
 453         <propertyref prefix="test262-test-sys-prop."/>
 454         <mapper from="test262-test-sys-prop.*" to="*" type="glob"/>
 455       </propertyset>
 456       <classpath>
 457           <pathelement path="${run.test.classpath}"/>
 458       </classpath>
 459     </testng>
 460   </target>
 461 
 462   <target name="test262parallel" depends="test262-parallel"/>
 463 
 464   <target name="test262-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
 465     <!-- use just build.test.classes.dir to avoid referring to TestNG -->
 466     <java classname="${parallel.test.runner}" dir="${basedir}" fork="true">
 467       <jvmarg line="${ext.class.path}"/>
 468       <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
 469       <classpath>
 470           <pathelement path="${run.test.classpath}"/>
 471       </classpath>
 472       <syspropertyset>
 473           <propertyref prefix="test262-test-sys-prop."/>
 474           <mapper type="glob" from="test262-test-sys-prop.*" to="*"/>
 475       </syspropertyset>
 476     </java>
 477   </target>
 478 
 479   <target name="all" depends="test, docs"
 480       description="Build, test and generate docs for nashorn"/>
 481 
 482   <target name="run" depends="jar"
 483       description="Run the shell with a sample script">
 484     <java classname="${nashorn.shell.tool}" fork="true" dir="samples">
 485         <jvmarg line="${ext.class.path}"/>
 486         <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
 487         <arg value="-dump-on-error"/>
 488         <arg value="test.js"/>
 489     </java>
 490   </target>
 491 
 492   <target name="debug" depends="jar"
 493       description="Debug the shell with a sample script">
 494     <java classname="${nashorn.shell.tool}" fork="true" dir="samples">
 495         <jvmarg line="${ext.class.path}"/>
 496         <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
 497         <arg value="--print-code"/>
 498         <arg value="--verify-code"/>
 499         <arg value="--print-symbols"/>
 500         <jvmarg value="-Dnashorn.codegen.debug=true"/>
 501         <arg value="test.js"/>
 502     </java>
 503   </target>
 504 
 505   <!-- targets to get external script tests -->
 506 
 507   <!-- test262 test suite -->
 508   <target name="get-test262" depends="init" unless="${test-sys-prop.external.test262}">
 509     <!-- clone test262 git repo -->
 510     <exec executable="${git.executable}">
 511        <arg value="clone"/>
 512        <arg value="https://github.com/tc39/test262"/>
 513        <arg value="${test.external.dir}/test262"/>
 514     </exec>
 515   </target>
 516   <target name="update-test262" depends="init" if="${test-sys-prop.external.test262}">
 517     <!-- update test262 git repo -->
 518     <exec executable="${git.executable}" dir="${test.external.dir}/test262">
 519        <arg value="pull"/>
 520     </exec>
 521   </target>
 522 
 523   <!-- octane benchmark -->
 524   <target name="get-octane" depends="init" unless="${test-sys-prop.external.octane}">
 525     <!-- checkout octane benchmarks -->
 526     <exec executable="${svn.executable}">
 527        <arg value="--non-interactive"/>
 528        <arg value="--trust-server-cert"/>
 529        <arg value="checkout"/>
 530        <arg value="http://octane-benchmark.googlecode.com/svn/trunk/"/>
 531        <arg value="${test.external.dir}/octane"/>
 532     </exec>
 533   </target>
 534   <target name="update-octane" depends="init" if="${test-sys-prop.external.octane}">
 535     <!-- update octane benchmarks -->
 536     <exec executable="${svn.executable}" dir="${test.external.dir}/octane">
 537        <arg value="--non-interactive"/>
 538        <arg value="--trust-server-cert"/>
 539        <arg value="update"/>
 540     </exec>
 541   </target>
 542 
 543   <!-- sunspider benchmark -->
 544   <target name="get-sunspider" depends="init" unless="${test-sys-prop.external.sunspider}">
 545     <!-- checkout sunspider -->
 546     <exec executable="${svn.executable}">
 547        <arg value="--non-interactive"/>
 548        <arg value="--trust-server-cert"/>
 549        <arg value="checkout"/>
 550        <arg value="http://svn.webkit.org/repository/webkit/trunk/PerformanceTests/SunSpider"/>
 551        <arg value="${test.external.dir}/sunspider"/>
 552     </exec>
 553   </target>
 554   <target name="update-sunspider" depends="init" if="${test-sys-prop.external.sunspider}">
 555     <!-- update sunspider -->
 556     <exec executable="${svn.executable}" dir="${test.external.dir}/sunspider">
 557        <arg value="--non-interactive"/>
 558        <arg value="--trust-server-cert"/>
 559        <arg value="update"/>
 560     </exec>
 561   </target>
 562 
 563   <!-- get all external test scripts -->
 564   <target name="externals" depends="init, check-external-tests, get-test262, get-octane, get-sunspider">
 565     <!-- make external test dir -->
 566     <mkdir dir="${test.external.dir}"/>
 567 
 568     <!-- jquery -->
 569     <mkdir dir="${test.external.dir}/jquery"/>
 570     <get src="http://code.jquery.com/jquery-1.7.2.js" dest="${test.external.dir}/jquery" skipexisting="true" ignoreerrors="true"/>
 571     <get src="http://code.jquery.com/jquery-1.7.2.min.js" dest="${test.external.dir}/jquery" skipexisting="true" ignoreerrors="true"/>
 572 
 573     <!-- prototype -->
 574     <mkdir dir="${test.external.dir}/prototype"/>
 575     <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"/>
 576 
 577     <!-- underscorejs -->
 578     <mkdir dir="${test.external.dir}/underscore"/>
 579     <get src="http://underscorejs.org/underscore.js" dest="${test.external.dir}/underscore" skipexisting="true" ignoreerrors="true"/>
 580     <get src="http://underscorejs.org/underscore-min.js" dest="${test.external.dir}/underscore" skipexisting="true" ignoreerrors="true"/>
 581 
 582     <!-- yui -->
 583     <mkdir dir="${test.external.dir}/yui"/>
 584     <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/>
 585     <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/>
 586     
 587     <!-- showdown -->
 588     <mkdir dir="${test.external.dir}/showdown"/>
 589     <get src="https://raw.github.com/coreyti/showdown/master/src/showdown.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/>
 590     <get src="https://raw.github.com/coreyti/showdown/master/src/extensions/table.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/>
 591 
 592   </target>
 593 
 594   <!-- update external test suites that are pulled from source control systems -->
 595   <target name="update-externals" depends="init, check-external-tests, update-test262, update-octane, update-sunspider"/>
 596 
 597   <!-- run all perf tests -->
 598   <target name="perf" depends="externals, update-externals, sunspider, octane"/>
 599 
 600   <!-- run all tests -->
 601   <target name="exit-if-no-testng" depends="init, check-testng" unless="${testng.available}">
 602      <fail message="Exiting.."/>
 603   </target>
 604 
 605   <target name="alltests" depends="exit-if-no-testng, externals, update-externals, test, test262parallel, perf"/>
 606 
 607 </project>
--- EOF ---