1#!/bin/bash 2# Copyright 2022 Google LLC 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# http://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 17set -euo pipefail 18 19if [[ -n "${KOKORO_ROOT:-}" ]] ; then 20 readonly TINK_BASE_DIR="$(echo "${KOKORO_ARTIFACTS_DIR}"/git*)" 21 cd "${TINK_BASE_DIR}/tink_java" 22 export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-8-latest/Contents/Home 23 export XCODE_VERSION="14.1" 24 export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer" 25fi 26 27CACHE_FLAGS="" 28if [[ -n "${TINK_REMOTE_BAZEL_CACHE_GCS_BUCKET:-}" ]]; then 29 cp "${TINK_REMOTE_BAZEL_CACHE_SERVICE_KEY}" ./cache_key 30 CACHE_FLAGS="-c ${TINK_REMOTE_BAZEL_CACHE_GCS_BUCKET}/bazel/java-macos" 31fi 32readonly CACHE_FLAGS 33 34source ./kokoro/testutils/update_android_sdk.sh 35./kokoro/testutils/run_bazel_tests.sh ${CACHE_FLAGS} . 36./kokoro/testutils/run_bazel_tests.sh ${CACHE_FLAGS} "examples" 37