Skip to content
This repository was archived by the owner on Aug 4, 2022. It is now read-only.

Commit 37c2881

Browse files
author
Jeff Verkoeyen
committed
Ignore duplicate Xcode installations when running bazel builds.
1 parent 0670799 commit 37c2881

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

bazel.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ invoke_bazel() {
109109

110110
if [ -n "$KOKORO_BUILD_NUMBER" ]; then
111111
# Runs our tests on every available Xcode installation.
112+
BUILDS_TMP_PATH=$(mktemp -d)
113+
SEEN_XCODES_FILE_PATH="$BUILDS_TMP_PATH/seen_xcodes"
112114
ls /Applications/ | grep "Xcode" | while read -r xcode_path; do
113115
xcode_version=$(cat /Applications/$xcode_path/Contents/version.plist \
114116
| grep "CFBundleShortVersionString" -A1 \
@@ -121,6 +123,13 @@ if [ -n "$KOKORO_BUILD_NUMBER" ]; then
121123
if [ "$xcode_version_as_number" -lt "$MIN_XCODE_VERSION" ]; then
122124
continue
123125
fi
126+
127+
# Ignore duplicate Xcode installations
128+
if grep -xq "$xcode_version_as_number" "$SEEN_XCODES_FILE_PATH"; then
129+
continue
130+
fi
131+
132+
echo "$xcode_version_as_number" > "$SEEN_XCODES_FILE_PATH"
124133
fi
125134

126135
if [ "$ACTION" == "test" ]; then

0 commit comments

Comments
 (0)