Skip to content

Commit

Permalink
Copy getJtreg to shared location (#4871)
Browse files Browse the repository at this point in the history
-Moved the getJtreg tar download logic to TKG/scripts/getDependencies.xml

resolves : #4848

Signed-off-by: Anna Babu Palathingal <[email protected]>
  • Loading branch information
annaibm authored Nov 23, 2023
1 parent 546fc0d commit 194e8b8
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 278 deletions.
73 changes: 1 addition & 72 deletions functional/security/Crypto/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,81 +51,10 @@
<target name="init">
<mkdir dir="${DEST}" />
</target>
<if>
<matches pattern="^([89]|1[02-6])$" string="${JDK_VERSION}"/>
<then>
<property name="jtregTar" value="jtreg_5_1_b01"/>
</then>
<elseif>
<matches pattern="^11$" string="${JDK_VERSION}"/>
<then>
<property name="jtregTar" value="jtreg_6_1"/>
</then>
</elseif>
<elseif>
<!-- versions 17, 21, 22 -->
<matches pattern="^(17|2[12])$" string="${JDK_VERSION}"/>
<then>
<property name="jtregTar" value="jtreg_7_3_1_1"/>
</then>
</elseif>
<else>
<fail message="Unsupported JDK version: ${JDK_VERSION}"/>
</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>
<property name="LIB" value="${jtregTar}${openj9jtregtimeouthandler}"/>

<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>
<target name="getJtreg">
<mkdir dir="${DEST}"/>
<if>
<not>
<available file="${LIB_DIR}/${jtregTar}.tar.gz" />
</not>
<then>
<if>
<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>
</if>
</then>
<else>
<copy file="${LIB_DIR}/${jtregTar}.tar.gz" tofile="${jtregTar}.tar.gz"/>
</else>
</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} &amp;&amp; tar xof -)'" />
</exec>
</else>
</if>
</target>

<target name="dist" depends="getDependentLibs,getJtreg,getCryptoTest" description="generate the distribution">
<target name="dist" depends="getJtreg,getCryptoTest" description="generate the distribution">
<copy todir="${DEST}">
<fileset dir="${src}" includes="*.xml,*.mk" />
</copy>
Expand Down
163 changes: 45 additions & 118 deletions functional/security/ssl-tests/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,131 +15,58 @@
-->

<project name="ssl-tests Security Functional tests" default="build" basedir=".">
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<description>
ssl-tests Security Functional tests
</description>
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<description>
ssl-tests Security Functional tests
</description>

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

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

<target name="ssltests.check">
<condition property="ssltestsTestdir.exists">
<available file="ssl-tests" type="dir"/>
</condition>
</target>
<target name="ssltests.check">
<condition property="ssltestsTestdir.exists">
<available file="ssl-tests" type="dir"/>
</condition>
</target>

<if>
<contains string="${SPEC}" substring="zos"/>
<then>
<property name="GIT_REPO" value="[email protected]:" />
</then>
<else>
<property name="GIT_REPO" value="https://github.com/" />
</else>
</if>
<target name="getSsltestsTest" depends="ssltests.check" unless="ssltestsTestdir.exists">
<exec executable="git" failonerror="true">
<arg value="clone" />
<arg value="${GIT_REPO}rh-openjdk/ssl-tests.git" />
</exec>
</target>
<if>
<contains string="${SPEC}" substring="zos"/>
<then>
<property name="GIT_REPO" value="[email protected]:" />
</then>
<else>
<property name="GIT_REPO" value="https://github.com/" />
</else>
</if>
<target name="getSsltestsTest" depends="ssltests.check" unless="ssltestsTestdir.exists">
<exec executable="git" failonerror="true">
<arg value="clone" />
<arg value="${GIT_REPO}rh-openjdk/ssl-tests.git" />
</exec>
</target>

<target name="init">
<mkdir dir="${DEST}" />
</target>
<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 -->
<matches pattern="^1[17]$" string="${JDK_VERSION}"/>
<then>
<property name="jtregTar" value="jtreg_6_1"/>
</then>
</elseif>
<elseif>
<!-- version 21, 22 -->
<matches pattern="^2[12]$" string="${JDK_VERSION}"/>
<then>
<property name="jtregTar" value="jtreg_7_3_1_1"/>
</then>
</elseif>
<else>
<fail message="Unsupported JDK version: ${JDK_VERSION}"/>
</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>
<property name="LIB" value="${jtregTar}${openj9jtregtimeouthandler}"/>
<target name="init">
<mkdir dir="${DEST}" />
</target>

