Path: blob/master/test/functional/Java9andUp/build.xml
6000 views
<?xml version="1.0"?>12<!--3Copyright (c) 2016, 2022 IBM Corp. and others45This program and the accompanying materials are made available under6the terms of the Eclipse Public License 2.0 which accompanies this7distribution and is available at https://www.eclipse.org/legal/epl-2.0/8or the Apache License, Version 2.0 which accompanies this distribution and9is available at https://www.apache.org/licenses/LICENSE-2.0.1011This Source Code may also be made available under the following12Secondary Licenses when the conditions for such availability set13forth in the Eclipse Public License, v. 2.0 are satisfied: GNU14General Public License, version 2 with the GNU Classpath15Exception [1] and GNU General Public License, version 2 with the16OpenJDK Assembly Exception [2].1718[1] https://www.gnu.org/software/classpath/license.html19[2] http://openjdk.java.net/legal/assembly-exception.html2021SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception22-->2324<project name="Java9andUp" default="build" basedir=".">25<taskdef resource='net/sf/antcontrib/antlib.xml'/>26<description>27Tests for Java9andUp28</description>2930<!-- set global properties for this build -->31<property name="DEST" value="${BUILD_ROOT}/functional/Java9andUp" />3233<!--Properties for this particular build-->34<property name="src" location="./src"/>35<property name="TestUtilities" location="../TestUtilities/src"/>36<property name="TestUtilitiesJ9" location="../TestUtilitiesJ9/src"/>37<property name="module_src_root" location="./modules"/>38<property name="module_bin_root" location="./module_bin"/>39<property name="dest_module_bin" location="${DEST}/module_bin"/>40<property name="build" location="./bin"/>41<property name="transformerListener" location="${TEST_ROOT}/Utils/src"/>42<property name="LIB" value="asm_all,testng,jcommander"/>43<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>4445<!--<property name="src.level" value="1.9"/>46<property name="target.level" value="1.9"/> -->4748<target name="init">49<mkdir dir="${DEST}" />50<mkdir dir="${build}"/>51</target>5253<target name="compile" depends="init,getDependentLibs" description="Using java ${JDK_VERSION} to compile the source " >54<echo>Ant version is ${ant.version}</echo>55<echo>============COMPILER SETTINGS============</echo>56<echo>===fork: yes</echo>57<echo>===executable: ${compiler.javac}</echo>58<echo>===debug: on</echo>59<echo>===destdir: ${DEST}</echo>6061<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">62<src path="${src}" />63<src path="${TestUtilities}" />64<src path="${TestUtilitiesJ9}" />65<src path="${transformerListener}" />66<compilerarg line="--add-exports java.base/jdk.internal.misc=ALL-UNNAMED --add-exports java.base/sun.security.internal.spec=ALL-UNNAMED --add-exports java.base/jdk.internal.reflect=ALL-UNNAMED --add-exports java.base/openj9.internal.tools.attach.target=ALL-UNNAMED" />67<classpath>68<pathelement location="${LIB_DIR}/asm-all.jar" />69<pathelement location="${LIB_DIR}/testng.jar" />70<pathelement location="${LIB_DIR}/jcommander.jar" />71</classpath>72</javac>73</target>7475<property name="MODULE_NAME_ROOT" value="org.openj9test.modularity" />76<property name="MODULE_PATH_ROOT" value="org/openj9/test/modularity"/>77<target name="build_modules" depends="init" description="Create the base modules for the modularity tests ">78<mkdir dir="${module_bin_root}" />79<copy file="${LIB_DIR}/testng.jar" todir="${module_bin_root}" />80<copy file="${LIB_DIR}/jcommander.jar" todir="${module_bin_root}" />81<for list="common,moduleD,moduleC,moduleB,moduleA,testerModule,dummy" param="mod">82<sequential>83<var name="module_src_dir" value="${module_src_root}/${MODULE_NAME_ROOT}.@{mod}" />84<var name="module_bin_dir" value="${module_bin_root}/${MODULE_NAME_ROOT}.@{mod}" />85<mkdir dir="${module_bin_dir}" />86<var name="modpath" value="--module-path ${module_bin_root} -d ${module_bin_dir}" />87<javac srcdir="${module_src_dir}" destdir="${module_bin_dir}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">88<src path="${module_src_dir}" />89<compilerarg line="${modpath}" />90</javac>91</sequential>92</for>93<!-- compile unnamed module depending on module org.openj9test.modularity.dummy -->94<for list="unnamed" param="mod">95<sequential>96<var name="module_src_dir" value="${module_src_root}/${MODULE_NAME_ROOT}.@{mod}" />97<var name="module_bin_dir" value="${module_bin_root}/${MODULE_NAME_ROOT}.@{mod}" />98<mkdir dir="${module_bin_dir}" />99<var name="modpath" value="-cp ${LIB_DIR}/testng.jar --module-path ${module_bin_root} -d ${module_bin_dir} --add-modules org.openj9test.modularity.dummy --add-exports org.openj9test.modularity.dummy/org.openj9.test.modularity.dummy=ALL-UNNAMED" />100<javac srcdir="${module_src_dir}" destdir="${module_bin_dir}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">101<src path="${module_src_dir}" />102<compilerarg line="${modpath}" />103</javac>104</sequential>105</for>106<!-- compile module org.openj9test.modularity.testUnreflect depending on unnamed module above -->107<for list="testUnreflect" param="mod">108<sequential>109<var name="module_src_dir" value="${module_src_root}/${MODULE_NAME_ROOT}.@{mod}" />110<var name="module_bin_dir" value="${module_bin_root}/${MODULE_NAME_ROOT}.@{mod}" />111<mkdir dir="${module_bin_dir}" />112<var name="modpath" value="--module-path ${module_bin_root} -d ${module_bin_dir} --add-reads org.openj9test.modularity.testUnreflect=ALL-UNNAMED" />113<javac srcdir="${module_src_dir}" destdir="${module_bin_dir}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">114<src path="${module_src_dir}" />115<classpath>116<pathelement location="${module_bin_root}/org.openj9test.modularity.unnamed" />117<pathelement location="${LIB_DIR}/testng.jar" />118</classpath>119<compilerarg line="${modpath}" />120</javac>121</sequential>122</for>123<exec executable="${TEST_JDK_HOME}/bin/java" failonerror="true">124<arg line="-jar ${LIB_DIR}/asmtools.jar jasm -d ${module_bin_root}/${MODULE_NAME_ROOT}.testerModule ${module_src_root}/${MODULE_NAME_ROOT}.testerModule/${MODULE_PATH_ROOT}/tests/MethodHandleTester.jasm" />125</exec>126</target>127128<target name="dist" depends="compile,build_modules" description="generate the distribution">129<mkdir dir="${DEST}"/>130<jar jarfile="${DEST}/GeneralTest.jar" filesonly="true">131<fileset dir="${build}"/>132<fileset dir="${src}/../" includes="*.properties,*.xml"/>133</jar>134<copy todir="${DEST}">135<fileset dir="${src}/../" includes="*.xml" />136<fileset dir="${src}/../" includes="*.mk" />137</copy>138<if>139<!-- These tests are not supported for build 148 -->140<equals arg1="${JCL_VERSION}" arg2="latest"/>141<then>142<echo>copy ${module_bin_root} to ${dest_module_bin}</echo>143<mkdir dir="${dest_module_bin}"/>144<copy todir="${dest_module_bin}">145<fileset dir="${module_bin_root}"/>146</copy>147</then>148</if>149</target>150151<target name="build" >152<if>153<or>154<equals arg1="${JDK_IMPL}" arg2="ibm" />155<equals arg1="${JDK_IMPL}" arg2="openj9" />156</or>157<then>158<if>159<not>160<equals arg1="${JDK_VERSION}" arg2="8"/>161</not>162<then>163<antcall target="clean" inheritall="true" />164</then>165</if>166</then>167</if>168</target>169170<target name="clean" depends="dist" description="clean up" >171<!-- Delete the ${build} directory trees -->172<delete dir="${module_bin_root}"/>173<delete dir="${build}"/>174</target>175</project>176177178