Path: blob/master/test/functional/cmdLineTests/jvmtitests/build.xml
6004 views
<?xml version="1.0" encoding="UTF-8"?>1<!--2Copyright (c) 2016, 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="JVMTI tests" default="build" basedir=".">23<taskdef resource='net/sf/antcontrib/antlib.xml' />24<description>25Build JVMTI tests26</description>2728<import file="${TEST_ROOT}/functional/cmdLineTests/buildTools.xml" />2930<!-- set global properties for this build -->31<property name="DEST" value="${BUILD_ROOT}/functional/cmdLineTests/jvmtitests" />32<property name="src" location="src" />33<property name="src_current" location="src_current" />34<property name="src_latest" location="src_latest" />35<property name="build" location="bin" />36<property name="asm.jar" location="${LIB_DIR}/asm-all.jar" />37<property name="LIB" value="asm_all" />38<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml" />3940<target name="init">41<mkdir dir="${build}" />42<mkdir dir="${DEST}" />43</target>4445<target name="compile" depends="init,getDependentLibs" description="compile the source">46<echo>Ant version is ${ant.version}</echo>47<echo>============COMPILER SETTINGS============</echo>48<echo>===fork: yes</echo>49<echo>===executable: ${compiler.javac}</echo>50<echo>===debug: on</echo>51<echo>===destdir: ${build}</echo>5253<if>54<equals arg1="${JDK_VERSION}" arg2="8" />55<then>56<javac destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">57<src path="${src}" />58<classpath>59<pathelement location="${asm.jar}" />60<pathelement location="${TEST_JDK_HOME}/lib/tools.jar" />61</classpath>62</javac>63</then>64<else>65<property name="addExports" value="--add-exports java.base/jdk.internal.module=ALL-UNNAMED --add-exports java.base/openj9.internal.tools.attach.target=ALL-UNNAMED --add-exports java.base/com.ibm.tools.attach=ALL-UNNAMED --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED" />66<if>67<equals arg1="${JCL_VERSION}" arg2="latest" />68<then>69<property name="extraSrc" value="${src_latest}" />70<property name="excludeFile" value="**/modularityTests/**" />71</then>72<else>73<property name="extraSrc" value="${src_current}" />74<property name="excludeFile" value="" />75</else>76</if>77<javac destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">78<src path="${src}" />79<src path="${extraSrc}" />80<exclude name="${excludeFile}" />81<compilerarg line="${addExports}" />82<classpath>83<pathelement location="${asm.jar}" />84</classpath>85</javac>86</else>87</if>8889<!-- Compile VersionedClass separately -->90<copy file="${src}/com/ibm/jvmti/tests/getClassVersionNumbers/VersionedClass.java.dont_auto_compile"91tofile="${build}/com/ibm/jvmti/tests/getClassVersionNumbers/VersionedClass/VersionedClass.java" />92<!-- If you modified the source and target level in this javac, you also need to modify the corresponding java class version93in /cmdLineTests/jvmtitests/src/com/ibm/jvmti/tests/getClassVersionNumbers/gcvn001.java -->94<javac srcdir="${build}" destdir="${build}" includes="com/ibm/jvmti/tests/getClassVersionNumbers/VersionedClass/VersionedClass.java"95debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" source="1.8" target="1.8" encoding="ISO-8859-1" />9697</target>9899<target name="dist" depends="compile" description="generate the distribution">100<!-- Store all class files, and .c files in com.ibm.jvmti.tests.jar -->101<mkdir dir="${DEST}" />102103<copy todir="${DEST}">104<fileset dir="${src}/../" includes="*.xml, jars/" />105<fileset dir="${src}/../" includes="*.mk" />106</copy>107108<!-- Generate getClassVersionNumbers.jar file and delete the class file of VersionedClass -->109<jar jarfile="${DEST}/jars/getClassVersionNumbers.jar" basedir="${build}" filesonly="true"110includes="com/ibm/jvmti/tests/getClassVersionNumbers/VersionedClass/VersionedClass.class" />111<delete file="${build}/com/ibm/jvmti/tests/getClassVersionNumbers/VersionedClass/VersionedClass.class" />112113<!-- Generate general jvmtitest jar -->114<jar jarfile="${DEST}/jvmtitest.jar" filesonly="true">115<fileset dir="${build}" />116<fileset dir="${src}" excludes="**/*.java, **/package.htm*" />117<fileset dir="${src}/../" includes="*.properties,*.xml" />118</jar>119</target>120121<target name="clean" depends="dist" description="clean up">122<!-- Delete the ${build} directory trees -->123<delete dir="${build}" />124</target>125126<target name="build" depends="buildCmdLineTestTools">127<if>128<or>129<equals arg1="${JDK_IMPL}" arg2="ibm" />130<equals arg1="${JDK_IMPL}" arg2="openj9" />131</or>132<then>133<antcall target="clean" inheritall="true" />134</then>135</if>136</target>137</project>138139140