Path: blob/master/test/functional/VM_Test/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="VM_Test" default="build" basedir=".">25<taskdef resource="net/sf/antcontrib/antlib.xml" />26<description>27Build VM_Test28</description>29<property name="LIB" value="junit4,asm_all,javassist,testng"/>30<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>3132<!-- set global properties for this build -->33<property name="DEST" value="${BUILD_ROOT}/functional/VM_Test" />34<property name="jarfile" value="${DEST}/VM_Test.jar" />35<property name="excludeFiles" location="../J9 Exclude File Support/src"/>36<property name="data" location="./data" />37<property name="databin" location="./data/bin" />38<property name="properties" location="./properties" />3940<!--Properties for this particular build-->41<property name="src" location="./src" />42<property name="src_80" location="./src_80" />43<property name="build" location="./bin" />44<property name="transformerListener" location="${TEST_ROOT}/Utils/src"/>45<property name="TestUtilities" location="../TestUtilities/src"/>46<property name="classUnloadingSupportTests" location="./classUnloadingSupportTests/src"/>47<property name="classUnloadingBin" location="./classUnloadingSupportTests/bin"/>4849<path id="build.cp">50<fileset dir="${LIB_DIR}/" includes="junit4.jar" />51<fileset dir="${LIB_DIR}/" includes="asm-all.jar"/>52<fileset dir="${LIB_DIR}/" includes="javassist.jar"/>53</path>5455<target name="init">56<mkdir dir="${DEST}" />57<mkdir dir="${build}" />58<mkdir dir="${databin}" />59<mkdir dir="${classUnloadingBin}"/>60<mkdir dir="${databin}/InvalidClasspathResource1" />61<mkdir dir="${databin}/InvalidClasspathResource2" />62<mkdir dir="${databin}/InvalidClasspathResource3" />63<mkdir dir="${databin}/JarFileUpdateTestRunnerResource1" />64<mkdir dir="${databin}/JarFileUpdateTestRunnerResource2" />65</target>6667<target name="compile" depends="init,getDependentLibs" description="Using java ${JDK_VERSION} to compile the source ">68<echo>Ant version is ${ant.version}</echo>69<echo>============COMPILER SETTINGS============</echo>70<echo>===fork: yes</echo>71<echo>===executable: ${compiler.javac}</echo>72<echo>===debug: on</echo>73<echo>===destdir: ${DEST}</echo>7475<javac srcdir="${data}/InvalidClasspathResource1" destdir="${databin}/InvalidClasspathResource1" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp" />76<javac srcdir="${data}/InvalidClasspathResource2" destdir="${databin}/InvalidClasspathResource2" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp" />77<javac srcdir="${data}/InvalidClasspathResource3" destdir="${databin}/InvalidClasspathResource3" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp" />78<javac srcdir="${data}/JarFileUpdateTestRunnerResource1" destdir="${databin}/JarFileUpdateTestRunnerResource1" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp" />79<javac srcdir="${data}/JarFileUpdateTestRunnerResource2" destdir="${databin}/JarFileUpdateTestRunnerResource2" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp" />80<javac srcdir="${data}" destdir="${data}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp" >81<include name="ParentlessChild.java" />82<include name="ParentOfChild.java" />83</javac>8485<property name="addExports" value="--add-modules openj9.sharedclasses --add-exports java.base/com.ibm.oti.vm=ALL-UNNAMED --add-exports java.base/com.ibm.oti.util=ALL-UNNAMED --add-exports=java.management/com.ibm.java.lang.management.internal=ALL-UNNAMED --add-exports=jdk.management/com.ibm.lang.management.internal=ALL-UNNAMED" />8687<if>88<equals arg1="${JDK_VERSION}" arg2="8"/>89<then>90<javac destdir="${classUnloadingBin}" nowarn="on" debug="true" fork="true" executable="${compiler.javac}" classpathref="build.cp" encoding="ISO-8859-1">91<src path="${classUnloadingSupportTests}"/>92<src path="${src}"/>93<include name="j9vm/test/classunloading/**"/>94</javac>95</then>96<else>97<javac destdir="${classUnloadingBin}" nowarn="on" debug="true" fork="true" executable="${compiler.javac}" classpathref="build.cp" encoding="ISO-8859-1">98<src path="${classUnloadingSupportTests}"/>99<src path="${src}"/>100<include name="j9vm/test/classunloading/**"/>101<compilerarg line='${addExports}' />102</javac>103</else>104</if>105106<if>107<equals arg1="${JDK_VERSION}" arg2="8"/>108<then>109<javac destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp">110<src path="${src}" />111<src path="${src_80}" />112<src path="${excludeFiles}"/>113<src path="${TestUtilities}" />114<exclude name="**/attachAPI/**" />115<classpath>116<pathelement location="${LIB_DIR}/testng.jar"/>117</classpath>118</javac>119</then>120<elseif>121<matches string="${JDK_VERSION}" pattern="^(9|10)$$" />122<then>123<javac destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp">124<src path="${src}" />125<src path="${src_80}" />126<src path="${excludeFiles}"/>127<src path="${TestUtilities}" />128<exclude name="**/attachAPI/**" />129<!-- 133609: ClassPathSettingClassLoaderTest failed in jdk9 -->130<exclude name="**/ClassPathSettingClassLoader.java" />131<exclude name="**/ClassPathSettingClassLoaderTest.java" />132<compilerarg line='${addExports}' />133<classpath>134<pathelement location="${LIB_DIR}/testng.jar"/>135</classpath>136</javac>137</then>138</elseif>139<else>140<javac destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp">141<src path="${src}" />142<src path="${excludeFiles}"/>143<src path="${TestUtilities}" />144<exclude name="**/attachAPI/**" />145<!-- 133609: ClassPathSettingClassLoaderTest failed in jdk9 -->146<exclude name="**/ClassPathSettingClassLoader.java" />147<exclude name="**/ClassPathSettingClassLoaderTest.java" />148<compilerarg line='${addExports}' />149<classpath>150<pathelement location="${LIB_DIR}/testng.jar"/>151</classpath>152</javac>153</else>154</if>155</target>156157<target name="dist" depends="compile" description="generate the distribution">158<jar jarfile="${databin}/InvalidClasspathResource1.jar" filesonly="true" manifest="./META-INF/MANIFEST.MF">159<fileset dir="${databin}/InvalidClasspathResource1"/>160</jar>161<jar jarfile="${databin}/InvalidClasspathResource2.jar" filesonly="true" manifest="./META-INF/MANIFEST.MF">162<fileset dir="${databin}/InvalidClasspathResource2"/>163</jar>164<jar jarfile="${databin}/InvalidClasspathResource3.jar" filesonly="true" manifest="./META-INF/MANIFEST.MF">165<fileset dir="${databin}/InvalidClasspathResource3"/>166</jar>167<jar jarfile="${databin}/JarFileUpdateTestRunnerResource1.jar" filesonly="true" manifest="./META-INF/MANIFEST.MF">168<fileset dir="${databin}/JarFileUpdateTestRunnerResource1"/>169</jar>170<jar jarfile="${databin}/JarFileUpdateTestRunnerResource2.jar" filesonly="true" manifest="./META-INF/MANIFEST.MF">171<fileset dir="${databin}/JarFileUpdateTestRunnerResource2"/>172</jar>173<jar jarfile="${jarfile}" filesonly="true" manifest="./META-INF/MANIFEST.MF">174<fileset dir="${build}" />175<fileset dir="${excludeFiles}"/>176<fileset dir="${src}/../" includes="*.properties,*.xml" />177<fileset dir="${databin}"/>178<fileset dir="${data}" includes="ParentlessChild.class" />179<fileset dir="${properties}"/>180</jar>181<jar jarfile="${DEST}/classestoload.jar" filesonly="true">182<fileset dir="${classUnloadingBin}"/>183<fileset dir="${classUnloadingSupportTests}"/>184<fileset dir="${src}">185<include name="j9vm/test/classunloading/**"/>186</fileset>187</jar>188<copy todir="${DEST}">189<fileset dir="${src}/../" includes="*.xml" />190<!--copy SharedClassesSysVTesting perl script -->191<fileset dir="${src}/../" includes=",**/*.pl" />192<fileset dir="${src}/../" includes="*.mk" />193</copy>194</target>195196<target name="clean" depends="dist" description="clean up">197<!-- Delete the ${build} directory trees -->198<delete dir="${build}" />199<delete>200<fileset dir="${data}" includes="**/*.class" />201</delete>202<delete dir="${databin}" />203<delete dir="${classUnloadingBin}" />204</target>205206<target name="check-jar">207<available file="${jarfile}" property="jar.exist"/>208</target>209210<target name="build" depends="check-jar" unless="jar.exist">211<if>212<or>213<equals arg1="${JDK_IMPL}" arg2="ibm" />214<equals arg1="${JDK_IMPL}" arg2="openj9" />215</or>216<then>217<antcall target="clean" inheritall="true" />218</then>219</if>220</target>221</project>222223224