Skip to content

Commit 194e8b8

Browse files
authored
Copy getJtreg to shared location (#4871)
-Moved the getJtreg tar download logic to TKG/scripts/getDependencies.xml resolves : #4848 Signed-off-by: Anna Babu Palathingal <[email protected]>
1 parent 546fc0d commit 194e8b8

File tree

3 files changed

+51
-278
lines changed

3 files changed

+51
-278
lines changed

functional/security/Crypto/build.xml

+1-72
Original file line numberDiff line numberDiff line change
@@ -51,81 +51,10 @@
5151
<target name="init">
5252
<mkdir dir="${DEST}" />
5353
</target>
54-
<if>
55-
<matches pattern="^([89]|1[02-6])$" string="${JDK_VERSION}"/>
56-
<then>
57-
<property name="jtregTar" value="jtreg_5_1_b01"/>
58-
</then>
59-
<elseif>
60-
<matches pattern="^11$" string="${JDK_VERSION}"/>
61-
<then>
62-
<property name="jtregTar" value="jtreg_6_1"/>
63-
</then>
64-
</elseif>
65-
<elseif>
66-
<!-- versions 17, 21, 22 -->
67-
<matches pattern="^(17|2[12])$" string="${JDK_VERSION}"/>
68-
<then>
69-
<property name="jtregTar" value="jtreg_7_3_1_1"/>
70-
</then>
71-
</elseif>
72-
<else>
73-
<fail message="Unsupported JDK version: ${JDK_VERSION}"/>
74-
</else>
75-
</if>
76-
<if>
77-
<or>
78-
<equals arg1="${JDK_IMPL}" arg2="ibm" />
79-
<equals arg1="${JDK_IMPL}" arg2="openj9" />
80-
</or>
81-
<then>
82-
<property name="openj9jtregtimeouthandler" value=",tohandler_simple"/>
83-
</then>
84-
<else>
85-
<property name="openj9jtregtimeouthandler" value=""/>
86-
</else>
87-
</if>
88-
<property name="LIB" value="${jtregTar}${openj9jtregtimeouthandler}"/>
8954

9055
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>
91-
<target name="getJtreg">
92-
<mkdir dir="${DEST}"/>
93-
<if>
94-
<not>
95-
<available file="${LIB_DIR}/${jtregTar}.tar.gz" />
96-
</not>
97-
<then>
98-
<if>
99-
<available file="custom_jtreg.tar.gz"/>
100-
<then>
101-
<echo message="Using custom_jtreg.tar.gz"/>
102-
<copy file="custom_jtreg.tar.gz" tofile="${jtregTar}.tar.gz"/>
103-
</then>
104-
</if>
105-
</then>
106-
<else>
107-
<copy file="${LIB_DIR}/${jtregTar}.tar.gz" tofile="${jtregTar}.tar.gz"/>
108-
</else>
109-
</if>
110-
<exec executable="gzip" failonerror="true">
111-
<arg line="-df ${jtregTar}.tar.gz" />
112-
</exec>
113-
<if>
114-
<contains string="${SPEC}" substring="zos" />
115-
<then>
116-
<exec executable="tar" failonerror="true">
117-
<arg line="xfo ${jtregTar}.tar -C ${DEST}" />
118-
</exec>
119-
</then>
120-
<else>
121-
<exec executable="sh" failonerror="true">
122-
<arg line="-c 'cat ${jtregTar}.tar | (cd ${DEST} &amp;&amp; tar xof -)'" />
123-
</exec>
124-
</else>
125-
</if>
126-
</target>
12756

128-
<target name="dist" depends="getDependentLibs,getJtreg,getCryptoTest" description="generate the distribution">
57+
<target name="dist" depends="getJtreg,getCryptoTest" description="generate the distribution">
12958
<copy todir="${DEST}">
13059
<fileset dir="${src}" includes="*.xml,*.mk" />
13160
</copy>

functional/security/ssl-tests/build.xml

+45-118
Original file line numberDiff line numberDiff line change
@@ -15,131 +15,58 @@
1515
-->
1616

1717
<project name="ssl-tests Security Functional tests" default="build" basedir=".">
18-
<taskdef resource="net/sf/antcontrib/antlib.xml" />
19-
<description>
20-
ssl-tests Security Functional tests
21-
</description>
18+
<taskdef resource="net/sf/antcontrib/antlib.xml" />
19+
<description>
20+
ssl-tests Security Functional tests
21+
</description>
2222

23-
<!-- set global properties for this build -->
24-
<property name="DEST" value="${BUILD_ROOT}/functional/security/ssl-tests" />
23+
<!-- set global properties for this build -->
24+
<property name="DEST" value="${BUILD_ROOT}/functional/security/ssl-tests" />
2525

26-
<!--Properties for this particular build-->
27-
<property name="src" location="./ssl-tests" />
26+
<!--Properties for this particular build-->
27+
<property name="src" location="./ssl-tests" />
2828

29-
<target name="ssltests.check">
30-
<condition property="ssltestsTestdir.exists">
31-
<available file="ssl-tests" type="dir"/>
32-
</condition>
33-
</target>
29+
<target name="ssltests.check">
30+
<condition property="ssltestsTestdir.exists">
31+
<available file="ssl-tests" type="dir"/>
32+
</condition>
33+
</target>
3434

35-
<if>
36-
<contains string="${SPEC}" substring="zos"/>
37-
<then>
38-
<property name="GIT_REPO" value="[email protected]:" />
39-
</then>
40-
<else>
41-
<property name="GIT_REPO" value="https://github.com/" />
42-
</else>
43-
</if>
44-
<target name="getSsltestsTest" depends="ssltests.check" unless="ssltestsTestdir.exists">
45-
<exec executable="git" failonerror="true">
46-
<arg value="clone" />
47-
<arg value="${GIT_REPO}rh-openjdk/ssl-tests.git" />
48-
</exec>
49-
</target>
35+
<if>
36+
<contains string="${SPEC}" substring="zos"/>
37+
<then>
38+
<property name="GIT_REPO" value="[email protected]:" />
39+
</then>
40+
<else>
41+
<property name="GIT_REPO" value="https://github.com/" />
42+
</else>
43+
</if>
44+
<target name="getSsltestsTest" depends="ssltests.check" unless="ssltestsTestdir.exists">
45+
<exec executable="git" failonerror="true">
46+
<arg value="clone" />
47+
<arg value="${GIT_REPO}rh-openjdk/ssl-tests.git" />
48+
</exec>
49+
</target>
5050

51-
<target name="init">
52-
<mkdir dir="${DEST}" />
53-
</target>
54-
<if>
55-
<!-- versions 8-10, 12-16 -->
56-
<matches pattern="^([89]|1[02-6])$" string="${JDK_VERSION}"/>
57-
<then>
58-
<property name="jtregTar" value="jtreg_5_1_b01"/>
59-
</then>
60-
<elseif>
61-
<!-- versions 11, 17 -->
62-
<matches pattern="^1[17]$" string="${JDK_VERSION}"/>
63-
<then>
64-
<property name="jtregTar" value="jtreg_6_1"/>
65-
</then>
66-
</elseif>
67-
<elseif>
68-
<!-- version 21, 22 -->
69-
<matches pattern="^2[12]$" string="${JDK_VERSION}"/>
70-
<then>
71-
<property name="jtregTar" value="jtreg_7_3_1_1"/>
72-
</then>
73-
</elseif>
74-
<else>
75-
<fail message="Unsupported JDK version: ${JDK_VERSION}"/>
76-
</else>
77-
</if>
78-
<if>
79-
<or>
80-
<equals arg1="${JDK_IMPL}" arg2="ibm" />
81-
<equals arg1="${JDK_IMPL}" arg2="openj9" />
82-
</or>
83-
<then>
84-
<property name="openj9jtregtimeouthandler" value=",tohandler_simple"/>
85-
</then>
86-
<else>
87-
<property name="openj9jtregtimeouthandler" value=""/>
88-
</else>
89-
</if>
90-
<property name="LIB" value="${jtregTar}${openj9jtregtimeouthandler}"/>
51+
<target name="init">
52+
<mkdir dir="${DEST}" />
53+
</target>
9154

92-
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>
93-
<target name="getJtreg">
94-
<mkdir dir="${DEST}"/>
95-
<if>
96-
<not>
97-
<available file="${LIB_DIR}/${jtregTar}.tar.gz" />
98-
</not>
99-
<then>
100-
<if>
101-
<available file="custom_jtreg.tar.gz"/>
102-
<then>
103-
<echo message="Using custom_jtreg.tar.gz"/>
104-
<copy file="custom_jtreg.tar.gz" tofile="${jtregTar}.tar.gz"/>
105-
</then>
106-
</if>
107-
</then>
108-
<else>
109-
<copy file="${LIB_DIR}/${jtregTar}.tar.gz" tofile="${jtregTar}.tar.gz"/>
110-
</else>
111-
</if>
112-
<exec executable="gzip" failonerror="true">
113-
<arg line="-df ${jtregTar}.tar.gz" />
114-
</exec>
115-
<if>
116-
<contains string="${SPEC}" substring="zos" />
117-
<then>
118-
<exec executable="tar" failonerror="true">
119-
<arg line="xfo ${jtregTar}.tar -C ${DEST}" />
120-
</exec>
121-
</then>
122-
<else>
123-
<exec executable="sh" failonerror="true">
124-
<arg line="-c 'cat ${jtregTar}.tar | (cd ${DEST} &amp;&amp; tar xof -)'" />
125-
</exec>
126-
</else>
127-
</if>
128-
</target>
55+
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>
56+
57+
<target name="dist" depends="getJtreg,getSsltestsTest" description="generate the distribution">
58+
<copy todir="${DEST}">
59+
<fileset dir="${src}" includes="*.xml,*.mk" />
60+
</copy>
61+
</target>
12962

130-
<target name="dist" depends="getDependentLibs,getJtreg,getSsltestsTest" description="generate the distribution">
131-
<copy todir="${DEST}">
132-
<fileset dir="${src}" includes="*.xml,*.mk" />
133-
</copy>
134-
</target>
63+
<target name="clean" depends="dist" description="clean up">
64+
<!-- Delete the ${build} directory trees -->
65+
<delete dir="${build}" />
66+
</target>
13567

136-
<target name="clean" depends="dist" description="clean up">
137-
<!-- Delete the ${build} directory trees -->
138-
<delete dir="${build}" />
139-
</target>
140-
141-
<target name="build" >
142-
<antcall target="clean" inheritall="true" />
143-
</target>
68+
<target name="build" >
69+
<antcall target="clean" inheritall="true" />
70+
</target>
14471
</project>
14572

openjdk/build.xml

+5-88
Original file line numberDiff line numberDiff line change
@@ -41,81 +41,8 @@
4141

4242
<property name="REFERENCE_REPO" value="--reference-if-able ${home.unix}/openjdk_cache"/>
4343

44-
<if>
45-
<!-- versions 8-10, 12-16 -->
46-
<matches pattern="^([89]|1[02-6])$" string="${JDK_VERSION}"/>
47-
<then>
48-
<property name="jtregTar" value="jtreg_5_1_b01"/>
49-
</then>
50-
<elseif>
51-
<!-- version 11 -->
52-
<matches pattern="^11$" string="${JDK_VERSION}"/>
53-
<then>
54-
<property name="jtregTar" value="jtreg_6_1"/>
55-
</then>
56-
</elseif>
57-
<elseif>
58-
<!-- versions 17, 21, 22 -->
59-
<matches pattern="^(17|2[12])$" string="${JDK_VERSION}"/>
60-
<then>
61-
<property name="jtregTar" value="jtreg_7_3_1_1"/>
62-
</then>
63-
</elseif>
64-
<else>
65-
<fail message="Unsupported JDK version: ${JDK_VERSION}"/>
66-
</else>
67-
</if>
68-
69-
<if>
70-
<or>
71-
<equals arg1="${JDK_IMPL}" arg2="ibm"/>
72-
<equals arg1="${JDK_IMPL}" arg2="openj9"/>
73-
</or>
74-
<then>
75-
<property name="openj9jtregtimeouthandler" value=",tohandler_simple"/>
76-
</then>
77-
<else>
78-
<property name="openj9jtregtimeouthandler" value=""/>
79-
</else>
80-
</if>
81-
82-
<property name="LIB" value="${jtregTar}${openj9jtregtimeouthandler}"/>
83-
8444
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>
85-
86-
<target name="getJtreg" depends="getDependentLibs">
87-
<mkdir dir="${DEST}"/>
88-
<if>
89-
<available file="${LIB_DIR}/${jtregTar}.tar.gz"/>
90-
<then>
91-
<copy file="${LIB_DIR}/${jtregTar}.tar.gz" tofile="${jtregTar}.tar.gz"/>
92-
</then>
93-
<elseif>
94-
<available file="custom_jtreg.tar.gz"/>
95-
<then>
96-
<echo message="Using custom_jtreg.tar.gz"/>
97-
<copy file="custom_jtreg.tar.gz" tofile="${jtregTar}.tar.gz"/>
98-
</then>
99-
</elseif>
100-
</if>
101-
<exec executable="gzip" failonerror="true">
102-
<arg line="-df ${jtregTar}.tar.gz"/>
103-
</exec>
104-
<if>
105-
<contains string="${SPEC}" substring="zos"/>
106-
<then>
107-
<exec executable="tar" failonerror="true">
108-
<arg line="xfo ${jtregTar}.tar -C ${DEST}"/>
109-
</exec>
110-
</then>
111-
<else>
112-
<exec executable="sh" failonerror="true">
113-
<arg line="-c 'cat ${jtregTar}.tar | (cd ${DEST} &amp;&amp; tar xof -)'"/>
114-
</exec>
115-
</else>
116-
</if>
117-
</target>
118-
45+
11946
<target name="getOpenjdk" depends="openjdk-jdk.check" unless="jdkdir.exists">
12047
<!-- Windows API limitation of file paths having 260 characters or fewer,
12148
run the config command to allow file paths of 4096 characters
@@ -141,12 +68,7 @@
14168
<if>
14269
<contains string="${SPEC}" substring="zos"/>
14370
<then>
144-
<propertyregex
145-
property="JDK_REPO_SPECIFIC"
146-
input="${env.JDK_REPO}"
147-
regexp="https://github.ibm.com/"
148-
replace="[email protected]:"
149-
defaultValue="${env.JDK_REPO}"/>
71+
<propertyregex property="JDK_REPO_SPECIFIC" input="${env.JDK_REPO}" regexp="https://github.ibm.com/" replace="[email protected]:" defaultValue="${env.JDK_REPO}"/>
15072
</then>
15173
<else>
15274
<property name="JDK_REPO_SPECIFIC" value="${env.JDK_REPO}"/>
@@ -193,16 +115,11 @@
193115
<if>
194116
<isset property="isZOS"/>
195117
<then>
196-
<propertyregex
197-
property="jdk_sha"
198-
input="${jdk_sha}"
199-
regexp="\n"
200-
replace=""
201-
override="true"/>
118+
<propertyregex property="jdk_sha" input="${jdk_sha}" regexp="\n" replace="" override="true"/>
202119
</then>
203120
</if>
204121
<echo message="git checkout -q -f ${jdk_sha} "/>
205-
<exec executable="git" failonerror="true" dir="openjdktemp" >
122+
<exec executable="git" failonerror="true" dir="openjdktemp">
206123
<arg value="checkout"/>
207124
<arg value="-q"/>
208125
<arg value="-f"/>
@@ -327,7 +244,7 @@
327244
</copy>
328245
</target>
329246

330-
<target name="build" >
247+
<target name="build">
331248
<antcall target="dist" inheritall="true"/>
332249
</target>
333250
</project>

0 commit comments

Comments
 (0)