Path: blob/master/test/functional/JLM_Tests/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="JLM_Tests" default="build" basedir=".">2526<description>27Build JLM Tests28</description>2930<!-- Set global properties for this build. -->31<property name="DEST" value="${BUILD_ROOT}/functional/JLM_Tests" />3233<property name="src" location="./src" />34<property name="src_80" location="./src_80" />35<property name="src_90" location="./src_90" />36<property name="build" location="./bin" />37<property name="transformerListener" location="${TEST_ROOT}/Utils/src"/>38<property name="TestUtilities" location="../TestUtilities/src"/>39<property name="LIB" value="jcommander,commons_exec,testng"/>40<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>4142<target name="init">43<fail message="BUILD_ROOT must be defined." unless="BUILD_ROOT" />44<mkdir dir="${DEST}" />45<mkdir dir="${build}" />46</target>4748<target name="compile" depends="init,getDependentLibs" description="using java ${JDK_VERSION} to compile the source ">49<echo>Ant version is ${ant.version}</echo>50<echo>============COMPILER SETTINGS============</echo>51<echo>===fork: yes</echo>52<echo>===executable: ${compiler.javac}</echo>53<echo>===debug: on</echo>54<echo>===destdir: ${build}</echo>5556<if>57<equals arg1="${JDK_VERSION}" arg2="8"/>58<then>59<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">60<src path="${src}" />61<src path="${src_80}" />62<src path="${transformerListener}" />63<src path="${TestUtilities}" />64<classpath>65<pathelement location="${LIB_DIR}/testng.jar" />66<pathelement location="${LIB_DIR}/jcommander.jar" />67<pathelement location="${LIB_DIR}/commons-exec.jar" />68<pathelement location="${TEST_JDK_HOME}/lib/tools.jar" />69</classpath>70</javac>71</then>72<else>73<if>74<equals arg1="${JCL_VERSION}" arg2="latest"/>75<then>76<property name="addExports" value="--add-exports java.management/com.ibm.java.lang.management.internal=ALL-UNNAMED --add-exports jdk.management/com.ibm.lang.management.internal=ALL-UNNAMED --add-exports java.management/javax.management=ALL-UNNAMED --add-exports java.base/java.security=ALL-UNNAMED" />77</then>78<else>79<property name="addExports" value="--add-exports java.management/com.ibm.java.lang.management.internal=ALL-UNNAMED --add-exports jdk.management/com.ibm.lang.management.internal=ALL-UNNAMED --add-exports java.management/javax.management=ALL-UNNAMED --add-exports java.base/java.security=ALL-UNNAMED" />80</else>81</if>82<property name="TestUtilitiesExports" value="--add-exports java.base/openj9.internal.tools.attach.target=ALL-UNNAMED" />83<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">84<src path="${src}" />85<src path="${src_90}" />86<src path="${transformerListener}" />87<src path="${TestUtilities}" />88<compilerarg line='${addExports} ${TestUtilitiesExports}' />89<classpath>90<pathelement location="${LIB_DIR}/testng.jar" />91<pathelement location="${LIB_DIR}/jcommander.jar" />92<pathelement location="${LIB_DIR}/commons-exec.jar" />93</classpath>94</javac>95</else>96</if>97</target>9899<target name="dist" depends="compile" description="generate the distribution">100<!-- Store all class files in jlm-tests.jar file. -->101<mkdir dir="${DEST}"/>102<jar jarfile="${DEST}/jlm_tests.jar" filesonly="true">103<fileset dir="${build}"/>104<fileset dir="${src}"/>105<fileset dir="${src}/../" includes="*.properties,*.xml" />106</jar>107<copy todir="${DEST}">108<fileset dir="${src}/../" includes="*.xml" />109<fileset dir="${src}/../" includes="*.mk" />110</copy>111</target>112113<target name="clean" depends="dist" description="clean up">114<!-- Delete the ${build} directory tree. -->115<delete dir="${build}"/>116</target>117118<target name="build" >119<if>120<or>121<equals arg1="${JDK_IMPL}" arg2="ibm" />122<equals arg1="${JDK_IMPL}" arg2="openj9" />123</or>124<then>125<antcall target="clean" inheritall="true" />126</then>127</if>128</target>129</project>130131132