Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/test/functional/JavaAgentTest/build.xml
6000 views
1
<?xml version="1.0"?>
2
3
<!--
4
Copyright (c) 2016, 2021 IBM Corp. and others
5
6
This program and the accompanying materials are made available under
7
the terms of the Eclipse Public License 2.0 which accompanies this
8
distribution and is available at https://www.eclipse.org/legal/epl-2.0/
9
or the Apache License, Version 2.0 which accompanies this distribution and
10
is available at https://www.apache.org/licenses/LICENSE-2.0.
11
12
This Source Code may also be made available under the following
13
Secondary Licenses when the conditions for such availability set
14
forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
15
General Public License, version 2 with the GNU Classpath
16
Exception [1] and GNU General Public License, version 2 with the
17
OpenJDK Assembly Exception [2].
18
19
[1] https://www.gnu.org/software/classpath/license.html
20
[2] http://openjdk.java.net/legal/assembly-exception.html
21
22
SPDX-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-exception
23
-->
24
25
<project name="J9 Javaagent tests" default="build" basedir=".">
26
<taskdef resource='net/sf/antcontrib/antlib.xml'/>
27
<description>
28
Build J9 Javaagent tests
29
</description>
30
31
<!-- set global properties for this build -->
32
<property name="DEST" value="${BUILD_ROOT}/functional/JavaAgentTest" />
33
<property name="src" location="./src"/>
34
<property name="build" location="./bin"/>
35
<property name="transformerListener" location="${TEST_ROOT}/Utils/src"/>
36
<property name="LIB" value="asm_all,testng,jcommander"/>
37
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>
38
39
<target name="init">
40
<mkdir dir="${DEST}" />
41
<mkdir dir="${build}" />
42
</target>
43
44
<target name="compile" depends="init,getDependentLibs" description="compile the source " >
45
<echo>Ant version is ${ant.version}</echo>
46
<echo>============COMPILER SETTINGS============</echo>
47
<echo>===executable: ${compiler.javac}</echo>
48
<echo>===destdir: ${DEST}</echo>
49
<if>
50
<matches string="${JDK_VERSION}" pattern="^(8|9|10|11)$$" />
51
<then>
52
<property name="src_version" location="./src_java8" />
53
</then>
54
<else>
55
<!-- Java 12+ -->
56
<property name="src_version" location="./src_java12" />
57
</else>
58
</if>
59
<if>
60
<equals arg1="${JDK_VERSION}" arg2="8"/>
61
<then>
62
<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
63
<src path="${src}" />
64
<src path="${src_version}" />
65
<src path="${transformerListener}" />
66
<classpath>
67
<pathelement location="${LIB_DIR}/testng.jar" />
68
<pathelement location="${LIB_DIR}/jcommander.jar" />
69
<pathelement location="${LIB_DIR}/asm-all.jar"/>
70
</classpath>
71
</javac>
72
</then>
73
<else>
74
<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"/>
75
<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
76
<src path="${src}" />
77
<src path="${src_version}" />
78
<src path="${transformerListener}" />
79
<compilerarg line='${addExports}' />
80
<classpath>
81
<pathelement location="${LIB_DIR}/testng.jar" />
82
<pathelement location="${LIB_DIR}/jcommander.jar" />
83
<pathelement location="${LIB_DIR}/asm-all.jar"/>
84
</classpath>
85
</javac>
86
</else>
87
</if>
88
</target>
89
90
<target name="dist" depends="compile" description="generate the distribution" >
91
<jar jarfile="${DEST}/javaagenttest.jar" filesonly="true" manifest="./META-INF/MANIFEST.MF" >
92
<fileset dir="${build}"/>
93
<fileset dir="${src}"/>
94
<fileset dir="${src}/../" includes="*.properties,*.xml" />
95
</jar>
96
<copy todir="${DEST}">
97
<fileset dir="${src}/../" includes="*.xml" />
98
<fileset dir="${src}/../" includes="*.mk" />
99
</copy>
100
</target>
101
102
<target name="clean" depends="dist" description="clean up" >
103
<!-- Delete the ${build} directory trees -->
104
<delete dir="${build}"/>
105
</target>
106
107
<target name="build" >
108
<if>
109
<or>
110
<equals arg1="${JDK_IMPL}" arg2="ibm" />
111
<equals arg1="${JDK_IMPL}" arg2="openj9" />
112
</or>
113
<then>
114
<antcall target="clean" inheritall="true" />
115
</then>
116
</if>
117
</target>
118
</project>
119
120