Path: blob/master/test/functional/OpenJ9_Jsr_292_API/build.xml
6000 views
<?xml version="1.0"?>1<!--2Copyright (c) 2017, 2021 IBM Corp. and others34This program and the accompanying materials are made available under5the terms of the Eclipse Public License 2.0 which accompanies this6distribution and is available at https://www.eclipse.org/legal/epl-2.0/7or the Apache License, Version 2.0 which accompanies this distribution and8is available at https://www.apache.org/licenses/LICENSE-2.0.910This Source Code may also be made available under the following11Secondary Licenses when the conditions for such availability set12forth in the Eclipse Public License, v. 2.0 are satisfied: GNU13General Public License, version 2 with the GNU Classpath14Exception [1] and GNU General Public License, version 2 with the15OpenJDK Assembly Exception [2].1617[1] https://www.gnu.org/software/classpath/license.html18[2] http://openjdk.java.net/legal/assembly-exception.html1920SPDX-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-exception21-->22<project name="OpenJ9 JSR 292 API Tests" default="build" basedir=".">23<taskdef resource='net/sf/antcontrib/antlib.xml'/>24<description>25Build OpenJ9 JSR 292 API Tests26</description>2728<!-- set global properties for this build -->29<property name="DEST" value="${BUILD_ROOT}/functional/OpenJ9_Jsr_292_API" />3031<!--Properties for this particular build-->32<property name="src" location="./src"/>33<property name="build" location="./bin"/>34<property name="transformerListener" location="${TEST_ROOT}/Utils/src"/>3536<property name="mods_name" value="mods"/>37<property name="modulea_name" value="mods.modulea"/>38<property name="moduleb_name" value="mods.moduleb"/>39<property name="modulec_name" value="mods.modulec"/>4041<property name="modulea_src" location="./modules/mods.modulea"/>42<property name="moduleb_src" location="./modules/mods.moduleb"/>43<property name="modulec_src" location="./modules/mods.modulec"/>4445<property name="mods_dir" location="./mods"/>46<property name="modulea_bin" location="./mods/mods.modulea"/>47<property name="moduleb_bin" location="./mods/mods.moduleb"/>48<property name="modulec_bin" location="./mods/mods.modulec"/>49<property name="LIB" value="asm_all,jcommander,testng"/>50<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>5152<target name="init">53<mkdir dir="${DEST}"/>54<mkdir dir="${build}"/>55<mkdir dir="${mods_dir}"/>56<mkdir dir="${modulea_bin}"/>57<mkdir dir="${moduleb_bin}"/>58<mkdir dir="${modulec_bin}"/>59</target>6061<target name="compile_modulec" depends="init" description="Compile the module files in mods.modulec">62<echo>Compiling the module files in mods.modulec</echo>63<echo>Ant version is ${ant.version}</echo>64<property name="compiler.javac" value="${TEST_JDK_HOME}/bin/javac" />65<echo>============COMPILER SETTINGS============</echo>66<echo>===fork: yes</echo>67<echo>===executable: ${compiler.javac}</echo>68<echo>===debug: on</echo>69<echo>===destdir: ${DEST}</echo>70<if>71<not>72<equals arg1="${JDK_VERSION}" arg2="8"/>73</not>74<then>75<property name="modulec_path" value="--module-path ${mods_dir} -d ${modulec_bin}" />76<javac srcdir="${modulec_src}" destdir="${modulec_bin}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">77<src path="${modulec_src}"/>78<compilerarg line='${modulec_path}' />79</javac>80</then>81</if>82</target>8384<target name="compile_moduleb" depends="init" description="Compile the module files in mods.moduleb">85<echo>Compiling the module files in mods.moduleb</echo>86<echo>Ant version is ${ant.version}</echo>87<property name="compiler.javac" value="${TEST_JDK_HOME}/bin/javac" />88<echo>============COMPILER SETTINGS============</echo>89<echo>===fork: yes</echo>90<echo>===executable: ${compiler.javac}</echo>91<echo>===debug: on</echo>92<echo>===destdir: ${DEST}</echo>93<if>94<not>95<equals arg1="${JDK_VERSION}" arg2="8"/>96</not>97<then>98<property name="moduleb_path" value="--module-path ${mods_dir} -d ${moduleb_bin}" />99<javac srcdir="${moduleb_src}" destdir="${moduleb_bin}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">100<src path="${moduleb_src}"/>101<compilerarg line='${moduleb_path}' />102</javac>103</then>104</if>105</target>106107<target name="compile_modulea" depends="init,compile_moduleb,compile_modulec" description="Compile the module files in mods.modulea">108<echo>Compiling the module files in mods.modulea</echo>109<echo>Ant version is ${ant.version}</echo>110<property name="compiler.javac" value="${TEST_JDK_HOME}/bin/javac" />111<echo>============COMPILER SETTINGS============</echo>112<echo>===fork: yes</echo>113<echo>===executable: ${compiler.javac}</echo>114<echo>===debug: on</echo>115<echo>===destdir: ${DEST}</echo>116<if>117<not>118<equals arg1="${JDK_VERSION}" arg2="8"/>119</not>120<then>121<property name="modulea_path" value="--module-path ${mods_dir} -d ${modulea_bin}" />122<javac srcdir="${modulea_src}" destdir="${modulea_bin}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">123<src path="${modulea_src}"/>124<compilerarg line='${modulea_path}' />125</javac>126</then>127</if>128</target>129130<target name="compile_tests" depends="init,compile_modulea,compile_moduleb,compile_modulec,getDependentLibs" description="compile the test source code" >131<echo>Compiling the test source code</echo>132<echo>Ant version is ${ant.version}</echo>133<echo>============COMPILER SETTINGS============</echo>134<echo>===fork: yes</echo>135<echo>===executable: ${compiler.javac}</echo>136<echo>===debug: on</echo>137<echo>===destdir: ${DEST}</echo>138<if>139<not>140<equals arg1="${JDK_VERSION}" arg2="8"/>141</not>142<then>143<property name="addModules" value="--add-modules ${modulea_name},${moduleb_name},${modulec_name} --module-path ${mods_dir}" />144<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">145<src path="${src}"/>146<src path="${transformerListener}" />147<compilerarg line='${addModules}' />148<classpath>149<pathelement location="${LIB_DIR}/asm-all.jar" />150<pathelement location="${LIB_DIR}/testng.jar"/>151<pathelement location="${LIB_DIR}/jcommander.jar"/>152</classpath>153</javac>154</then>155</if>156</target>157158<target name="DEST" depends="compile_tests" description="generate the distribution" >159<copy todir="${DEST}">160<fileset dir="${src}/../" includes="*.mk,*.xml" />161</copy>162<copy todir="${DEST}/${mods_name}">163<fileset dir="${mods_dir}"/>164</copy>165<jar jarfile="${DEST}/openj9_jsr292test.jar" filesonly="true">166<fileset dir="${build}"/>167</jar>168</target>169170<target name="clean" depends="DEST" description="clean up" >171<delete dir="${build}"/>172<delete dir="${mods_dir}"/>173</target>174175<target name="build" >176<if>177<not>178<and>179<matches string="${JDK_VERSION}" pattern="^(9|10)$$" />180<equals arg1="${JCL_VERSION}" arg2="current"/>181</and>182</not>183<then>184<antcall target="clean" inheritall="true" />185</then>186</if>187</target>188</project>189190