-
-
Notifications
You must be signed in to change notification settings - Fork 96
/
getDependencies.xml
97 lines (93 loc) · 2.89 KB
/
getDependencies.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?xml version="1.0"?>
<!--
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-->
<project name="getDependency" default="getDependentLibs" basedir=".">
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
<description>
Get Third Party Dependencies
</description>
<!-- set default LIB property to all -->
<property name="LIB" value="all"/>
<target name="getJtregVersion">
<if>
<!-- versions 8-10, 12-16 -->
<matches pattern="^([89]|1[02-6])$" string="${JDK_VERSION}"/>
<then>
<property name="jtregTar" value="jtreg_5_1_b01"/>
</then>
<elseif>
<!-- versions 11, 17-23 -->
<matches pattern="^(11|1[7-9]|2[0-3])$" string="${JDK_VERSION}"/>
<then>
<property name="jtregTar" value="jtreg_7_3_1_1"/>
</then>
</elseif>
<else>
<!-- versions 24+ -->
<property name="jtregTar" value="jtreg_7_4_1"/>
</else>
</if>
<if>
<or>
<equals arg1="${JDK_IMPL}" arg2="ibm"/>
<equals arg1="${JDK_IMPL}" arg2="openj9"/>
</or>
<then>
<property name="openj9jtregtimeouthandler" value=",tohandler_simple"/>
</then>
<else>
<property name="openj9jtregtimeouthandler" value=""/>
</else>
</if>
<var name="LIB" unset="true"/>
<property name="LIB" value="${jtregTar}${openj9jtregtimeouthandler}"/>
</target>
<target name="getJtreg" depends="getJtregVersion,getDependentLibs">
<mkdir dir="${DEST}"/>
<if>
<available file="${LIB_DIR}/${jtregTar}.tar.gz"/>
<then>
<copy file="${LIB_DIR}/${jtregTar}.tar.gz" tofile="${jtregTar}.tar.gz"/>
</then>
<elseif>
<available file="custom_jtreg.tar.gz"/>
<then>
<echo message="Using custom_jtreg.tar.gz"/>
<copy file="custom_jtreg.tar.gz" tofile="${jtregTar}.tar.gz"/>
</then>
</elseif>
</if>
<exec executable="gzip" failonerror="true">
<arg line="-df ${jtregTar}.tar.gz"/>
</exec>
<if>
<contains string="${SPEC}" substring="zos"/>
<then>
<exec executable="tar" failonerror="true">
<arg line="xfo ${jtregTar}.tar -C ${DEST}"/>
</exec>
</then>
<else>
<exec executable="sh" failonerror="true">
<arg line="-c 'cat ${jtregTar}.tar | (cd ${DEST} && tar xof -)'"/>
</exec>
</else>
</if>
</target>
<target name="getDependentLibs" unless="skipDependency">
<exec executable="perl" failonerror="true">
<arg line="${TEST_ROOT}/TKG/scripts/getDependencies.pl -path ${LIB_DIR} -task default -dependencyList ${LIB}"/>
</exec>
</target>
</project>