Path: blob/master/test/functional/Jsr292/build.xml
6000 views
<?xml version="1.0"?>12<!--3Copyright (c) 2016, 2021 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="J9 JSR 292 Tests" default="build" basedir=".">25<taskdef resource='net/sf/antcontrib/antlib.xml'/>26<description>27Build J9 JSR 292 Tests28</description>2930<!-- set global properties for this build -->31<property name="DEST" value="${BUILD_ROOT}/functional/Jsr292" />3233<!--Properties for this particular build-->34<property name="src" location="./src"/>35<property name="build" location="./bin"/>36<property name="bootstrapSrc" location="./bootstrap_src"/>37<property name="bootstrapSrc_80" location="./bootstrap_src_80"/>38<property name="bootstrapSrc_90" location="./bootstrap_src_90"/>39<property name="bootstrapBuild" location="./bootstrap_bin"/>40<property name="transformerListener" location="${TEST_ROOT}/Utils/src"/>41<property name="TestUtilities" location="../TestUtilities/src"/>42<property name="LIB" value="junit4,asm_all,jcommander,testng"/>43<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>4445<target name="init">46<mkdir dir="${DEST}"/>47<mkdir dir="${build}"/>48<mkdir dir="${bootstrapBuild}"/>49</target>5051<target name="compile_generator" depends="init,getDependentLibs" description="Compile SimpleIndyGenerator">52<echo>Compiling Everything but IndyTest and ComplexIndyTest</echo>53<echo>Ant version is ${ant.version}</echo>54<property name="compiler.javac" value="${TEST_JDK_HOME}/bin/javac" />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>60<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">61<src path="${src}"/>62<include name="**/indyn/BootstrapMethods.java" />63<include name="**/indyn/ComplexIndyGenerator.java" />64<include name="**/indyn/Helper.java" />65<include name="**/indyn/SimpleIndyGenerator.java" />66<include name="**/CrossPackageHelper.java"/>67<classpath>68<pathelement location="${LIB_DIR}/asm-all.jar" />69<pathelement location="${LIB_DIR}/junit4.jar" />70</classpath>71</javac>72</target>7374<target name="generate_indyn" depends="compile_generator" description="Run SimpleIndyGenerator to generate bytecode" >75<property name="javaexecutable.java" value="${TEST_JDK_HOME}/bin/java" />76<echo>Running SimpleIndyGenerator</echo>77<java classname="com.ibm.j9.jsr292.indyn.SimpleIndyGenerator" failonerror="true" fork="true" logError="true"78jvm="${javaexecutable.java}">79<classpath>80<pathelement location="${LIB_DIR}/asm-all.jar" />81<pathelement location="${build}"/>82</classpath>83</java>84<copy file="GenIndyn.class" todir="${build}/com/ibm/j9/jsr292/indyn" overwrite="true" />85<delete failonerror="true" verbose="true">86<fileset dir=".">87<include name="*GenIndyn.class"/>88</fileset>89</delete>90<echo>Running ComplexIndyGenerator</echo>91<java classname="com.ibm.j9.jsr292.indyn.ComplexIndyGenerator" failonerror="true" fork="true" logError="true"92jvm="${javaexecutable.java}">93<classpath>94<pathelement location="${LIB_DIR}/asm-all.jar" />95<pathelement location="${build}"/>96</classpath>97</java>98<copy file="ComplexIndy.class" todir="${build}/com/ibm/j9/jsr292/indyn" overwrite="true" />99<delete failonerror="true" verbose="true">100<fileset dir=".">101<include name="*ComplexIndy.class"/>102</fileset>103</delete>104</target>105106<target name="compile_bootstrap" depends="init" description="compile the bootstrap source " >107<echo>Ant version is ${ant.version}</echo>108<property name="compiler.javac" value="${TEST_JDK_HOME}/bin/javac" />109<echo>============COMPILER SETTINGS============</echo>110<echo>===fork: yes</echo>111<echo>===executable: ${compiler.javac}</echo>112<echo>===debug: on</echo>113<echo>===destdir: ${DEST}</echo>114<if>115<equals arg1="${JDK_VERSION}" arg2="8"/>116<then>117<javac srcdir="${bootstrapSrc}" destdir="${bootstrapBuild}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">118<src path="${bootstrapSrc}"/>119<src path="${bootstrapSrc_80}"/>120</javac>121</then>122<else>123<if>124<equals arg1="${JCL_VERSION}" arg2="latest"/>125<then>126<property name="addExports" value="--add-exports java.base/jdk.internal.reflect=ALL-UNNAMED" />127</then>128<else>129<property name="addExports" value="--add-exports java.base/jdk.internal.reflect=ALL-UNNAMED" />130</else>131</if>132<javac srcdir="${bootstrapSrc}" destdir="${bootstrapBuild}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">133<src path="${bootstrapSrc}"/>134<src path="${bootstrapSrc_90}"/>135<compilerarg line='${addExports}' />136</javac>137</else>138</if>139</target>140141<target name="compile" depends="compile_bootstrap, generate_indyn" description="compile the test source " >142<echo>Ant version is ${ant.version}</echo>143<echo>============COMPILER SETTINGS============</echo>144<echo>===fork: yes</echo>145<echo>===executable: ${compiler.javac}</echo>146<echo>===debug: on</echo>147<echo>===destdir: ${DEST}</echo>148<if>149<equals arg1="${JDK_VERSION}" arg2="8"/>150<then>151<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">152<src path="${src}"/>153<src path="${transformerListener}" />154<src path="${TestUtilities}" />155<!-- exclude files only for jdk9 -->156<exclude name="**/MethodHandleAPI_asCollector.java" />157<exclude name="**/MethodHandleAPI_asSpreader.java" />158<exclude name="**/MethodHandleAPI_foldArguments.java" />159<exclude name="**/MethodHandleAPI_withVarargs.java" />160<exclude name="**/MethodHandleAPI_tryFinally.java" />161<exclude name="**/MethodHandleAPI_loop.java" />162<exclude name="**/MethodHandleAPI_iteratedLoop.java" />163<exclude name="**/MethodHandleAPI_zero.java" />164<exclude name="**/MethodHandleAPI_whileLoop.java" />165<exclude name="**/MethodHandleAPI_countedLoop.java"/>166<exclude name="**/MethodHandleAPI_arrayLength.java" />167<exclude name="**/MethodHandleAPI_arrayConstructor.java" />168<exclude name="**/MethodHandleAPI_dropLookupMode.java" />169<exclude name="**/SamePackageExample.java" />170<exclude name="**/LookupAPITests_FindClass.java" />171<exclude name="**/LookupAPITests_AccessClass.java"/>172<exclude name="**/MethodHandleAPI_dropArgumentsToMatch.java" />173174<!-- exclude non test files for indyn test -->175<exclude name="**/indyn/BootstrapMethods.java" />176<exclude name="**/indyn/ComplexIndyGenerator.java" />177<exclude name="**/indyn/Helper.java" />178<exclude name="**/indyn/SimpleIndyGenerator.java" />179<exclude name="**/CrossPackageHelper.java"/>180<exclude name="**/attachAPI/**" />181<classpath>182<pathelement location="${bootstrapBuild}"/>183<pathelement location="${LIB_DIR}/asm-all.jar" />184<pathelement location="${LIB_DIR}/junit4.jar" />185<pathelement location="${LIB_DIR}/testng.jar"/>186<pathelement location="${LIB_DIR}/jcommander.jar"/>187</classpath>188</javac>189</then>190<else>191<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">192<src path="${src}" />193<src path="${transformerListener}" />194<src path="${TestUtilities}" />195<!-- exclude non test files for indyn test -->196<exclude name="**/indyn/BootstrapMethods.java" />197<exclude name="**/indyn/ComplexIndyGenerator.java" />198<exclude name="**/indyn/Helper.java" />199<exclude name="**/indyn/SimpleIndyGenerator.java" />200<exclude name="**/CrossPackageHelper.java"/>201<exclude name="**/attachAPI/**" />202<classpath>203<pathelement location="${bootstrapBuild}"/>204<pathelement location="${LIB_DIR}/asm-all.jar" />205<pathelement location="${LIB_DIR}/junit4.jar" />206<pathelement location="${LIB_DIR}/testng.jar"/>207<pathelement location="${LIB_DIR}/jcommander.jar"/>208</classpath>209</javac>210</else>211</if>212</target>213214<target name="dist" depends="compile" description="generate the distribution" >215<copy todir="${DEST}">216<fileset dir="${src}/../" includes="*.xml,*.policy" />217<fileset dir="${src}/../" includes="*.mk" />218</copy>219<jar jarfile="${DEST}/jsr292test.jar" filesonly="true">220<fileset dir="${build}"/>221</jar>222<jar jarfile="${DEST}/jsr292bootstrap.jar" filesonly="true">223<fileset dir="${bootstrapBuild}"/>224</jar>225</target>226227<target name="clean" depends="dist" description="clean up" >228<delete dir="${build}"/>229<delete dir="${bootstrapBuild}"/>230</target>231232<target name="build" >233<antcall target="clean" inheritall="true" />234</target>235</project>236237