Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/test/functional/UnsafeTest/build.xml
6000 views
1
<?xml version="1.0"?>
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="OpenJ9 Unsafe Tests" default="build" basedir=".">
24
<taskdef resource="net/sf/antcontrib/antlib.xml" />
25
<description>
26
Build OpenJ9 Unsafe Tests
27
</description>
28
29
<!-- set global properties for this build -->
30
<property name="DEST" value="${BUILD_ROOT}/functional/UnsafeTest" />
31
32
<!--Properties for this particular build-->
33
<property name="src" location="src" />
34
<property name="src_80" location="src_80" />
35
<property name="src_90" location="src_90" />
36
<property name="build" location="bin" />
37
<property name="transformerListener" location="${TEST_ROOT}/Utils/src" />
38
<property name="LIB" value="testng" />
39
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml" />
40
41
<target name="init">
42
<mkdir dir="${DEST}" />
43
<mkdir dir="${build}" />
44
</target>
45
46
<target name="compile" depends="init,getDependentLibs" description="Using java ${JDK_VERSION} to 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: ${DEST}</echo>
53
<if>
54
<equals arg1="${JDK_VERSION}" arg2="8" />
55
<then>
56
<property name="src_access" location="${TEST_ROOT}/functional/UnsafeAccess/src" />
57
<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
58
<src path="${src_80}" />
59
<src path="${src_access}" />
60
<src path="${transformerListener}" />
61
<classpath>
62
<pathelement location="${LIB_DIR}/testng.jar" />
63
</classpath>
64
</javac>
65
</then>
66
<else>
67
<if>
68
<matches string="${JDK_VERSION}" pattern="^1[1-6]$$" />
69
<then>
70
<!-- Java 11-16 -->
71
<property name="src_access" location="${TEST_ROOT}/functional/UnsafeAccess/src_110" />
72
</then>
73
<else>
74
<!-- Java 17+ -->
75
<property name="src_access" location="${TEST_ROOT}/functional/UnsafeAccess/src_170" />
76
</else>
77
</if>
78
<property name="src_util" location="../TestUtilities/src" />
79
<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1">
80
<src path="${src_90}" />
81
<src path="${src_access}" />
82
<src path="${transformerListener}" />
83
<src path="${src_util}" />
84
<classpath>
85
<pathelement location="${LIB_DIR}/testng.jar" />
86
</classpath>
87
<compilerarg value="--add-exports" />
88
<compilerarg value="java.base/jdk.internal.misc=ALL-UNNAMED" />
89
<compilerarg value="--add-exports" />
90
<compilerarg value="java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED" />
91
</javac>
92
</else>
93
</if>
94
</target>
95
96
<target name="dist" depends="compile" description="generate the distribution">
97
<jar jarfile="${DEST}/OpenJ9Unsafe.jar" filesonly="true">
98
<fileset dir="${build}" />
99
<fileset dir="${src}/../" includes="*.properties,*.xml" />
100
</jar>
101
<copy todir="${DEST}">
102
<fileset dir="${src}/../" includes="*.xml" />
103
<fileset dir="${src}/../" includes="*.mk" />
104
</copy>
105
106
</target>
107
108
<target name="clean" depends="dist" description="clean up">
109
<!-- Delete the ${build} directory trees -->
110
<delete dir="${build}" />
111
</target>
112
113
<target name="build">
114
<if>
115
<or>
116
<equals arg1="${JDK_IMPL}" arg2="ibm" />
117
<equals arg1="${JDK_IMPL}" arg2="openj9" />
118
</or>
119
<then>
120
<if>
121
<not>
122
<and>
123
<equals arg1="${JDK_VERSION}" arg2="9" />
124
<equals arg1="${JCL_VERSION}" arg2="current" />
125
</and>
126
</not>
127
<then>
128
<antcall target="clean" inheritall="true" />
129
</then>
130
</if>
131
</then>
132
</if>
133
</target>
134
</project>
135
136