Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/test/functional/cmdLineTests/jvmtitests/build.xml
6004 views
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
Copyright (c) 2016, 2021 IBM Corp. and others
4
5
This program and the accompanying materials are made available under
6
the terms of the Eclipse Public License 2.0 which accompanies this
7
distribution and is available at https://www.eclipse.org/legal/epl-2.0/
8
or the Apache License, Version 2.0 which accompanies this distribution and
9
is available at https://www.apache.org/licenses/LICENSE-2.0.
10
11
This Source Code may also be made available under the following
12
Secondary Licenses when the conditions for such availability set
13
forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
14
General Public License, version 2 with the GNU Classpath
15
Exception [1] and GNU General Public License, version 2 with the
16
OpenJDK Assembly Exception [2].
17
18
[1] https://www.gnu.org/software/classpath/license.html
19
[2] http://openjdk.java.net/legal/assembly-exception.html
20
21
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
22
-->
23
<project name="JVMTI tests" default="build" basedir=".">
24
<taskdef resource='net/sf/antcontrib/antlib.xml' />
25
<description>
26
Build JVMTI tests
27
</description>
28
29
<import file="${TEST_ROOT}/functional/cmdLineTests/buildTools.xml" />
30
31
<!-- set global properties for this build -->
32
<property name="DEST" value="${BUILD_ROOT}/functional/cmdLineTests/jvmtitests" />
33
<property name="src" location="src" />
34
<property name="src_current" location="src_current" />
35
<property name="src_latest" location="src_latest" />
36
<property name="build" location="bin" />
37
<property name="asm.jar" location="${LIB_DIR}/asm-all.jar" />
38
<property name="LIB" value="asm_all" />
39
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml" />
40
41
<target name="init">
42
<mkdir dir="${build}" />
43
<mkdir dir="${DEST}" />
44
</target>
45
46
<target name="compile" depends="init,getDependentLibs" description="compile the source">
47
<echo>Ant version is ${ant.version}</echo>
48
<echo>============COMPILER SETTINGS============</echo>
49
<echo>===fork: yes</echo>
50
<echo>===executable: ${compiler.javac}</echo>
51
<echo>===debug: on</echo>
52
<echo>===destdir: ${build}</echo>
53
54
<if>
55
<equals arg1="${JDK_VERSION}" arg2="8" />
56
<then>
57
<javac destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
58
<src path="${src}" />
59
<classpath>
60
<pathelement location="${asm.jar}" />
61
<pathelement location="${TEST_JDK_HOME}/lib/tools.jar" />
62
</classpath>
63
</javac>
64
</then>
65
<else>
66
<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" />
67
<if>
68
<equals arg1="${JCL_VERSION}" arg2="latest" />
69
<then>
70
<property name="extraSrc" value="${src_latest}" />
71
<property name="excludeFile" value="**/modularityTests/**" />
72
</then>
73
<else>
74
<property name="extraSrc" value="${src_current}" />
75
<property name="excludeFile" value="" />
76
</else>
77
</if>
78
<javac destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
79
<src path="${src}" />
80
<src path="${extraSrc}" />
81
<exclude name="${excludeFile}" />
82
<compilerarg line="${addExports}" />
83
<classpath>
84
<pathelement location="${asm.jar}" />
85
</classpath>
86
</javac>
87
</else>
88
</if>
89
90
<!-- Compile VersionedClass separately -->
91
<copy file="${src}/com/ibm/jvmti/tests/getClassVersionNumbers/VersionedClass.java.dont_auto_compile"
92
tofile="${build}/com/ibm/jvmti/tests/getClassVersionNumbers/VersionedClass/VersionedClass.java" />
93
<!-- If you modified the source and target level in this javac, you also need to modify the corresponding java class version
94
in /cmdLineTests/jvmtitests/src/com/ibm/jvmti/tests/getClassVersionNumbers/gcvn001.java -->
95
<javac srcdir="${build}" destdir="${build}" includes="com/ibm/jvmti/tests/getClassVersionNumbers/VersionedClass/VersionedClass.java"
96
debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" source="1.8" target="1.8" encoding="ISO-8859-1" />
97
98
</target>
99
100
<target name="dist" depends="compile" description="generate the distribution">
101
<!-- Store all class files, and .c files in com.ibm.jvmti.tests.jar -->
102
<mkdir dir="${DEST}" />
103
104
<copy todir="${DEST}">
105
<fileset dir="${src}/../" includes="*.xml, jars/" />
106
<fileset dir="${src}/../" includes="*.mk" />
107
</copy>
108
109
<!-- Generate getClassVersionNumbers.jar file and delete the class file of VersionedClass -->
110
<jar jarfile="${DEST}/jars/getClassVersionNumbers.jar" basedir="${build}" filesonly="true"
111
includes="com/ibm/jvmti/tests/getClassVersionNumbers/VersionedClass/VersionedClass.class" />
112
<delete file="${build}/com/ibm/jvmti/tests/getClassVersionNumbers/VersionedClass/VersionedClass.class" />
113
114
<!-- Generate general jvmtitest jar -->
115
<jar jarfile="${DEST}/jvmtitest.jar" filesonly="true">
116
<fileset dir="${build}" />
117
<fileset dir="${src}" excludes="**/*.java, **/package.htm*" />
118
<fileset dir="${src}/../" includes="*.properties,*.xml" />
119
</jar>
120
</target>
121
122
<target name="clean" depends="dist" description="clean up">
123
<!-- Delete the ${build} directory trees -->
124
<delete dir="${build}" />
125
</target>
126
127
<target name="build" depends="buildCmdLineTestTools">
128
<if>
129
<or>
130
<equals arg1="${JDK_IMPL}" arg2="ibm" />
131
<equals arg1="${JDK_IMPL}" arg2="openj9" />
132
</or>
133
<then>
134
<antcall target="clean" inheritall="true" />
135
</then>
136
</if>
137
</target>
138
</project>
139
140