Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/test/functional/Java16andUp/build.xml
6000 views
1
<?xml version="1.0"?>
2
<!--
3
Copyright (c) 2021, 2022 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="Java16AndUp" default="build" basedir=".">
24
<taskdef resource='net/sf/antcontrib/antlib.xml' />
25
<description>
26
Tests for Java 16 and up
27
</description>
28
29
<!-- set global properties for this build -->
30
<property name="DEST" value="${BUILD_ROOT}/functional/Java16andUp" />
31
32
<!--Properties for this particular build-->
33
<property name="src" location="src" />
34
<property name="build" location="bin" />
35
<property name="module_src_root" location="modules" />
36
<property name="module_bin_root" location="module_bin" />
37
<property name="dest_module_bin" location="${DEST}/module_bin" />
38
<property name="TestUtilities" location="../TestUtilities/src"/>
39
<property name="LIB" value="asm,testng,jcommander" />
40
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml" />
41
42
<if>
43
<equals arg1="${JDK_VERSION}" arg2="16" />
44
<then>
45
<!-- Java APIs of JEP389 and related features in Java 16 is incompatible with the APIs in Java17 and beyond -->
46
<property name="src_160" value="src_160" />
47
</then>
48
<else>
49
<property name="src_160" value="" />
50
</else>
51
</if>
52
53
<target name="init">
54
<mkdir dir="${DEST}" />
55
<mkdir dir="${build}" />
56
</target>
57
58
<property name="MODULE_NAME_ROOT" value="org.openj9test.modularity" />
59
<property name="MODULE_PATH_ROOT" value="org/openj9/test/modularity" />
60
61
<target name="compile_modules" depends="init" description="Create the base modules for the sealed classes">
62
<mkdir dir="${module_bin_root}" />
63
<copy file="${LIB_DIR}/testng.jar" todir="${module_bin_root}" />
64
<copy file="${LIB_DIR}/jcommander.jar" todir="${module_bin_root}" />
65
<copy file="${LIB_DIR}/asm.jar" todir="${module_bin_root}" />
66
<for list="moduleX,moduleY" param="mod">
67
<sequential>
68
<var name="module_src_dir" value="${module_src_root}/${MODULE_NAME_ROOT}.@{mod}" />
69
<var name="module_bin_dir" value="${module_bin_root}/${MODULE_NAME_ROOT}.@{mod}" />
70
<mkdir dir="${module_bin_dir}" />
71
<var name="modpath" value="--module-path ${module_bin_root} -d ${module_bin_dir}" />
72
<javac srcdir="${module_src_dir}"
73
destdir="${module_bin_dir}"
74
includes="org/openj9/test/modularity/**,org/openj9/test/util/VersionCheck.java"
75
debug="true" fork="true"
76
executable="${compiler.javac}"
77
includeAntRuntime="false"
78
encoding="ISO-8859-1">
79
<compilerarg line='--add-reads org.openj9test.modularity.@{mod}=ALL-UNNAMED' />
80
<compilerarg line='--add-exports java.base/jdk.internal.misc=ALL-UNNAMED' />
81
<compilerarg line='--enable-preview --source ${JDK_VERSION}' />
82
<compilerarg line="${modpath}" />
83
<classpath>
84
<pathelement location="${LIB_DIR}/testng.jar" />
85
<pathelement location="${LIB_DIR}/jcommander.jar" />
86
<pathelement location="${LIB_DIR}/asm.jar" />
87
<pathelement location="${build}" />
88
</classpath>
89
</javac>
90
</sequential>
91
</for>
92
</target>
93
94
<target name="compile" depends="init,getDependentLibs" description="Using java ${JDK_VERSION} to compile the source">
95
<echo>Ant version is ${ant.version}</echo>
96
<echo>============COMPILER SETTINGS============</echo>
97
<echo>===fork: yes</echo>
98
<echo>===executable: ${compiler.javac}</echo>
99
<echo>===debug: on</echo>
100
<echo>===destdir: ${DEST}</echo>
101
102
<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
103
<src path="${src}" />
104
<src path="${src_160}" />
105
<src path="${TestUtilities}" />
106
<exclude name="**/modules/**" />
107
<compilerarg line='--enable-preview --source ${JDK_VERSION}' />
108
<compilerarg line='--add-modules jdk.incubator.foreign' />
109
<compilerarg line='--add-opens jdk.incubator.foreign/jdk.internal.foreign=ALL-UNNAMED' />
110
<compilerarg line='--add-exports java.base/jdk.internal.misc=ALL-UNNAMED' />
111
<compilerarg line='--add-opens java.base/jdk.internal.misc=ALL-UNNAMED' />
112
<compilerarg line='--add-opens java.base/java.lang=ALL-UNNAMED' />
113
<classpath>
114
<pathelement location="${LIB_DIR}/testng.jar" />
115
<pathelement location="${LIB_DIR}/jcommander.jar" />
116
<pathelement location="${LIB_DIR}/asm.jar" />
117
<pathelement location="${build}" />
118
</classpath>
119
</javac>
120
</target>
121
122
<target name="dist" depends="compile,compile_modules" description="generate the distribution">
123
<echo>copy ${module_bin_root} to ${dest_module_bin}</echo>
124
<mkdir dir="${dest_module_bin}" />
125
<copy todir="${dest_module_bin}">
126
<fileset dir="${module_bin_root}" />
127
</copy>
128
<mkdir dir="${DEST}" />
129
<jar jarfile="${DEST}/GeneralTest.jar" filesonly="true">
130
<fileset dir="${build}" />
131
<fileset dir="${dest_module_bin}" />
132
<fileset dir="${src}/../" includes="*.properties,*.xml" />
133
</jar>
134
<copy file="${DEST}/GeneralTest.jar" todir="${dest_module_bin}" />
135
<copy todir="${DEST}">
136
<fileset dir="${src}/../" includes="*.xml" />
137
<fileset dir="${src}/../" includes="*.mk" />
138
</copy>
139
</target>
140
141
<target name="build">
142
<if>
143
<and>
144
<or>
145
<!-- Exclude the tests for other impls, issue: https://github.com/eclipse-openj9/openj9/issues/14028#issuecomment-988225623 -->
146
<equals arg1="${JDK_IMPL}" arg2="ibm" />
147
<equals arg1="${JDK_IMPL}" arg2="openj9" />
148
</or>
149
<not>
150
<matches string="${JDK_VERSION}" pattern="^(8|9|10|11|12|13|14|15)$$" />
151
</not>
152
</and>
153
<then>
154
<antcall target="clean" inheritall="true" />
155
</then>
156
</if>
157
</target>
158
159
<target name="clean" depends="dist" description="clean up">
160
<delete dir="${build}" />
161
<delete dir="${module_bin_root}" />
162
</target>
163
</project>
164
165