make/build.xml

changeset 1061
42fc6bc42dae
parent 1055
3736ebef15e9
child 1091
628304057fce
     1.1 --- a/make/build.xml	Fri Oct 17 15:04:25 2014 +0200
     1.2 +++ b/make/build.xml	Mon Oct 20 18:40:42 2014 +0530
     1.3 @@ -49,8 +49,6 @@
     1.4      <condition property="git.executable" value="/usr/local/bin/git" else="git">
     1.5        <available file="/usr/local/bin/git"/>
     1.6      </condition>
     1.7 -    <!-- check if JDK already has ASM classes -->
     1.8 -    <available property="asm.available" classname="jdk.internal.org.objectweb.asm.Type"/>
     1.9      <!-- check if testng.jar is avaiable -->
    1.10      <available property="testng.available" file="${file.reference.testng.jar}"/>
    1.11      <!-- check if Jemmy ang testng.jar are avaiable -->
    1.12 @@ -78,8 +76,31 @@
    1.13        <istrue value="${jfr}"/>
    1.14      </condition>
    1.15    </target>
    1.16 +
    1.17 +  <!-- check minimum ant version required to be 1.8.4 -->
    1.18 +  <target name="check-ant-version">
    1.19 +    <property name="ant.version.required" value="1.8.4"/>
    1.20 +    <antversion property="ant.current.version" />
    1.21 +    <fail message="The current ant version, ${ant.current.version}, is too old. Please use 1.8.4 or above.">
    1.22 +        <condition>
    1.23 +            <not>
    1.24 +                <antversion atleast="${ant.version.required}"/>
    1.25 +            </not>
    1.26 +        </condition>
    1.27 +    </fail>
    1.28 +  </target>
    1.29 +
    1.30 +  <target name="check-java-version">
    1.31 +    <!-- look for a Class that is available only in jdk1.8 or above -->
    1.32 +    <!-- core/exposed API class is better than an implementation class -->
    1.33 +    <available property="jdk1.8+" classname="java.util.stream.Stream"/>
    1.34 +
    1.35 +    <!-- need jdk1.8 or above -->
    1.36 +    <fail message="Unsupported Java version: ${ant.java.version}. Please use Java version 1.8 or greater." unless="jdk1.8+">
    1.37 +    </fail>
    1.38 +  </target>
    1.39    
    1.40 -  <target name="init" depends="init-conditions, init-cc">
    1.41 +  <target name="init" depends="check-ant-version, check-java-version, init-conditions, init-cc">
    1.42      <!-- extends jvm args -->
    1.43      <property name="run.test.jvmargs" value="${run.test.jvmargs.main} ${run.test.cc.jvmargs} ${jfr.options}"/>
    1.44      <property name="run.test.jvmargs.octane" value="${run.test.jvmargs.octane.main} ${run.test.cc.jvmargs} ${jfr.options}"/>
    1.45 @@ -107,19 +128,7 @@
    1.46      <delete dir="${dist.dir}"/>
    1.47    </target>
    1.48  
    1.49 -  <!-- do it only if ASM is not available -->
    1.50 -  <target name="compile-asm" depends="prepare" unless="asm.available">
    1.51 -    <javac srcdir="${jdk.asm.src.dir}"
    1.52 -           destdir="${build.classes.dir}"
    1.53 -           excludes="**/optimizer/* **/xml/* **/attrs/*"
    1.54 -           source="${javac.source}"
    1.55 -           target="${javac.target}"
    1.56 -           debug="${javac.debug}"
    1.57 -           encoding="${javac.encoding}"
    1.58 -           includeantruntime="false"/>
    1.59 -  </target>
    1.60 -
    1.61 -  <target name="compile" depends="compile-asm" description="Compiles nashorn">
    1.62 +  <target name="compile" depends="prepare" description="Compiles nashorn">
    1.63      <javac srcdir="${src.dir}"
    1.64             destdir="${build.classes.dir}"
    1.65             classpath="${javac.classpath}"

mercurial