Path: blob/master/test/functional/JavaAgentTest/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 Javaagent tests" default="build" basedir=".">25<taskdef resource='net/sf/antcontrib/antlib.xml'/>26<description>27Build J9 Javaagent tests28</description>2930<!-- set global properties for this build -->31<property name="DEST" value="${BUILD_ROOT}/functional/JavaAgentTest" />32<property name="src" location="./src"/>33<property name="build" location="./bin"/>34<property name="transformerListener" location="${TEST_ROOT}/Utils/src"/>35<property name="LIB" value="asm_all,testng,jcommander"/>36<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>3738<target name="init">39<mkdir dir="${DEST}" />40<mkdir dir="${build}" />41</target>4243<target name="compile" depends="init,getDependentLibs" description="compile the source " >44<echo>Ant version is ${ant.version}</echo>45<echo>============COMPILER SETTINGS============</echo>46<echo>===executable: ${compiler.javac}</echo>47<echo>===destdir: ${DEST}</echo>48<if>49<matches string="${JDK_VERSION}" pattern="^(8|9|10|11)$$" />50<then>51<property name="src_version" location="./src_java8" />52</then>53<else>54<!-- Java 12+ -->55<property name="src_version" location="./src_java12" />56</else>57</if>58<if>59<equals arg1="${JDK_VERSION}" arg2="8"/>60<then>61<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="${src_version}" />64<src path="${transformerListener}" />65<classpath>66<pathelement location="${LIB_DIR}/testng.jar" />67<pathelement location="${LIB_DIR}/jcommander.jar" />68<pathelement location="${LIB_DIR}/asm-all.jar"/>69</classpath>70</javac>71</then>72<else>73<property name="addExports" value="--add-exports java.base/com.ibm.oti.vm=ALL-UNNAMED --add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED --add-exports java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED --add-exports java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED --add-exports java.base/jdk.internal.org.objectweb.asm.commons=ALL-UNNAMED"/>74<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">75<src path="${src}" />76<src path="${src_version}" />77<src path="${transformerListener}" />78<compilerarg line='${addExports}' />79<classpath>80<pathelement location="${LIB_DIR}/testng.jar" />81<pathelement location="${LIB_DIR}/jcommander.jar" />82<pathelement location="${LIB_DIR}/asm-all.jar"/>83</classpath>84</javac>85</else>86</if>87</target>8889<target name="dist" depends="compile" description="generate the distribution" >90<jar jarfile="${DEST}/javaagenttest.jar" filesonly="true" manifest="./META-INF/MANIFEST.MF" >91<fileset dir="${build}"/>92<fileset dir="${src}"/>93<fileset dir="${src}/../" includes="*.properties,*.xml" />94</jar>95<copy todir="${DEST}">96<fileset dir="${src}/../" includes="*.xml" />97<fileset dir="${src}/../" includes="*.mk" />98</copy>99</target>100101<target name="clean" depends="dist" description="clean up" >102<!-- Delete the ${build} directory trees -->103<delete dir="${build}"/>104</target>105106<target name="build" >107<if>108<or>109<equals arg1="${JDK_IMPL}" arg2="ibm" />110<equals arg1="${JDK_IMPL}" arg2="openj9" />111</or>112<then>113<antcall target="clean" inheritall="true" />114</then>115</if>116</target>117</project>118119120