aboutsummaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
authorsundar <none@none>2014-10-20 18:40:42 +0530
committersundar <none@none>2014-10-20 18:40:42 +0530
commitf4040593e204787c2cc1ff5c5851b827e092b27c (patch)
tree003f283c59eea8fd171e7c41844ffd1c01671bda /make
parentfebd4a3101e807cd4251abd61c220bbc08c94f43 (diff)
downloadnashorn-f4040593e204787c2cc1ff5c5851b827e092b27c.tar.gz
8061257: nashorn ant build script should have a sanity target
Reviewed-by: lagergren, hannesw, attila
Diffstat (limited to 'make')
-rw-r--r--make/build-nasgen.xml2
-rw-r--r--make/build.xml41
2 files changed, 26 insertions, 17 deletions
diff --git a/make/build-nasgen.xml b/make/build-nasgen.xml
index 16094cc9..862a1999 100644
--- a/make/build-nasgen.xml
+++ b/make/build-nasgen.xml
@@ -25,7 +25,7 @@
<description>Builds and runs nasgen.</description>
<import file="build.xml"/>
- <target name="build-nasgen" depends="compile-asm">
+ <target name="build-nasgen" depends="prepare">
<ant inheritAll="false" dir="${basedir}/buildtools/nasgen"
antfile="build.xml" target="jar"/>
</target>
diff --git a/make/build.xml b/make/build.xml
index 0b5b975c..f6de5589 100644
--- a/make/build.xml
+++ b/make/build.xml
@@ -49,8 +49,6 @@
<condition property="git.executable" value="/usr/local/bin/git" else="git">
<available file="/usr/local/bin/git"/>
</condition>
- <!-- check if JDK already has ASM classes -->
- <available property="asm.available" classname="jdk.internal.org.objectweb.asm.Type"/>
<!-- check if testng.jar is avaiable -->
<available property="testng.available" file="${file.reference.testng.jar}"/>
<!-- check if Jemmy ang testng.jar are avaiable -->
@@ -78,8 +76,31 @@
<istrue value="${jfr}"/>
</condition>
</target>
+
+ <!-- check minimum ant version required to be 1.8.4 -->
+ <target name="check-ant-version">
+ <property name="ant.version.required" value="1.8.4"/>
+ <antversion property="ant.current.version" />
+ <fail message="The current ant version, ${ant.current.version}, is too old. Please use 1.8.4 or above.">
+ <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>
- <target name="init" depends="init-conditions, init-cc">
+ <target name="init" depends="check-ant-version, check-java-version, init-conditions, init-cc">
<!-- extends jvm args -->
<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}"/>
@@ -107,19 +128,7 @@
<delete dir="${dist.dir}"/>
</target>
- <!-- do it only if ASM is not available -->
- <target name="compile-asm" depends="prepare" unless="asm.available">
- <javac srcdir="${jdk.asm.src.dir}"
- destdir="${build.classes.dir}"
- excludes="**/optimizer/* **/xml/* **/attrs/*"
- source="${javac.source}"
- target="${javac.target}"
- debug="${javac.debug}"
- encoding="${javac.encoding}"
- includeantruntime="false"/>
- </target>
-
- <target name="compile" depends="compile-asm" description="Compiles nashorn">
+ <target name="compile" depends="prepare" description="Compiles nashorn">
<javac srcdir="${src.dir}"
destdir="${build.classes.dir}"
classpath="${javac.classpath}"