Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/test/functional/VM_Test/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="VM_Test" default="build" basedir=".">
26
<taskdef resource="net/sf/antcontrib/antlib.xml" />
27
<description>
28
Build VM_Test
29
</description>
30
<property name="LIB" value="junit4,asm_all,javassist,testng"/>
31
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>
32
33
<!-- set global properties for this build -->
34
<property name="DEST" value="${BUILD_ROOT}/functional/VM_Test" />
35
<property name="jarfile" value="${DEST}/VM_Test.jar" />
36
<property name="excludeFiles" location="../J9 Exclude File Support/src"/>
37
<property name="data" location="./data" />
38
<property name="databin" location="./data/bin" />
39
<property name="properties" location="./properties" />
40
41
<!--Properties for this particular build-->
42
<property name="src" location="./src" />
43
<property name="src_80" location="./src_80" />
44
<property name="build" location="./bin" />
45
<property name="transformerListener" location="${TEST_ROOT}/Utils/src"/>
46
<property name="TestUtilities" location="../TestUtilities/src"/>
47
<property name="classUnloadingSupportTests" location="./classUnloadingSupportTests/src"/>
48
<property name="classUnloadingBin" location="./classUnloadingSupportTests/bin"/>
49
50
<path id="build.cp">
51
<fileset dir="${LIB_DIR}/" includes="junit4.jar" />
52
<fileset dir="${LIB_DIR}/" includes="asm-all.jar"/>
53
<fileset dir="${LIB_DIR}/" includes="javassist.jar"/>
54
</path>
55
56
<target name="init">
57
<mkdir dir="${DEST}" />
58
<mkdir dir="${build}" />
59
<mkdir dir="${databin}" />
60
<mkdir dir="${classUnloadingBin}"/>
61
<mkdir dir="${databin}/InvalidClasspathResource1" />
62
<mkdir dir="${databin}/InvalidClasspathResource2" />
63
<mkdir dir="${databin}/InvalidClasspathResource3" />
64
<mkdir dir="${databin}/JarFileUpdateTestRunnerResource1" />
65
<mkdir dir="${databin}/JarFileUpdateTestRunnerResource2" />
66
</target>
67
68
<target name="compile" depends="init,getDependentLibs" description="Using java ${JDK_VERSION} to compile the source ">
69
<echo>Ant version is ${ant.version}</echo>
70
<echo>============COMPILER SETTINGS============</echo>
71
<echo>===fork: yes</echo>
72
<echo>===executable: ${compiler.javac}</echo>
73
<echo>===debug: on</echo>
74
<echo>===destdir: ${DEST}</echo>
75
76
<javac srcdir="${data}/InvalidClasspathResource1" destdir="${databin}/InvalidClasspathResource1" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp" />
77
<javac srcdir="${data}/InvalidClasspathResource2" destdir="${databin}/InvalidClasspathResource2" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp" />
78
<javac srcdir="${data}/InvalidClasspathResource3" destdir="${databin}/InvalidClasspathResource3" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp" />
79
<javac srcdir="${data}/JarFileUpdateTestRunnerResource1" destdir="${databin}/JarFileUpdateTestRunnerResource1" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp" />
80
<javac srcdir="${data}/JarFileUpdateTestRunnerResource2" destdir="${databin}/JarFileUpdateTestRunnerResource2" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp" />
81
<javac srcdir="${data}" destdir="${data}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp" >
82
<include name="ParentlessChild.java" />
83
<include name="ParentOfChild.java" />
84
</javac>
85
86
<property name="addExports" value="--add-modules openj9.sharedclasses --add-exports java.base/com.ibm.oti.vm=ALL-UNNAMED --add-exports java.base/com.ibm.oti.util=ALL-UNNAMED --add-exports=java.management/com.ibm.java.lang.management.internal=ALL-UNNAMED --add-exports=jdk.management/com.ibm.lang.management.internal=ALL-UNNAMED" />
87
88
<if>
89
<equals arg1="${JDK_VERSION}" arg2="8"/>
90
<then>
91
<javac destdir="${classUnloadingBin}" nowarn="on" debug="true" fork="true" executable="${compiler.javac}" classpathref="build.cp" encoding="ISO-8859-1">
92
<src path="${classUnloadingSupportTests}"/>
93
<src path="${src}"/>
94
<include name="j9vm/test/classunloading/**"/>
95
</javac>
96
</then>
97
<else>
98
<javac destdir="${classUnloadingBin}" nowarn="on" debug="true" fork="true" executable="${compiler.javac}" classpathref="build.cp" encoding="ISO-8859-1">
99
<src path="${classUnloadingSupportTests}"/>
100
<src path="${src}"/>
101
<include name="j9vm/test/classunloading/**"/>
102
<compilerarg line='${addExports}' />
103
</javac>
104
</else>
105
</if>
106
107
<if>
108
<equals arg1="${JDK_VERSION}" arg2="8"/>
109
<then>
110
<javac destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp">
111
<src path="${src}" />
112
<src path="${src_80}" />
113
<src path="${excludeFiles}"/>
114
<src path="${TestUtilities}" />
115
<exclude name="**/attachAPI/**" />
116
<classpath>
117
<pathelement location="${LIB_DIR}/testng.jar"/>
118
</classpath>
119
</javac>
120
</then>
121
<elseif>
122
<matches string="${JDK_VERSION}" pattern="^(9|10)$$" />
123
<then>
124
<javac destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp">
125
<src path="${src}" />
126
<src path="${src_80}" />
127
<src path="${excludeFiles}"/>
128
<src path="${TestUtilities}" />
129
<exclude name="**/attachAPI/**" />
130
<!-- 133609: ClassPathSettingClassLoaderTest failed in jdk9 -->
131
<exclude name="**/ClassPathSettingClassLoader.java" />
132
<exclude name="**/ClassPathSettingClassLoaderTest.java" />
133
<compilerarg line='${addExports}' />
134
<classpath>
135
<pathelement location="${LIB_DIR}/testng.jar"/>
136
</classpath>
137
</javac>
138
</then>
139
</elseif>
140
<else>
141
<javac destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1" classpathref="build.cp">
142
<src path="${src}" />
143
<src path="${excludeFiles}"/>
144
<src path="${TestUtilities}" />
145
<exclude name="**/attachAPI/**" />
146
<!-- 133609: ClassPathSettingClassLoaderTest failed in jdk9 -->
147
<exclude name="**/ClassPathSettingClassLoader.java" />
148
<exclude name="**/ClassPathSettingClassLoaderTest.java" />
149
<compilerarg line='${addExports}' />
150
<classpath>
151
<pathelement location="${LIB_DIR}/testng.jar"/>
152
</classpath>
153
</javac>
154
</else>
155
</if>
156
</target>
157
158
<target name="dist" depends="compile" description="generate the distribution">
159
<jar jarfile="${databin}/InvalidClasspathResource1.jar" filesonly="true" manifest="./META-INF/MANIFEST.MF">
160
<fileset dir="${databin}/InvalidClasspathResource1"/>
161
</jar>
162
<jar jarfile="${databin}/InvalidClasspathResource2.jar" filesonly="true" manifest="./META-INF/MANIFEST.MF">
163
<fileset dir="${databin}/InvalidClasspathResource2"/>
164
</jar>
165
<jar jarfile="${databin}/InvalidClasspathResource3.jar" filesonly="true" manifest="./META-INF/MANIFEST.MF">
166
<fileset dir="${databin}/InvalidClasspathResource3"/>
167
</jar>
168
<jar jarfile="${databin}/JarFileUpdateTestRunnerResource1.jar" filesonly="true" manifest="./META-INF/MANIFEST.MF">
169
<fileset dir="${databin}/JarFileUpdateTestRunnerResource1"/>
170
</jar>
171
<jar jarfile="${databin}/JarFileUpdateTestRunnerResource2.jar" filesonly="true" manifest="./META-INF/MANIFEST.MF">
172
<fileset dir="${databin}/JarFileUpdateTestRunnerResource2"/>
173
</jar>
174
<jar jarfile="${jarfile}" filesonly="true" manifest="./META-INF/MANIFEST.MF">
175
<fileset dir="${build}" />
176
<fileset dir="${excludeFiles}"/>
177
<fileset dir="${src}/../" includes="*.properties,*.xml" />
178
<fileset dir="${databin}"/>
179
<fileset dir="${data}" includes="ParentlessChild.class" />
180
<fileset dir="${properties}"/>
181
</jar>
182
<jar jarfile="${DEST}/classestoload.jar" filesonly="true">
183
<fileset dir="${classUnloadingBin}"/>
184
<fileset dir="${classUnloadingSupportTests}"/>
185
<fileset dir="${src}">
186
<include name="j9vm/test/classunloading/**"/>
187
</fileset>
188
</jar>
189
<copy todir="${DEST}">
190
<fileset dir="${src}/../" includes="*.xml" />
191
<!--copy SharedClassesSysVTesting perl script -->
192
<fileset dir="${src}/../" includes=",**/*.pl" />
193
<fileset dir="${src}/../" includes="*.mk" />
194
</copy>
195
</target>
196
197
<target name="clean" depends="dist" description="clean up">
198
<!-- Delete the ${build} directory trees -->
199
<delete dir="${build}" />
200
<delete>
201
<fileset dir="${data}" includes="**/*.class" />
202
</delete>
203
<delete dir="${databin}" />
204
<delete dir="${classUnloadingBin}" />
205
</target>
206
207
<target name="check-jar">
208
<available file="${jarfile}" property="jar.exist"/>
209
</target>
210
211
<target name="build" depends="check-jar" unless="jar.exist">
212
<if>
213
<or>
214
<equals arg1="${JDK_IMPL}" arg2="ibm" />
215
<equals arg1="${JDK_IMPL}" arg2="openj9" />
216
</or>
217
<then>
218
<antcall target="clean" inheritall="true" />
219
</then>
220
</if>
221
</target>
222
</project>
223
224