|
| 1 | +<?xml version="1.0"?> |
| 2 | + |
| 3 | +<!-- |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | +--> |
| 16 | + |
| 17 | +<project name="OpenJcePlus tests" default="build" basedir="."> |
| 18 | + <taskdef resource="net/sf/antcontrib/antlib.xml" /> |
| 19 | + <description> |
| 20 | + OpenJCEPlus Tests |
| 21 | + </description> |
| 22 | + |
| 23 | + <!-- set global properties for this build --> |
| 24 | + <property name="DEST" value="${BUILD_ROOT}/functional/OpenJcePlusTests" /> |
| 25 | + |
| 26 | + <!--Properties for this particular build--> |
| 27 | + <property name="src" location="./OpenJCEPlus/src/" /> |
| 28 | + <property name="build" location="./bin" /> |
| 29 | + <property name="LIB" value="junit4,hamcrest_core,bcprov_jdk18on"/> |
| 30 | + <import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/> |
| 31 | + |
| 32 | + <target name="openJcePlusTests.check"> |
| 33 | + <condition property="openJcePlusTests.exists"> |
| 34 | + <available file="OpenJCEPlus" type="dir"/> |
| 35 | + </condition> |
| 36 | + </target> |
| 37 | + |
| 38 | + <if> |
| 39 | + <contains string="${SPEC}" substring="zos"/> |
| 40 | + <then> |
| 41 | + < property name= "GIT_REPO" value= "[email protected]:" /> |
| 42 | + </then> |
| 43 | + <else> |
| 44 | + <property name="GIT_REPO" value="https://github.com/" /> |
| 45 | + </else> |
| 46 | + </if> |
| 47 | + <target name="getOpenJcePlusTests" depends="openJcePlusTests.check" unless="openJcePlusTests.exists"> |
| 48 | + <exec executable="git" failonerror="true"> |
| 49 | + <arg value="clone" /> |
| 50 | + <arg value="${GIT_REPO}IBM/OpenJCEPlus.git" /> |
| 51 | + </exec> |
| 52 | + <delete dir="./OpenJCEPlus/src/main" /> |
| 53 | + </target> |
| 54 | + |
| 55 | + <target name="init"> |
| 56 | + <mkdir dir="${DEST}" /> |
| 57 | + <mkdir dir="${build}" /> |
| 58 | + </target> |
| 59 | + |
| 60 | + <property name="addExports" value='--add-exports java.base/sun.security.internal.spec=openjceplus --add-exports java.base/sun.security.util=openjceplus,ALL-UNNAMED --add-exports java.base/sun.security.x509=openjceplus,ALL-UNNAMED --add-exports java.base/sun.security.pkcs=openjceplus,ALL-UNNAMED --add-exports java.base/sun.security.internal.interfaces=openjceplus --add-exports java.base/sun.util.logging=openjceplus --add-exports java.base/jdk.internal.logger=openjceplus --add-exports openjceplus/com.ibm.crypto.plus.provider.ock=ALL-UNNAMED --add-exports openjceplus/com.ibm.misc=ALL-UNNAMED' /> |
| 61 | + |
| 62 | + <target name="compile" depends="init,getDependentLibs,getOpenJcePlusTests" description="Using java ${JDK_VERSION} to compile the source "> |
| 63 | + <echo>Ant version is ${ant.version}</echo> |
| 64 | + <echo>============COMPILER SETTINGS============</echo> |
| 65 | + <echo>===fork: yes</echo> |
| 66 | + <echo>===executable: ${compiler.javac}</echo> |
| 67 | + <echo>===debug: on</echo> |
| 68 | + <echo>===destdir: ${DEST}</echo> |
| 69 | + <javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1"> |
| 70 | + <compilerarg line='-Xlint:all ${addExports}' /> |
| 71 | + <src path="${src}" /> |
| 72 | + <classpath> |
| 73 | + <pathelement location="${LIB_DIR}/junit4.jar" /> |
| 74 | + <pathelement location="${LIB_DIR}/hamcrest-core.jar" /> |
| 75 | + <pathelement location="${LIB_DIR}/bcprov-jdk18on.jar" /> |
| 76 | + </classpath> |
| 77 | + </javac> |
| 78 | + </target> |
| 79 | + |
| 80 | + <target name="dist" depends="compile" description="generate the distribution"> |
| 81 | + <jar jarfile="${DEST}/openjceplus-tests.jar" filesonly="true"> |
| 82 | + <fileset dir="${build}" /> |
| 83 | + <fileset dir="${src}/../../" includes="*.properties,*.xml" /> |
| 84 | + </jar> |
| 85 | + <copy todir="${DEST}"> |
| 86 | + <fileset dir="${src}/../../" includes="*.xml,*.mk" /> |
| 87 | + </copy> |
| 88 | + </target> |
| 89 | + |
| 90 | + <target name="clean" depends="dist" description="clean up"> |
| 91 | + <!-- Delete the ${build} directory trees --> |
| 92 | + <delete dir="${build}" /> |
| 93 | + </target> |
| 94 | + |
| 95 | + <target name="build" > |
| 96 | + <if> |
| 97 | + <or> |
| 98 | + <contains string="${TEST_FLAG}" substring="OpenJcePlusTests"/> |
| 99 | + <and> |
| 100 | + <equals arg1="${JDK_VENDOR}" arg2="ibm" /> |
| 101 | + <equals arg1="${JDK_IMPL}" arg2="openj9" /> |
| 102 | + <equals arg1="${JDK_VERSION}" arg2="17" /> |
| 103 | + <or> |
| 104 | + <contains string="${SPEC}" substring="aix_ppc-64"/> |
| 105 | + <contains string="${SPEC}" substring="linux_ppc-64_le"/> |
| 106 | + <contains string="${SPEC}" substring="linux_x86-64"/> |
| 107 | + <contains string="${SPEC}" substring="win_x86-64"/> |
| 108 | + </or> |
| 109 | + </and> |
| 110 | + </or> |
| 111 | + <then> |
| 112 | + <antcall target="clean" inheritall="true" /> |
| 113 | + </then> |
| 114 | + </if> |
| 115 | + |
| 116 | + </target> |
| 117 | +</project> |
0 commit comments