make/build.xml

Wed, 20 May 2015 14:16:19 +0530

author
sundar
date
Wed, 20 May 2015 14:16:19 +0530
changeset 1372
644d9b9c97ed
parent 1371
a8c536d1d3e0
child 1390
556876366259
permissions
-rw-r--r--

8080598: Javadoc warnings in Global.java after lazy initialization
Reviewed-by: lagergren, hannesw

jlaskey@3 1 <?xml version="1.0" encoding="UTF-8"?>
attila@963 2
jlaskey@3 3 <!--
jlaskey@7 4 Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
jlaskey@3 5 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jlaskey@3 6
jlaskey@3 7 This code is free software; you can redistribute it and/or modify it
jlaskey@3 8 under the terms of the GNU General Public License version 2 only, as
jlaskey@3 9 published by the Free Software Foundation.
jlaskey@3 10
jlaskey@3 11 This code is distributed in the hope that it will be useful, but WITHOUT
jlaskey@3 12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jlaskey@3 13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
jlaskey@3 14 version 2 for more details (a copy is included in the LICENSE file that
jlaskey@3 15 accompanied this code).
jlaskey@3 16
jlaskey@3 17 You should have received a copy of the GNU General Public License version
jlaskey@3 18 2 along with this work; if not, write to the Free Software Foundation,
jlaskey@3 19 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jlaskey@3 20
jlaskey@3 21 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
jlaskey@3 22 or visit www.oracle.com if you need additional information or have any
jlaskey@3 23 questions.
jlaskey@3 24 -->
attila@963 25
sundar@126 26 <project name="nashorn" default="test" basedir="..">
jlaskey@3 27 <import file="build-nasgen.xml"/>
lagergren@111 28 <import file="code_coverage.xml"/>
jlaskey@3 29
lagergren@111 30 <target name="init-conditions">
lagergren@111 31 <!-- loading locally defined resources and properties. NB they owerwrite default ones defined later -->
lagergren@111 32 <property file="${user.home}/.nashorn.project.local.properties"/>
lagergren@111 33
jlaskey@3 34 <loadproperties srcFile="make/project.properties"/>
yan@984 35 <path id="dist.path">
yan@984 36 <pathelement location="${dist.dir}"/>
yan@984 37 </path>
jlaskey@3 38 <path id="nashorn.ext.path">
jlaskey@3 39 <pathelement location="${dist.dir}"/>
sundar@966 40 <pathelement location="${java.ext.dirs}"/>
jlaskey@3 41 </path>
jlaskey@3 42 <property name="ext.class.path" value="-Djava.ext.dirs=&quot;${toString:nashorn.ext.path}&quot;"/>
sundar@19 43 <condition property="svn.executable" value="/usr/local/bin/svn" else="svn">
sundar@19 44 <available file="/usr/local/bin/svn"/>
sundar@19 45 </condition>
sundar@19 46 <condition property="hg.executable" value="/usr/local/bin/hg" else="hg">
sundar@19 47 <available file="/usr/local/bin/hg"/>
sundar@19 48 </condition>
sundar@775 49 <condition property="git.executable" value="/usr/local/bin/git" else="git">
sundar@775 50 <available file="/usr/local/bin/git"/>
sundar@775 51 </condition>
sundar@26 52 <!-- check if testng.jar is avaiable -->
sundar@26 53 <available property="testng.available" file="${file.reference.testng.jar}"/>
kshefov@638 54 <!-- check if Jemmy ang testng.jar are avaiable -->
kshefov@638 55 <condition property="jemmy.jfx.testng.available" value="true">
attila@963 56 <and>
kshefov@638 57 <available file="${file.reference.jemmyfx.jar}"/>
kshefov@638 58 <available file="${file.reference.jemmycore.jar}"/>
kshefov@638 59 <available file="${file.reference.jemmyawtinput.jar}"/>
kshefov@638 60 <available file="${file.reference.jfxrt.jar}"/>
kshefov@638 61 <isset property="testng.available"/>
kshefov@638 62 </and>
kshefov@638 63 </condition>
lagergren@111 64
hannesw@474 65 <!-- enable/disable make code coverage -->
hannesw@474 66 <condition property="cc.enabled">
hannesw@474 67 <istrue value="${make.code.coverage}" />
hannesw@474 68 </condition>
jlaskey@453 69
jlaskey@453 70 <!-- exclude tests in exclude lists -->
jlaskey@453 71 <condition property="exclude.list" value="./exclude/exclude_list_cc.txt" else="./exclude/exclude_list.txt">
jlaskey@453 72 <istrue value="${make.code.coverage}" />
jlaskey@453 73 </condition>
attila@963 74
attila@963 75 <condition property="jfr.options" value="${run.test.jvmargs.jfr}" else="">
attila@963 76 <istrue value="${jfr}"/>
attila@963 77 </condition>
lagergren@111 78 </target>
sundar@1061 79
sundar@1061 80 <!-- check minimum ant version required to be 1.8.4 -->
sundar@1061 81 <target name="check-ant-version">
sundar@1061 82 <property name="ant.version.required" value="1.8.4"/>
sundar@1061 83 <antversion property="ant.current.version" />
sundar@1061 84 <fail message="The current ant version, ${ant.current.version}, is too old. Please use 1.8.4 or above.">
sundar@1061 85 <condition>
sundar@1061 86 <not>
sundar@1061 87 <antversion atleast="${ant.version.required}"/>
sundar@1061 88 </not>
sundar@1061 89 </condition>
sundar@1061 90 </fail>
sundar@1061 91 </target>
sundar@1061 92
sundar@1061 93 <target name="check-java-version">
sundar@1061 94 <!-- look for a Class that is available only in jdk1.8 or above -->
sundar@1061 95 <!-- core/exposed API class is better than an implementation class -->
sundar@1061 96 <available property="jdk1.8+" classname="java.util.stream.Stream"/>
sundar@1061 97
sundar@1061 98 <!-- need jdk1.8 or above -->
sundar@1061 99 <fail message="Unsupported Java version: ${ant.java.version}. Please use Java version 1.8 or greater." unless="jdk1.8+">
sundar@1061 100 </fail>
sundar@1061 101 </target>
lagergren@1036 102
sundar@1061 103 <target name="init" depends="check-ant-version, check-java-version, init-conditions, init-cc">
hannesw@474 104 <!-- extends jvm args -->
attila@963 105 <property name="run.test.jvmargs" value="${run.test.jvmargs.main} ${run.test.cc.jvmargs} ${jfr.options}"/>
attila@963 106 <property name="run.test.jvmargs.octane" value="${run.test.jvmargs.octane.main} ${run.test.cc.jvmargs} ${jfr.options}"/>
lagergren@111 107
lagergren@111 108 <echo message="run.test.jvmargs=${run.test.jvmargs}"/>
lagergren@111 109 <echo message="run.test.jvmargs.octane=${run.test.jvmargs.octane}"/>
hannesw@562 110 <echo message="run.test.xms=${run.test.xms}"/>
hannesw@562 111 <echo message="run.test.xmx=${run.test.xmx}"/>
lagergren@111 112
jlaskey@3 113 </target>
jlaskey@3 114
jlaskey@3 115 <target name="prepare" depends="init">
jlaskey@3 116 <mkdir dir="${build.dir}"/>
jlaskey@3 117 <mkdir dir="${build.classes.dir}"/>
jlaskey@3 118 <mkdir dir="${build.classes.dir}/META-INF/services"/>
jlaskey@3 119 <mkdir dir="${build.test.classes.dir}"/>
jlaskey@3 120 <mkdir dir="${dist.dir}"/>
jlaskey@3 121 <mkdir dir="${dist.javadoc.dir}"/>
jlaskey@3 122 </target>
jlaskey@3 123
lagergren@111 124 <target name="clean" depends="init, clean-nasgen, init-cc-cleanup">
jlaskey@3 125 <delete includeemptydirs="true">
attila@90 126 <fileset dir="${build.dir}" erroronmissingdir="false"/>
jlaskey@3 127 </delete>
jlaskey@3 128 <delete dir="${dist.dir}"/>
jlaskey@3 129 </target>
jlaskey@3 130
sundar@1061 131 <target name="compile" depends="prepare" description="Compiles nashorn">
jlaskey@3 132 <javac srcdir="${src.dir}"
jlaskey@3 133 destdir="${build.classes.dir}"
jlaskey@3 134 classpath="${javac.classpath}"
jlaskey@3 135 source="${javac.source}"
jlaskey@3 136 target="${javac.target}"
jlaskey@3 137 debug="${javac.debug}"
jlaskey@3 138 encoding="${javac.encoding}"
sundar@414 139 includeantruntime="false" fork="true">
sundar@414 140 <compilerarg value="-J-Djava.ext.dirs="/>
attila@963 141 <compilerarg value="-Xlint:all"/>
jlaskey@3 142 <compilerarg value="-XDignore.symbol.file"/>
sundar@771 143 <compilerarg value="-Xdiags:verbose"/>
jlaskey@3 144 </javac>
jlaskey@3 145 <copy todir="${build.classes.dir}/META-INF/services">
jlaskey@3 146 <fileset dir="${meta.inf.dir}/services/"/>
jlaskey@3 147 </copy>
jlaskey@3 148 <copy todir="${build.classes.dir}/jdk/nashorn/api/scripting/resources">
jlaskey@3 149 <fileset dir="${src.dir}/jdk/nashorn/api/scripting/resources/"/>
jlaskey@3 150 </copy>
jlaskey@3 151 <copy todir="${build.classes.dir}/jdk/nashorn/internal/runtime/resources">
jlaskey@3 152 <fileset dir="${src.dir}/jdk/nashorn/internal/runtime/resources/"/>
jlaskey@3 153 </copy>
jlaskey@3 154 <copy todir="${build.classes.dir}/jdk/nashorn/tools/resources">
jlaskey@3 155 <fileset dir="${src.dir}/jdk/nashorn/tools/resources/"/>
jlaskey@3 156 </copy>
attila@90 157 <copy file="${src.dir}/jdk/internal/dynalink/support/messages.properties" todir="${build.classes.dir}/jdk/internal/dynalink/support"/>
attila@1091 158 <copy file="${src.dir}/jdk/nashorn/internal/codegen/anchor.properties" todir="${build.classes.dir}/jdk/nashorn/internal/codegen"/>
attila@90 159
jlaskey@3 160 <echo message="full=${nashorn.fullversion}" file="${build.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties"/>
jlaskey@3 161 <echo file="${build.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties" append="true">${line.separator}</echo>
jlaskey@3 162 <echo message="release=${nashorn.version}" file="${build.classes.dir}/jdk/nashorn/internal/runtime/resources/version.properties" append="true"/>
jlaskey@3 163 </target>
jlaskey@3 164
jlaskey@392 165 <target name="jar" depends="compile, run-nasgen, generate-cc-template" description="Creates nashorn.jar" unless="compile.suppress.jar">
jlaskey@3 166 <jar jarfile="${dist.jar}" manifest="${meta.inf.dir}/MANIFEST.MF" index="true" filesetmanifest="merge">
jlaskey@3 167 <fileset dir="${build.classes.dir}"/>
jlaskey@3 168 <manifest>
jlaskey@3 169 <attribute name="Archiver-Version" value="n/a"/>
jlaskey@3 170 <attribute name="Build-Jdk" value="${java.runtime.version}"/>
jlaskey@3 171 <attribute name="Built-By" value="n/a"/>
jlaskey@3 172 <attribute name="Created-By" value="Ant jar task"/>
jlaskey@3 173 <section name="jdk/nashorn/">
jlaskey@3 174 <attribute name="Implementation-Title" value="${nashorn.product.name}"/>
jlaskey@3 175 <attribute name="Implementation-Version" value="${nashorn.version}"/>
jlaskey@3 176 </section>
jlaskey@3 177 </manifest>
jlaskey@3 178 </jar>
jlaskey@3 179 </target>
jlaskey@392 180
jlaskey@392 181 <target name="use-promoted-nashorn" depends="init">
jlaskey@392 182 <delete file="${dist.dir}/nashorn.jar"/>
jlaskey@392 183 <copy file="${java.home}/lib/ext/nashorn.jar" todir="${dist.dir}"/>
jlaskey@392 184 <property name="compile.suppress.jar" value="defined"/>
jlaskey@392 185 </target>
jlaskey@392 186
jlaskey@161 187 <target name="build-fxshell" depends="jar">
jlaskey@161 188 <description>Builds the javafx shell.</description>
jlaskey@161 189 <mkdir dir="${fxshell.classes.dir}"/>
jlaskey@161 190 <javac srcdir="${fxshell.dir}"
jlaskey@161 191 destdir="${fxshell.classes.dir}"
mhaupt@1353 192 classpath="${dist.jar}${path.separator}${javac.classpath}"
jlaskey@161 193 debug="${javac.debug}"
jlaskey@161 194 encoding="${javac.encoding}"
jlaskey@161 195 includeantruntime="false">
jlaskey@161 196 </javac>
jlaskey@161 197 <jar jarfile="${fxshell.jar}" manifest="${meta.inf.dir}/MANIFEST.MF" index="true" filesetmanifest="merge">
jlaskey@161 198 <fileset dir="${fxshell.classes.dir}"/>
jlaskey@161 199 <manifest>
jlaskey@161 200 <attribute name="Archiver-Version" value="n/a"/>
jlaskey@161 201 <attribute name="Build-Jdk" value="${java.runtime.version}"/>
jlaskey@161 202 <attribute name="Built-By" value="n/a"/>
jlaskey@161 203 <attribute name="Created-By" value="Ant jar task"/>
jlaskey@161 204 <section name="jdk/nashorn/">
jlaskey@161 205 <attribute name="Implementation-Title" value="Oracle Nashorn FXShell"/>
jlaskey@161 206 <attribute name="Implementation-Version" value="${nashorn.version}"/>
jlaskey@161 207 </section>
jlaskey@161 208 </manifest>
jlaskey@161 209 </jar>
jlaskey@161 210 </target>
jlaskey@3 211
sundar@864 212 <target name="javadoc" depends="jar">
sundar@1371 213 <javadoc destdir="${dist.javadoc.dir}" use="yes" overview="${src.dir}/overview.html"
sundar@864 214 extdirs="${nashorn.ext.path}" windowtitle="${nashorn.product.name} ${nashorn.version}"
sundar@864 215 additionalparam="-quiet" failonerror="true">
jlaskey@3 216 <classpath>
jlaskey@3 217 <pathelement location="${build.classes.dir}"/>
jlaskey@3 218 </classpath>
jlaskey@3 219 <fileset dir="${src.dir}" includes="**/*.java"/>
sundar@10 220 <fileset dir="${jdk.asm.src.dir}" includes="**/*.java"/>
sundar@864 221 <link href="http://docs.oracle.com/javase/8/docs/api/"/>
sundar@10 222 <!-- The following tags are used only in ASM sources - just ignore these -->
sundar@10 223 <tag name="label" description="label tag in ASM sources" enabled="false"/>
sundar@10 224 <tag name="linked" description="linked tag in ASM sources" enabled="false"/>
sundar@10 225 <tag name="associates" description="associates tag in ASM sources" enabled="false"/>
jlaskey@3 226 </javadoc>
jlaskey@3 227 </target>
jlaskey@3 228
sundar@864 229 <!-- generate javadoc only for nashorn extension api classes -->
sundar@864 230 <target name="javadocapi" depends="jar">
sundar@864 231 <javadoc destdir="${dist.javadoc.dir}" use="yes" extdirs="${nashorn.ext.path}"
sundar@864 232 windowtitle="${nashorn.product.name}" additionalparam="-quiet" failonerror="true">
sundar@864 233 <classpath>
sundar@864 234 <pathelement location="${build.classes.dir}"/>
sundar@864 235 </classpath>
sundar@864 236 <fileset dir="${src.dir}" includes="jdk/nashorn/api/**/*.java"/>
sundar@864 237 <link href="http://docs.oracle.com/javase/8/docs/api/"/>
sundar@864 238 </javadoc>
sundar@864 239 </target>
sundar@864 240
sundar@864 241
jlaskey@3 242 <!-- generate shell.html for shell tool documentation -->
jlaskey@3 243 <target name="shelldoc" depends="jar">
jlaskey@3 244 <java classname="${nashorn.shell.tool}" dir="${basedir}" output="${dist.dir}/shell.html" failonerror="true" fork="true">
jlaskey@3 245 <jvmarg line="${ext.class.path}"/>
jlaskey@3 246 <arg value="-scripting"/>
jlaskey@3 247 <arg value="docs/genshelldoc.js"/>
jlaskey@3 248 </java>
jlaskey@3 249 </target>
jlaskey@3 250
jlaskey@3 251 <!-- generate all docs -->
jlaskey@3 252 <target name="docs" depends="javadoc, shelldoc"/>
jlaskey@3 253
jlaskey@3 254 <!-- create .zip and .tar.gz for nashorn binaries and scripts. -->
jlaskey@3 255 <target name="dist" depends="jar">
jlaskey@3 256 <zip destfile="${build.zip}" basedir=".."
jlaskey@3 257 excludes="nashorn/bin/*.sh" includes="nashorn/bin/** nashorn/dist/**"/>
jlaskey@3 258 <tar destfile="${build.gzip}" basedir=".." compression="gzip"
jlaskey@3 259 excludes="nashorn/bin/*.sh" includes="nashorn/bin/** nashorn/dist/**"/>
jlaskey@3 260 </target>
jlaskey@3 261
jlaskey@3 262 <target name="compile-test" depends="compile, run-nasgen" if="testng.available">
jlaskey@3 263 <!-- testng task -->
jlaskey@3 264 <taskdef name="testng" classname="org.testng.TestNGAntTask"
jlaskey@3 265 classpath="${file.reference.testng.jar}"/>
jlaskey@3 266
jlaskey@3 267 <javac srcdir="${test.src.dir}"
jlaskey@3 268 destdir="${build.test.classes.dir}"
jlaskey@3 269 classpath="${javac.test.classpath}"
jlaskey@3 270 source="${javac.source}"
jlaskey@3 271 target="${javac.target}"
jlaskey@3 272 debug="${javac.debug}"
jlaskey@3 273 encoding="${javac.encoding}"
sundar@428 274 includeantruntime="false" fork="true">
sundar@428 275 <compilerarg value="-J-Djava.ext.dirs="/>
sundar@428 276 <compilerarg value="-Xlint:unchecked"/>
sundar@428 277 <compilerarg value="-Xlint:deprecation"/>
sundar@771 278 <compilerarg value="-Xdiags:verbose"/>
sundar@278 279 </javac>
sundar@77 280
sundar@552 281 <copy todir="${build.test.classes.dir}/META-INF/services">
sundar@552 282 <fileset dir="${test.src.dir}/META-INF/services/"/>
sundar@552 283 </copy>
sundar@552 284
sundar@1326 285 <copy todir="${build.test.classes.dir}/jdk/nashorn/internal/runtime/test/resources">
sundar@1326 286 <fileset dir="${test.src.dir}/jdk/nashorn/internal/runtime/test/resources"/>
sundar@587 287 </copy>
sundar@587 288
sundar@1326 289 <copy todir="${build.test.classes.dir}/jdk/nashorn/api/scripting/test/resources">
sundar@1326 290 <fileset dir="${test.src.dir}/jdk/nashorn/api/scripting/test/resources"/>
hannesw@769 291 </copy>
hannesw@769 292
sundar@77 293 <!-- tests that check nashorn internals and internal API -->
sundar@77 294 <jar jarfile="${nashorn.internal.tests.jar}">
sundar@136 295 <fileset dir="${build.test.classes.dir}" excludes="**/api/**"/>
sundar@77 296 </jar>
sundar@77 297
sundar@77 298 <!-- tests that check nashorn script engine (jsr-223) API -->
sundar@77 299 <jar jarfile="${nashorn.api.tests.jar}">
sundar@136 300 <fileset dir="${build.test.classes.dir}" includes="**/api/**"/>
sundar@552 301 <fileset dir="${build.test.classes.dir}" includes="**/META-INF/**"/>
sundar@587 302 <fileset dir="${build.test.classes.dir}" includes="**/resources/*.js"/>
sundar@77 303 </jar>
sundar@77 304
jlaskey@3 305 </target>
jlaskey@3 306
attila@92 307 <target name="generate-policy-file" depends="prepare">
attila@404 308 <echo file="${build.dir}/nashorn.policy">
sundar@77 309
yan@984 310 grant codeBase "file:/${toString:dist.path}/nashorn.jar" {
attila@963 311 permission java.security.AllPermission;
attila@963 312 };
attila@963 313
attila@404 314 grant codeBase "file:/${basedir}/${nashorn.internal.tests.jar}" {
attila@404 315 permission java.security.AllPermission;
attila@404 316 };
jlaskey@392 317
attila@404 318 grant codeBase "file:/${basedir}/${file.reference.testng.jar}" {
attila@404 319 permission java.security.AllPermission;
attila@404 320 };
attila@963 321 //// in case of absolute path:
attila@963 322 grant codeBase "file:/${nashorn.internal.tests.jar}" {
attila@963 323 permission java.security.AllPermission;
attila@963 324 };
attila@963 325
attila@963 326 grant codeBase "file:/${file.reference.testng.jar}" {
attila@963 327 permission java.security.AllPermission;
attila@963 328 };
jlaskey@3 329
attila@404 330 grant codeBase "file:/${basedir}/test/script/trusted/*" {
attila@404 331 permission java.security.AllPermission;
attila@404 332 };
jlaskey@3 333
sundar@762 334 grant codeBase "file:/${basedir}/test/script/maptests/*" {
sundar@762 335 permission java.io.FilePermission "${basedir}/test/script/maptests/*","read";
sundar@762 336 permission java.lang.RuntimePermission "nashorn.debugMode";
sundar@762 337 };
sundar@762 338
attila@404 339 grant codeBase "file:/${basedir}/test/script/basic/*" {
attila@404 340 permission java.io.FilePermission "${basedir}/test/script/-", "read";
attila@404 341 permission java.io.FilePermission "$${user.dir}", "read";
attila@404 342 permission java.util.PropertyPermission "user.dir", "read";
attila@404 343 permission java.util.PropertyPermission "nashorn.test.*", "read";
attila@404 344 };
attila@404 345
sundar@551 346 grant codeBase "file:/${basedir}/test/script/basic/parser/*" {
sundar@551 347 permission java.io.FilePermission "${basedir}/test/script/-", "read";
sundar@551 348 permission java.io.FilePermission "$${user.dir}", "read";
sundar@551 349 permission java.util.PropertyPermission "user.dir", "read";
sundar@551 350 permission java.util.PropertyPermission "nashorn.test.*", "read";
sundar@551 351 };
sundar@551 352
hannesw@991 353 grant codeBase "file:/${basedir}/test/script/basic/es6/*" {
hannesw@991 354 permission java.io.FilePermission "${basedir}/test/script/-", "read";
hannesw@991 355 permission java.io.FilePermission "$${user.dir}", "read";
hannesw@991 356 permission java.util.PropertyPermission "user.dir", "read";
hannesw@991 357 permission java.util.PropertyPermission "nashorn.test.*", "read";
hannesw@991 358 };
hannesw@991 359
attila@404 360 grant codeBase "file:/${basedir}/test/script/basic/JDK-8010946-privileged.js" {
attila@404 361 permission java.util.PropertyPermission "java.security.policy", "read";
attila@404 362 };
attila@458 363
attila@458 364 grant codeBase "file:/${basedir}/test/script/basic/classloader.js" {
attila@458 365 permission java.lang.RuntimePermission "nashorn.JavaReflection";
attila@458 366 };
attila@458 367
attila@963 368 grant codeBase "file:/${basedir}/test/script/markdown.js" {
attila@963 369 permission java.io.FilePermission "${basedir}/test/script/external/showdown/-", "read";
attila@963 370 };
attila@963 371
attila@404 372 </echo>
jlaskey@3 373
jlaskey@3 374 <replace file="${build.dir}/nashorn.policy"><replacetoken>\</replacetoken><replacevalue>/</replacevalue></replace> <!--hack for Windows - to make URLs with normal path separators -->
jlaskey@3 375 <replace file="${build.dir}/nashorn.policy"><replacetoken>//</replacetoken><replacevalue>/</replacevalue></replace> <!--hack for Unix - to avoid leading // in URLs -->
jlaskey@3 376
jlaskey@3 377 </target>
jlaskey@3 378
jlaskey@3 379 <target name="check-external-tests">
jlaskey@3 380 <available file="${test.external.dir}/prototype" property="test-sys-prop.external.prototype"/>
jlaskey@3 381 <available file="${test.external.dir}/sunspider" property="test-sys-prop.external.sunspider"/>
jlaskey@3 382 <available file="${test.external.dir}/underscore" property="test-sys-prop.external.underscore"/>
jlaskey@3 383 <available file="${test.external.dir}/octane" property="test-sys-prop.external.octane"/>
jlaskey@3 384 <available file="${test.external.dir}/yui" property="test-sys-prop.external.yui"/>
jlaskey@3 385 <available file="${test.external.dir}/jquery" property="test-sys-prop.external.jquery"/>
jlaskey@3 386 <available file="${test.external.dir}/test262" property="test-sys-prop.external.test262"/>
attila@963 387 <available file="${test.external.dir}/showdown" property="test-sys-prop.external.markdown"/>
jlaskey@3 388 </target>
jlaskey@3 389
jlaskey@3 390 <target name="check-testng" unless="testng.available">
jlaskey@3 391 <echo message="WARNING: TestNG not available, will not run tests. Please copy testng.jar under test/lib directory."/>
jlaskey@3 392 </target>
jlaskey@3 393
sundar@870 394 <!-- only to be invoked as dependency of "test" target -->
sundar@870 395 <target name="-test-classes-all" depends="jar" unless="test.class">
sundar@870 396 <fileset id="test.classes" dir="${build.test.classes.dir}">
sundar@1327 397 <include name="**/api/javaaccess/test/*Test.class"/>
sundar@1327 398 <include name="**/api/scripting/test/*Test.class"/>
sundar@1327 399 <include name="**/codegen/test/*Test.class"/>
sundar@1327 400 <include name="**/parser/test/*Test.class"/>
sundar@1327 401 <include name="**/runtime/test/*Test.class"/>
sundar@1327 402 <include name="**/runtime/regexp/test/*Test.class"/>
sundar@1327 403 <include name="**/runtime/regexp/joni/test/*Test.class"/>
sundar@870 404 <include name="**/framework/*Test.class"/>
sundar@870 405 </fileset>
sundar@870 406 </target>
jlaskey@3 407
sundar@870 408 <!-- only to be invoked as dependency of "test" target -->
sundar@870 409 <target name="-test-classes-single" depends="jar" if="test.class">
sundar@870 410 <fileset id="test.classes" dir="${build.test.classes.dir}">
sundar@870 411 <include name="${test.class}*"/>
sundar@870 412 </fileset>
sundar@870 413 </target>
sundar@870 414
sundar@870 415 <!-- only to be invoked as dependency of "test" target -->
sundar@870 416 <target name="-test-nosecurity" unless="test.class">
sundar@855 417 <fileset id="test.nosecurity.classes" dir="${build.test.classes.dir}">
sundar@855 418 <include name="**/framework/ScriptTest.class"/>
sundar@855 419 </fileset>
attila@1055 420 <testng outputdir="${build.nosecurity.test.results.dir}/${testResultsSubDir}" classfilesetref="test.nosecurity.classes"
sundar@855 421 verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
sundar@855 422 <jvmarg line="${ext.class.path}"/>
attila@963 423 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} -Dbuild.dir=${build.dir}"/>
attila@963 424 <sysproperty key="nashorn.jar" value="${dist.dir}/nashorn.jar"/>
sundar@855 425 <propertyset>
sundar@855 426 <propertyref prefix="nashorn."/>
sundar@855 427 </propertyset>
sundar@855 428 <propertyset>
sundar@855 429 <propertyref prefix="test-sys-prop-no-security."/>
sundar@855 430 <mapper from="test-sys-prop-no-security.*" to="*" type="glob"/>
sundar@855 431 </propertyset>
lagergren@1036 432 <sysproperty key="optimistic.override" value="${optimistic}"/>
sundar@855 433 <classpath>
sundar@855 434 <pathelement path="${run.test.classpath}"/>
sundar@855 435 </classpath>
sundar@855 436 </testng>
jlaskey@3 437 </target>
jlaskey@3 438
sundar@870 439 <!-- only to be invoked as dependency of "test" target -->
sundar@870 440 <target name="-test-security">
sundar@870 441 <delete dir="${build.dir}/nashorn_code_cache"/>
sundar@870 442 <property name="debug.test.jvmargs" value=""/>
attila@1055 443 <testng outputdir="${build.test.results.dir}/${testResultsSubDir}" classfilesetref="test.classes"
lagergren@1036 444 verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
sundar@870 445 <jvmarg line="${ext.class.path}"/>
attila@963 446 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
sundar@870 447 <jvmarg line="${debug.test.jvmargs}"/>
sundar@870 448 <propertyset>
attila@963 449 <propertyref prefix="nashorn."/>
attila@963 450 </propertyset>
attila@963 451 <propertyset>
sundar@870 452 <propertyref prefix="test-sys-prop."/>
sundar@870 453 <mapper from="test-sys-prop.*" to="*" type="glob"/>
sundar@870 454 </propertyset>
lagergren@1036 455 <sysproperty key="optimistic.override" value="${optimistic}"/>
sundar@870 456 <sysproperty key="test.js.excludes.file" value="${exclude.list}"/>
sundar@870 457 <classpath>
sundar@870 458 <pathelement path="${run.test.classpath}"/>
sundar@870 459 </classpath>
sundar@870 460 </testng>
sundar@870 461 </target>
sundar@870 462
sundar@1372 463 <target name="test" depends="javadoc, test-pessimistic, test-optimistic"/>
lagergren@1036 464
lagergren@1036 465 <target name="test-optimistic" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
lagergren@1036 466 <echo message="Running test suite in OPTIMISTIC mode..."/>
lagergren@1036 467 <antcall target="-test-nosecurity" inheritRefs="true">
lagergren@1036 468 <param name="optimistic" value="true"/>
attila@1055 469 <param name="testResultsSubDir" value="optimistic"/>
lagergren@1036 470 </antcall>
lagergren@1036 471 <antcall target="-test-security" inheritRefs="true">
lagergren@1036 472 <param name="optimistic" value="true"/>
attila@1055 473 <param name="testResultsSubDir" value="optimistic"/>
lagergren@1036 474 </antcall>
lagergren@1036 475 </target>
lagergren@1036 476
lagergren@1036 477 <target name="test-pessimistic" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
lagergren@1036 478 <echo message="Running test suite in PESSIMISTIC mode..."/>
lagergren@1036 479 <antcall target="-test-nosecurity" inheritRefs="true">
lagergren@1036 480 <param name="optimistic" value="false"/>
attila@1055 481 <param name="testResultsSubDir" value="pessimistic"/>
lagergren@1036 482 </antcall>
lagergren@1036 483 <antcall target="-test-security" inheritRefs="true">
lagergren@1036 484 <param name="optimistic" value="false"/>
attila@1055 485 <param name="testResultsSubDir" value="pessimistic"/>
lagergren@1036 486 </antcall>
lagergren@1036 487 </target>
sundar@870 488
kshefov@638 489 <target name="check-jemmy.jfx.testng" unless="jemmy.jfx.testng.available">
kshefov@638 490 <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."/>
kshefov@638 491 </target>
kshefov@638 492
kshefov@638 493 <target name="testjfx" depends="jar, check-jemmy.jfx.testng, compile-test" if="jemmy.jfx.testng.available">
kshefov@638 494 <fileset id="test.classes" dir="${build.test.classes.dir}">
kshefov@638 495 <include name="**/framework/*Test.class"/>
kshefov@638 496 </fileset>
attila@963 497
kshefov@638 498 <copy file="${file.reference.jfxrt.jar}" todir="dist"/>
attila@963 499
kshefov@667 500 <condition property="jfx.prism.order" value="-Dprism.order=j2d" else=" ">
attila@963 501 <not>
kshefov@667 502 <os family="mac"/>
kshefov@667 503 </not>
attila@963 504 </condition>
attila@963 505
kshefov@638 506 <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
kshefov@638 507 verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
kshefov@638 508 <jvmarg line="${ext.class.path}"/>
attila@963 509 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} -Dbuild.dir=${build.dir}"/>
kshefov@638 510 <propertyset>
kshefov@638 511 <propertyref prefix="testjfx-test-sys-prop."/>
kshefov@638 512 <mapper from="testjfx-test-sys-prop.*" to="*" type="glob"/>
kshefov@638 513 </propertyset>
kshefov@667 514 <sysproperty key="test.fork.jvm.options" value="${testjfx-test-sys-prop.test.fork.jvm.options} ${jfx.prism.order}"/>
kshefov@638 515 <classpath>
kshefov@638 516 <pathelement path="${testjfx.run.test.classpath}"/>
kshefov@638 517 </classpath>
kshefov@638 518 </testng>
kshefov@638 519 </target>
attila@963 520
attila@963 521 <target name="testmarkdown" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
attila@963 522 <fileset id="test.classes" dir="${build.test.classes.dir}">
attila@963 523 <include name="**/framework/*Test.class"/>
attila@963 524 </fileset>
attila@963 525
attila@963 526 <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
attila@963 527 verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
attila@963 528 <jvmarg line="${ext.class.path}"/>
attila@963 529 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
attila@963 530 <propertyset>
attila@963 531 <propertyref prefix="testmarkdown-test-sys-prop."/>
attila@963 532 <mapper from="testmarkdown-test-sys-prop.*" to="*" type="glob"/>
attila@963 533 </propertyset>
attila@963 534 <classpath>
attila@963 535 <pathelement path="${run.test.classpath}"/>
attila@963 536 </classpath>
attila@963 537 </testng>
attila@963 538 </target>
attila@963 539
sundar@87 540 <target name="test262" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
jlaskey@3 541 <fileset id="test.classes" dir="${build.test.classes.dir}">
jlaskey@3 542 <include name="**/framework/*Test.class"/>
jlaskey@3 543 </fileset>
jlaskey@3 544
jlaskey@3 545 <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
jlaskey@3 546 verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
jlaskey@3 547 <jvmarg line="${ext.class.path}"/>
attila@963 548 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
attila@963 549 <propertyset>
attila@963 550 <propertyref prefix="nashorn."/>
attila@963 551 </propertyset>
jlaskey@3 552 <propertyset>
jlaskey@3 553 <propertyref prefix="test262-test-sys-prop."/>
jlaskey@3 554 <mapper from="test262-test-sys-prop.*" to="*" type="glob"/>
jlaskey@3 555 </propertyset>
jlaskey@3 556 <classpath>
jlaskey@3 557 <pathelement path="${run.test.classpath}"/>
jlaskey@3 558 </classpath>
jlaskey@3 559 </testng>
jlaskey@3 560 </target>
jlaskey@3 561
jlaskey@3 562 <target name="test262parallel" depends="test262-parallel"/>
jlaskey@3 563
sundar@87 564 <target name="test262-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
jlaskey@3 565 <!-- use just build.test.classes.dir to avoid referring to TestNG -->
sundar@87 566 <java classname="${parallel.test.runner}" dir="${basedir}" fork="true">
jlaskey@3 567 <jvmarg line="${ext.class.path}"/>
attila@963 568 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs} -Dbuild.dir=${build.dir}"/>
attila@963 569 <!-- avoid too many typeinfo cache files. Each script is run only once anyway -->
attila@963 570 <jvmarg line="-Dnashorn.typeInfo.disabled=true"/>
sundar@87 571 <classpath>
sundar@87 572 <pathelement path="${run.test.classpath}"/>
sundar@87 573 </classpath>
jlaskey@3 574 <syspropertyset>
jlaskey@3 575 <propertyref prefix="test262-test-sys-prop."/>
jlaskey@3 576 <mapper type="glob" from="test262-test-sys-prop.*" to="*"/>
jlaskey@3 577 </syspropertyset>
jlaskey@3 578 </java>
jlaskey@3 579 </target>
jlaskey@3 580
attila@963 581 <target name="testparallel" depends="test-parallel"/>
attila@963 582
attila@963 583 <target name="test-parallel" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
attila@963 584 <!-- use just build.test.classes.dir to avoid referring to TestNG -->
attila@963 585 <java classname="${parallel.test.runner}" dir="${basedir}"
attila@963 586 failonerror="true"
attila@963 587 fork="true">
attila@963 588 <jvmarg line="${ext.class.path}"/>
attila@963 589 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
attila@963 590 <classpath>
attila@963 591 <pathelement path="${run.test.classpath}"/>
attila@963 592 <pathelement path="${build.test.classes.dir}"/>
attila@963 593 </classpath>
attila@963 594 <syspropertyset>
attila@963 595 <propertyref prefix="test-sys-prop."/>
attila@963 596 <mapper type="glob" from="test-sys-prop.*" to="*"/>
attila@963 597 </syspropertyset>
attila@963 598 </java>
attila@963 599 </target>
attila@963 600
jlaskey@3 601 <target name="all" depends="test, docs"
jlaskey@3 602 description="Build, test and generate docs for nashorn"/>
jlaskey@3 603
jlaskey@3 604 <target name="run" depends="jar"
jlaskey@3 605 description="Run the shell with a sample script">
jlaskey@3 606 <java classname="${nashorn.shell.tool}" fork="true" dir="samples">
jlaskey@3 607 <jvmarg line="${ext.class.path}"/>
hannesw@562 608 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
jlaskey@3 609 <arg value="-dump-on-error"/>
jlaskey@3 610 <arg value="test.js"/>
jlaskey@3 611 </java>
jlaskey@3 612 </target>
jlaskey@3 613
jlaskey@3 614 <target name="debug" depends="jar"
jlaskey@3 615 description="Debug the shell with a sample script">
jlaskey@3 616 <java classname="${nashorn.shell.tool}" fork="true" dir="samples">
jlaskey@3 617 <jvmarg line="${ext.class.path}"/>
hannesw@562 618 <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
jlaskey@3 619 <arg value="--print-code"/>
jlaskey@3 620 <arg value="--verify-code"/>
jlaskey@3 621 <arg value="--print-symbols"/>
jlaskey@3 622 <jvmarg value="-Dnashorn.codegen.debug=true"/>
jlaskey@3 623 <arg value="test.js"/>
jlaskey@3 624 </java>
jlaskey@3 625 </target>
sundar@19 626
sundar@19 627 <!-- targets to get external script tests -->
sundar@19 628
sundar@19 629 <!-- test262 test suite -->
sundar@19 630 <target name="get-test262" depends="init" unless="${test-sys-prop.external.test262}">
sundar@775 631 <!-- clone test262 git repo -->
sundar@775 632 <exec executable="${git.executable}">
sundar@19 633 <arg value="clone"/>
attila@963 634 <arg value="--branch"/>
attila@963 635 <arg value="es5-tests"/>
sundar@775 636 <arg value="https://github.com/tc39/test262"/>
sundar@19 637 <arg value="${test.external.dir}/test262"/>
sundar@19 638 </exec>
sundar@19 639 </target>
sundar@19 640 <target name="update-test262" depends="init" if="${test-sys-prop.external.test262}">
sundar@775 641 <!-- update test262 git repo -->
sundar@775 642 <exec executable="${git.executable}" dir="${test.external.dir}/test262">
sundar@19 643 <arg value="pull"/>
sundar@19 644 </exec>
sundar@19 645 </target>
sundar@19 646
sundar@19 647 <!-- octane benchmark -->
sundar@19 648 <target name="get-octane" depends="init" unless="${test-sys-prop.external.octane}">
sundar@19 649 <!-- checkout octane benchmarks -->
sundar@19 650 <exec executable="${svn.executable}">
sundar@19 651 <arg value="--non-interactive"/>
sundar@19 652 <arg value="--trust-server-cert"/>
sundar@19 653 <arg value="checkout"/>
sundar@19 654 <arg value="http://octane-benchmark.googlecode.com/svn/trunk/"/>
sundar@19 655 <arg value="${test.external.dir}/octane"/>
sundar@19 656 </exec>
sundar@19 657 </target>
sundar@19 658 <target name="update-octane" depends="init" if="${test-sys-prop.external.octane}">
sundar@19 659 <!-- update octane benchmarks -->
sundar@19 660 <exec executable="${svn.executable}" dir="${test.external.dir}/octane">
sundar@19 661 <arg value="--non-interactive"/>
sundar@19 662 <arg value="--trust-server-cert"/>
sundar@19 663 <arg value="update"/>
sundar@19 664 </exec>
sundar@19 665 </target>
sundar@19 666
sundar@19 667 <!-- sunspider benchmark -->
sundar@19 668 <target name="get-sunspider" depends="init" unless="${test-sys-prop.external.sunspider}">
sundar@19 669 <!-- checkout sunspider -->
sundar@19 670 <exec executable="${svn.executable}">
sundar@19 671 <arg value="--non-interactive"/>
sundar@19 672 <arg value="--trust-server-cert"/>
sundar@19 673 <arg value="checkout"/>
sundar@19 674 <arg value="http://svn.webkit.org/repository/webkit/trunk/PerformanceTests/SunSpider"/>
sundar@19 675 <arg value="${test.external.dir}/sunspider"/>
sundar@19 676 </exec>
sundar@19 677 </target>
sundar@19 678 <target name="update-sunspider" depends="init" if="${test-sys-prop.external.sunspider}">
sundar@19 679 <!-- update sunspider -->
sundar@19 680 <exec executable="${svn.executable}" dir="${test.external.dir}/sunspider">
sundar@19 681 <arg value="--non-interactive"/>
sundar@19 682 <arg value="--trust-server-cert"/>
sundar@19 683 <arg value="update"/>
sundar@19 684 </exec>
sundar@19 685 </target>
sundar@19 686
sundar@19 687 <!-- get all external test scripts -->
sundar@26 688 <target name="externals" depends="init, check-external-tests, get-test262, get-octane, get-sunspider">
sundar@19 689 <!-- make external test dir -->
jlaskey@392 690 <mkdir dir="${test.external.dir}"/>
sundar@19 691
sundar@19 692 <!-- jquery -->
jlaskey@392 693 <mkdir dir="${test.external.dir}/jquery"/>
sundar@19 694 <get src="http://code.jquery.com/jquery-1.7.2.js" dest="${test.external.dir}/jquery" skipexisting="true" ignoreerrors="true"/>
sundar@19 695 <get src="http://code.jquery.com/jquery-1.7.2.min.js" dest="${test.external.dir}/jquery" skipexisting="true" ignoreerrors="true"/>
sundar@19 696
sundar@19 697 <!-- prototype -->
jlaskey@392 698 <mkdir dir="${test.external.dir}/prototype"/>
sundar@19 699 <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"/>
sundar@19 700
sundar@19 701 <!-- underscorejs -->
jlaskey@392 702 <mkdir dir="${test.external.dir}/underscore"/>
sundar@19 703 <get src="http://underscorejs.org/underscore.js" dest="${test.external.dir}/underscore" skipexisting="true" ignoreerrors="true"/>
sundar@19 704 <get src="http://underscorejs.org/underscore-min.js" dest="${test.external.dir}/underscore" skipexisting="true" ignoreerrors="true"/>
sundar@19 705
sundar@19 706 <!-- yui -->
jlaskey@392 707 <mkdir dir="${test.external.dir}/yui"/>
sundar@19 708 <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/>
sundar@19 709 <get src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js" dest="${test.external.dir}/yui" skipexisting="true" ignoreerrors="true"/>
sundar@19 710
attila@963 711 <!-- showdown -->
attila@963 712 <mkdir dir="${test.external.dir}/showdown"/>
attila@963 713 <get src="https://raw.github.com/coreyti/showdown/master/src/showdown.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/>
attila@963 714 <get src="https://raw.github.com/coreyti/showdown/master/src/extensions/table.js" dest="${test.external.dir}/showdown" skipexisting="true" ignoreerrors="true"/>
attila@963 715
sundar@19 716 </target>
sundar@19 717
sundar@19 718 <!-- update external test suites that are pulled from source control systems -->
sundar@26 719 <target name="update-externals" depends="init, check-external-tests, update-test262, update-octane, update-sunspider"/>
sundar@26 720
sundar@26 721 <!-- run all perf tests -->
sundar@26 722 <target name="perf" depends="externals, update-externals, sunspider, octane"/>
sundar@26 723
sundar@26 724 <!-- run all tests -->
sundar@26 725 <target name="exit-if-no-testng" depends="init, check-testng" unless="${testng.available}">
sundar@26 726 <fail message="Exiting.."/>
sundar@26 727 </target>
sundar@26 728
sundar@26 729 <target name="alltests" depends="exit-if-no-testng, externals, update-externals, test, test262parallel, perf"/>
sundar@19 730
attila@963 731 <import file="build-benchmark.xml"/>
attila@963 732
jlaskey@3 733 </project>

mercurial