<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>
<target name="getJtreg">
<mkdir dir="${DEST}"/>
<if>
<not>
<available file="${LIB_DIR}/${jtregTar}.tar.gz" />
</not>
<then>
<if>
<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>
</if>
</then>
<else>
<copy file="${LIB_DIR}/${jtregTar}.tar.gz" tofile="${jtregTar}.tar.gz"/>
</else>
</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} &amp;&amp; tar xof -)'" />
</exec>
</else>
</if>
</target>
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>

<target name="dist" depends="getJtreg,getSsltestsTest" description="generate the distribution">
<copy todir="${DEST}">
<fileset dir="${src}" includes="*.xml,*.mk" />
</copy>
</target>

<target name="dist" depends="getDependentLibs,getJtreg,getSsltestsTest" description="generate the distribution">
<copy todir="${DEST}">
<fileset dir="${src}" includes="*.xml,*.mk" />
</copy>
</target>
<target name="clean" depends="dist" description="clean up">
<!-- Delete the ${build} directory trees -->
<delete dir="${build}" />
</target>

<target name="clean" depends="dist" description="clean up">
<!-- Delete the ${build} directory trees -->
<delete dir="${build}" />
</target>

<target name="build" >
<antcall target="clean" inheritall="true" />
</target>
<target name="build" >
<antcall target="clean" inheritall="true" />
</target>
</project>

93 changes: 5 additions & 88 deletions openjdk/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,81 +41,8 @@

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

<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>
<!-- version 11 -->
<matches pattern="^11$" string="${JDK_VERSION}"/>
<then>
<property name="jtregTar" value="jtreg_6_1"/>
</then>
</elseif>
<elseif>
<!-- versions 17, 21, 22 -->
<matches pattern="^(17|2[12])$" string="${JDK_VERSION}"/>
<then>
<property name="jtregTar" value="jtreg_7_3_1_1"/>
</then>
</elseif>
<else>
<fail message="Unsupported JDK version: ${JDK_VERSION}"/>
</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>

<property name="LIB" value="${jtregTar}${openj9jtregtimeouthandler}"/>

<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>

<target name="getJtreg" depends="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} &amp;&amp; tar xof -)'"/>
</exec>
</else>
</if>
</target>


<target name="getOpenjdk" depends="openjdk-jdk.check" unless="jdkdir.exists">
<!-- Windows API limitation of file paths having 260 characters or fewer,
run the config command to allow file paths of 4096 characters
Expand All @@ -141,12 +68,7 @@
<if>
<contains string="${SPEC}" substring="zos"/>
<then>
<propertyregex
property="JDK_REPO_SPECIFIC"
input="${env.JDK_REPO}"
regexp="https://github.ibm.com/"
replace="[email protected]:"
defaultValue="${env.JDK_REPO}"/>
<propertyregex property="JDK_REPO_SPECIFIC" input="${env.JDK_REPO}" regexp="https://github.ibm.com/" replace="[email protected]:" defaultValue="${env.JDK_REPO}"/>
</then>
<else>
<property name="JDK_REPO_SPECIFIC" value="${env.JDK_REPO}"/>
Expand Down Expand Up @@ -193,16 +115,11 @@
<if>
<isset property="isZOS"/>
<then>
<propertyregex
property="jdk_sha"
input="${jdk_sha}"
regexp="\n"
replace=""
override="true"/>
<propertyregex property="jdk_sha" input="${jdk_sha}" regexp="\n" replace="" override="true"/>
</then>
</if>
<echo message="git checkout -q -f ${jdk_sha} "/>
<exec executable="git" failonerror="true" dir="openjdktemp" >
<exec executable="git" failonerror="true" dir="openjdktemp">
<arg value="checkout"/>
<arg value="-q"/>
<arg value="-f"/>
Expand Down Expand Up @@ -327,7 +244,7 @@
</copy>
</target>

<target name="build" >
<target name="build">
<antcall target="dist" inheritall="true"/>
</target>
</project>

0 comments on commit 194e8b8

Please sign in to comment.