Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/test/functional/Jsr292/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 JSR 292 Tests" default="build" basedir=".">
26
<taskdef resource='net/sf/antcontrib/antlib.xml'/>
27
<description>
28
Build J9 JSR 292 Tests
29
</description>
30
31
<!-- set global properties for this build -->
32
<property name="DEST" value="${BUILD_ROOT}/functional/Jsr292" />
33
34
<!--Properties for this particular build-->
35
<property name="src" location="./src"/>
36
<property name="build" location="./bin"/>
37
<property name="bootstrapSrc" location="./bootstrap_src"/>
38
<property name="bootstrapSrc_80" location="./bootstrap_src_80"/>
39
<property name="bootstrapSrc_90" location="./bootstrap_src_90"/>
40
<property name="bootstrapBuild" location="./bootstrap_bin"/>
41
<property name="transformerListener" location="${TEST_ROOT}/Utils/src"/>
42
<property name="TestUtilities" location="../TestUtilities/src"/>
43
<property name="LIB" value="junit4,asm_all,jcommander,testng"/>
44
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>
45
46
<target name="init">
47
<mkdir dir="${DEST}"/>
48
<mkdir dir="${build}"/>
49
<mkdir dir="${bootstrapBuild}"/>
50
</target>
51
52
<target name="compile_generator" depends="init,getDependentLibs" description="Compile SimpleIndyGenerator">
53
<echo>Compiling Everything but IndyTest and ComplexIndyTest</echo>
54
<echo>Ant version is ${ant.version}</echo>
55
<property name="compiler.javac" value="${TEST_JDK_HOME}/bin/javac" />
56
<echo>============COMPILER SETTINGS============</echo>
57
<echo>===fork: yes</echo>
58
<echo>===executable: ${compiler.javac}</echo>
59
<echo>===debug: on</echo>
60
<echo>===destdir: ${DEST}</echo>
61
<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
62
<src path="${src}"/>
63
<include name="**/indyn/BootstrapMethods.java" />
64
<include name="**/indyn/ComplexIndyGenerator.java" />
65
<include name="**/indyn/Helper.java" />
66
<include name="**/indyn/SimpleIndyGenerator.java" />
67
<include name="**/CrossPackageHelper.java"/>
68
<classpath>
69
<pathelement location="${LIB_DIR}/asm-all.jar" />
70
<pathelement location="${LIB_DIR}/junit4.jar" />
71
</classpath>
72
</javac>
73
</target>
74
75
<target name="generate_indyn" depends="compile_generator" description="Run SimpleIndyGenerator to generate bytecode" >
76
<property name="javaexecutable.java" value="${TEST_JDK_HOME}/bin/java" />
77
<echo>Running SimpleIndyGenerator</echo>
78
<java classname="com.ibm.j9.jsr292.indyn.SimpleIndyGenerator" failonerror="true" fork="true" logError="true"
79
jvm="${javaexecutable.java}">
80
<classpath>
81
<pathelement location="${LIB_DIR}/asm-all.jar" />
82
<pathelement location="${build}"/>
83
</classpath>
84
</java>
85
<copy file="GenIndyn.class" todir="${build}/com/ibm/j9/jsr292/indyn" overwrite="true" />
86
<delete failonerror="true" verbose="true">
87
<fileset dir=".">
88
<include name="*GenIndyn.class"/>
89
</fileset>
90
</delete>
91
<echo>Running ComplexIndyGenerator</echo>
92
<java classname="com.ibm.j9.jsr292.indyn.ComplexIndyGenerator" failonerror="true" fork="true" logError="true"
93
jvm="${javaexecutable.java}">
94
<classpath>
95
<pathelement location="${LIB_DIR}/asm-all.jar" />
96
<pathelement location="${build}"/>
97
</classpath>
98
</java>
99
<copy file="ComplexIndy.class" todir="${build}/com/ibm/j9/jsr292/indyn" overwrite="true" />
100
<delete failonerror="true" verbose="true">
101
<fileset dir=".">
102
<include name="*ComplexIndy.class"/>
103
</fileset>
104
</delete>
105
</target>
106
107
<target name="compile_bootstrap" depends="init" description="compile the bootstrap source " >
108
<echo>Ant version is ${ant.version}</echo>
109
<property name="compiler.javac" value="${TEST_JDK_HOME}/bin/javac" />
110
<echo>============COMPILER SETTINGS============</echo>
111
<echo>===fork: yes</echo>
112
<echo>===executable: ${compiler.javac}</echo>
113
<echo>===debug: on</echo>
114
<echo>===destdir: ${DEST}</echo>
115
<if>
116
<equals arg1="${JDK_VERSION}" arg2="8"/>
117
<then>
118
<javac srcdir="${bootstrapSrc}" destdir="${bootstrapBuild}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
119
<src path="${bootstrapSrc}"/>
120
<src path="${bootstrapSrc_80}"/>
121
</javac>
122
</then>
123
<else>
124
<if>
125
<equals arg1="${JCL_VERSION}" arg2="latest"/>
126
<then>
127
<property name="addExports" value="--add-exports java.base/jdk.internal.reflect=ALL-UNNAMED" />
128
</then>
129
<else>
130
<property name="addExports" value="--add-exports java.base/jdk.internal.reflect=ALL-UNNAMED" />
131
</else>
132
</if>
133
<javac srcdir="${bootstrapSrc}" destdir="${bootstrapBuild}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
134
<src path="${bootstrapSrc}"/>
135
<src path="${bootstrapSrc_90}"/>
136
<compilerarg line='${addExports}' />
137
</javac>
138
</else>
139
</if>
140
</target>
141
142
<target name="compile" depends="compile_bootstrap, generate_indyn" description="compile the test source " >
143
<echo>Ant version is ${ant.version}</echo>
144
<echo>============COMPILER SETTINGS============</echo>
145
<echo>===fork: yes</echo>
146
<echo>===executable: ${compiler.javac}</echo>
147
<echo>===debug: on</echo>
148
<echo>===destdir: ${DEST}</echo>
149
<if>
150
<equals arg1="${JDK_VERSION}" arg2="8"/>
151
<then>
152
<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
153
<src path="${src}"/>
154
<src path="${transformerListener}" />
155
<src path="${TestUtilities}" />
156
<!-- exclude files only for jdk9 -->
157
<exclude name="**/MethodHandleAPI_asCollector.java" />
158
<exclude name="**/MethodHandleAPI_asSpreader.java" />
159
<exclude name="**/MethodHandleAPI_foldArguments.java" />
160
<exclude name="**/MethodHandleAPI_withVarargs.java" />
161
<exclude name="**/MethodHandleAPI_tryFinally.java" />
162
<exclude name="**/MethodHandleAPI_loop.java" />
163
<exclude name="**/MethodHandleAPI_iteratedLoop.java" />
164
<exclude name="**/MethodHandleAPI_zero.java" />
165
<exclude name="**/MethodHandleAPI_whileLoop.java" />
166
<exclude name="**/MethodHandleAPI_countedLoop.java"/>
167
<exclude name="**/MethodHandleAPI_arrayLength.java" />
168
<exclude name="**/MethodHandleAPI_arrayConstructor.java" />
169
<exclude name="**/MethodHandleAPI_dropLookupMode.java" />
170
<exclude name="**/SamePackageExample.java" />
171
<exclude name="**/LookupAPITests_FindClass.java" />
172
<exclude name="**/LookupAPITests_AccessClass.java"/>
173
<exclude name="**/MethodHandleAPI_dropArgumentsToMatch.java" />
174
175
<!-- exclude non test files for indyn test -->
176
<exclude name="**/indyn/BootstrapMethods.java" />
177
<exclude name="**/indyn/ComplexIndyGenerator.java" />
178
<exclude name="**/indyn/Helper.java" />
179
<exclude name="**/indyn/SimpleIndyGenerator.java" />
180
<exclude name="**/CrossPackageHelper.java"/>
181
<exclude name="**/attachAPI/**" />
182
<classpath>
183
<pathelement location="${bootstrapBuild}"/>
184
<pathelement location="${LIB_DIR}/asm-all.jar" />
185
<pathelement location="${LIB_DIR}/junit4.jar" />
186
<pathelement location="${LIB_DIR}/testng.jar"/>
187
<pathelement location="${LIB_DIR}/jcommander.jar"/>
188
</classpath>
189
</javac>
190
</then>
191
<else>
192
<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
193
<src path="${src}" />
194
<src path="${transformerListener}" />
195
<src path="${TestUtilities}" />
196
<!-- exclude non test files for indyn test -->
197
<exclude name="**/indyn/BootstrapMethods.java" />
198
<exclude name="**/indyn/ComplexIndyGenerator.java" />
199
<exclude name="**/indyn/Helper.java" />
200
<exclude name="**/indyn/SimpleIndyGenerator.java" />
201
<exclude name="**/CrossPackageHelper.java"/>
202
<exclude name="**/attachAPI/**" />
203
<classpath>
204
<pathelement location="${bootstrapBuild}"/>
205
<pathelement location="${LIB_DIR}/asm-all.jar" />
206
<pathelement location="${LIB_DIR}/junit4.jar" />
207
<pathelement location="${LIB_DIR}/testng.jar"/>
208
<pathelement location="${LIB_DIR}/jcommander.jar"/>
209
</classpath>
210
</javac>
211
</else>
212
</if>
213
</target>
214
215
<target name="dist" depends="compile" description="generate the distribution" >
216
<copy todir="${DEST}">
217
<fileset dir="${src}/../" includes="*.xml,*.policy" />
218
<fileset dir="${src}/../" includes="*.mk" />
219
</copy>
220
<jar jarfile="${DEST}/jsr292test.jar" filesonly="true">
221
<fileset dir="${build}"/>
222
</jar>
223
<jar jarfile="${DEST}/jsr292bootstrap.jar" filesonly="true">
224
<fileset dir="${bootstrapBuild}"/>
225
</jar>
226
</target>
227
228
<target name="clean" depends="dist" description="clean up" >
229
<delete dir="${build}"/>
230
<delete dir="${bootstrapBuild}"/>
231
</target>
232
233
<target name="build" >
234
<antcall target="clean" inheritall="true" />
235
</target>
236
</project>
237