forked from adoptium/aqa-tests
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
147 lines (134 loc) · 4.8 KB
/
build.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?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="OpenJcePlus tests" default="build" basedir=".">
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<description>
OpenJCEPlus Tests
</description>
<!-- set global properties for this build -->
<property name="DEST" value="${BUILD_ROOT}/functional/OpenJcePlusTests" />
<!--Properties for this particular build-->
<property name="src" location="./OpenJCEPlus/src/" />
<property name="build" location="./bin" />
<property name="LIB" value="maven"/>
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/>
<property environment="env" />
<target name="openJcePlusTests.check">
<condition property="openJcePlusTests.exists">
<available file="OpenJCEPlus" type="dir"/>
</condition>
</target>
<set-property name="OPENJCEPLUS_GIT_REPO_ISSET" if-property-isset="env.OPENJCEPLUS_GIT_REPO"/>
<if>
<isset property="OPENJCEPLUS_GIT_REPO_ISSET"/>
<then>
<property name="openjceplusGitRepo" value="${env.OPENJCEPLUS_GIT_REPO}"/>
</then>
<else>
<property name="openjceplusGitRepo" value="https://github.com/ibmruntimes/OpenJCEPlus.git"/>
</else>
</if>
<set-property name="OPENJCEPLUS_GIT_BRANCH_ISSET" if-property-isset="env.OPENJCEPLUS_GIT_BRANCH"/>
<if>
<isset property="OPENJCEPLUS_GIT_BRANCH_ISSET"/>
<then>
<property name="openjceplusGitBranch" value="${env.OPENJCEPLUS_GIT_BRANCH}"/>
</then>
<else>
<property name="openjceplusGitBranch" value="semeru-java${JDK_VERSION}"/>
</else>
</if>
<target name="getOpenJcePlusTests" depends="openJcePlusTests.check" unless="openJcePlusTests.exists">
<getFileWithRetry file="OpenJCEPlus" command="git clone -q ${openjceplusGitRepo} OpenJCEPlus"/>
<echo message="git rev-parse ${openjceplusGitBranch} "/>
<exec executable="git" failonerror="false" dir="OpenJCEPlus" outputproperty="repo_sha1" resultproperty="code">
<arg value="rev-parse"/>
<arg value="${openjceplusGitBranch}"/>
</exec>
<if>
<equals arg1="${code}" arg2="128"/>
<then>
<echo message="git rev-parse origin/${openjceplusGitBranch}"/>
<exec executable="git" failonerror="true" dir="OpenJCEPlus" outputproperty="repo_sha2" resultproperty="code2">
<arg value="rev-parse"/>
<arg value="origin/${openjceplusGitBranch}"/>
</exec>
<property name="repo_sha" value="${repo_sha2}"/>
</then>
</if>
<if>
<not>
<isset property="repo_sha"/>
</not>
<then>
<property name="repo_sha" value="${repo_sha1}"/>
</then>
</if>
<if>
<isset property="isZOS"/>
<then>
<propertyregex property="repo_sha" input="${repo_sha}" regexp="\n" replace="" override="true"/>
</then>
</if>
<echo message="git checkout -q -f ${repo_sha} "/>
<exec executable="git" failonerror="true" dir="OpenJCEPlus">
<arg value="checkout"/>
<arg value="-q"/>
<arg value="-f"/>
<arg value="${repo_sha}"/>
</exec>
<checkGitRepoSha repoDir="OpenJCEPlus" />
<addTestenvProperties repoDir="OpenJCEPlus" repoName="OpenJCEPlus"/>
<delete dir="./OpenJCEPlus/src/main" />
</target>
<target name="init">
<mkdir dir="${DEST}" />
<mkdir dir="${build}" />
</target>
<target name="compile" depends="init,getDependentLibs,getOpenJcePlusTests" description="Fetching dependencies and test code.">
</target>
<target name="dist" depends="compile" description="generate the distribution">
<copy todir="${DEST}">
<fileset dir="${LIB_DIR}/" includes="apache-maven-bin.tar.gz" />
<fileset dir="OpenJCEPlus"/>
</copy>
</target>
<target name="clean" depends="dist" description="clean up">
<!-- Delete the ${build} directory trees -->
<delete dir="${build}" />
</target>
<target name="build">
<if>
<and>
<contains string="${TEST_FLAG}" substring="FIPS140_3_OpenJCEPlusFIPS"/>
<equals arg1="${JDK_VENDOR}" arg2="ibm" />
<equals arg1="${JDK_IMPL}" arg2="openj9" />
<not>
<matches string="${JDK_VERSION}" pattern="^(8)$" />
</not>
<or>
<contains string="${SPEC}" substring="aix_ppc-64"/>
<contains string="${SPEC}" substring="linux_ppc-64_le"/>
<contains string="${SPEC}" substring="linux_x86-64"/>
<contains string="${SPEC}" substring="win_x86-64"/>
<contains string="${SPEC}" substring="linux_390-64"/>
</or>
</and>
<then>
<antcall target="clean" inheritall="true" />
</then>
</if>
</target>
</project>