Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/test/functional/Java9andUp/build.xml
6000 views
1
<?xml version="1.0"?>
2
3
<!--
4
Copyright (c) 2016, 2022 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="Java9andUp" default="build" basedir=".">
26
<taskdef resource='net/sf/antcontrib/antlib.xml'/>
27
<description>
28
Tests for Java9andUp
29
</description>
30
31
<!-- set global properties for this build -->
32
<property name="DEST" value="${BUILD_ROOT}/functional/Java9andUp" />
33
34
<!--Properties for this particular build-->
35
<property name="src" location="./src"/>
36
<property name="TestUtilities" location="../TestUtilities/src"/>
37
<property name="TestUtilitiesJ9" location="../TestUtilitiesJ9/src"/>
38
<property name="module_src_root" location="./modules"/>
39
<property name="module_bin_root" location="./module_bin"/>
40
<property name="dest_module_bin" location="${DEST}/module_bin"/>
41
<property name="build" location="./bin"/>
42
<property name="transformerListener" location="${TEST_ROOT}/Utils/src"/>
43
<property name="LIB" value="asm_all,testng,jcommander"/>
44
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>
45
46
<!--<property name="src.level" value="1.9"/>
47
<property name="target.level" value="1.9"/> -->
48
49
<target name="init">
50
<mkdir dir="${DEST}" />
51
<mkdir dir="${build}"/>
52
</target>
53
54
<target name="compile" depends="init,getDependentLibs" description="Using java ${JDK_VERSION} to compile the source " >
55
<echo>Ant version is ${ant.version}</echo>
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
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="${TestUtilities}" />
65
<src path="${TestUtilitiesJ9}" />
66
<src path="${transformerListener}" />
67
<compilerarg line="--add-exports java.base/jdk.internal.misc=ALL-UNNAMED --add-exports java.base/sun.security.internal.spec=ALL-UNNAMED --add-exports java.base/jdk.internal.reflect=ALL-UNNAMED --add-exports java.base/openj9.internal.tools.attach.target=ALL-UNNAMED" />
68
<classpath>
69
<pathelement location="${LIB_DIR}/asm-all.jar" />
70
<pathelement location="${LIB_DIR}/testng.jar" />
71
<pathelement location="${LIB_DIR}/jcommander.jar" />
72
</classpath>
73
</javac>
74
</target>
75
76
<property name="MODULE_NAME_ROOT" value="org.openj9test.modularity" />
77
<property name="MODULE_PATH_ROOT" value="org/openj9/test/modularity"/>
78
<target name="build_modules" depends="init" description="Create the base modules for the modularity tests ">
79
<mkdir dir="${module_bin_root}" />
80
<copy file="${LIB_DIR}/testng.jar" todir="${module_bin_root}" />
81
<copy file="${LIB_DIR}/jcommander.jar" todir="${module_bin_root}" />
82
<for list="common,moduleD,moduleC,moduleB,moduleA,testerModule,dummy" param="mod">
83
<sequential>
84
<var name="module_src_dir" value="${module_src_root}/${MODULE_NAME_ROOT}.@{mod}" />
85
<var name="module_bin_dir" value="${module_bin_root}/${MODULE_NAME_ROOT}.@{mod}" />
86
<mkdir dir="${module_bin_dir}" />
87
<var name="modpath" value="--module-path ${module_bin_root} -d ${module_bin_dir}" />
88
<javac srcdir="${module_src_dir}" destdir="${module_bin_dir}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
89
<src path="${module_src_dir}" />
90
<compilerarg line="${modpath}" />
91
</javac>
92
</sequential>
93
</for>
94
<!-- compile unnamed module depending on module org.openj9test.modularity.dummy -->
95
<for list="unnamed" param="mod">
96
<sequential>
97
<var name="module_src_dir" value="${module_src_root}/${MODULE_NAME_ROOT}.@{mod}" />
98
<var name="module_bin_dir" value="${module_bin_root}/${MODULE_NAME_ROOT}.@{mod}" />
99
<mkdir dir="${module_bin_dir}" />
100
<var name="modpath" value="-cp ${LIB_DIR}/testng.jar --module-path ${module_bin_root} -d ${module_bin_dir} --add-modules org.openj9test.modularity.dummy --add-exports org.openj9test.modularity.dummy/org.openj9.test.modularity.dummy=ALL-UNNAMED" />
101
<javac srcdir="${module_src_dir}" destdir="${module_bin_dir}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
102
<src path="${module_src_dir}" />
103
<compilerarg line="${modpath}" />
104
</javac>
105
</sequential>
106
</for>
107
<!-- compile module org.openj9test.modularity.testUnreflect depending on unnamed module above -->
108
<for list="testUnreflect" param="mod">
109
<sequential>
110
<var name="module_src_dir" value="${module_src_root}/${MODULE_NAME_ROOT}.@{mod}" />
111
<var name="module_bin_dir" value="${module_bin_root}/${MODULE_NAME_ROOT}.@{mod}" />
112
<mkdir dir="${module_bin_dir}" />
113
<var name="modpath" value="--module-path ${module_bin_root} -d ${module_bin_dir} --add-reads org.openj9test.modularity.testUnreflect=ALL-UNNAMED" />
114
<javac srcdir="${module_src_dir}" destdir="${module_bin_dir}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
115
<src path="${module_src_dir}" />
116
<classpath>
117
<pathelement location="${module_bin_root}/org.openj9test.modularity.unnamed" />
118
<pathelement location="${LIB_DIR}/testng.jar" />
119
</classpath>
120
<compilerarg line="${modpath}" />
121
</javac>
122
</sequential>
123
</for>
124
<exec executable="${TEST_JDK_HOME}/bin/java" failonerror="true">
125
<arg line="-jar ${LIB_DIR}/asmtools.jar jasm -d ${module_bin_root}/${MODULE_NAME_ROOT}.testerModule ${module_src_root}/${MODULE_NAME_ROOT}.testerModule/${MODULE_PATH_ROOT}/tests/MethodHandleTester.jasm" />
126
</exec>
127
</target>
128
129
<target name="dist" depends="compile,build_modules" description="generate the distribution">
130
<mkdir dir="${DEST}"/>
131
<jar jarfile="${DEST}/GeneralTest.jar" filesonly="true">
132
<fileset dir="${build}"/>
133
<fileset dir="${src}/../" includes="*.properties,*.xml"/>
134
</jar>
135
<copy todir="${DEST}">
136
<fileset dir="${src}/../" includes="*.xml" />
137
<fileset dir="${src}/../" includes="*.mk" />
138
</copy>
139
<if>
140
<!-- These tests are not supported for build 148 -->
141
<equals arg1="${JCL_VERSION}" arg2="latest"/>
142
<then>
143
<echo>copy ${module_bin_root} to ${dest_module_bin}</echo>
144
<mkdir dir="${dest_module_bin}"/>
145
<copy todir="${dest_module_bin}">
146
<fileset dir="${module_bin_root}"/>
147
</copy>
148
</then>
149
</if>
150
</target>
151
152
<target name="build" >
153
<if>
154
<or>
155
<equals arg1="${JDK_IMPL}" arg2="ibm" />
156
<equals arg1="${JDK_IMPL}" arg2="openj9" />
157
</or>
158
<then>
159
<if>
160
<not>
161
<equals arg1="${JDK_VERSION}" arg2="8"/>
162
</not>
163
<then>
164
<antcall target="clean" inheritall="true" />
165
</then>
166
</if>
167
</then>
168
</if>
169
</target>
170
171
<target name="clean" depends="dist" description="clean up" >
172
<!-- Delete the ${build} directory trees -->
173
<delete dir="${module_bin_root}"/>
174
<delete dir="${build}"/>
175
</target>
176
</project>
177
178