From b5a989133a7fe5272e109b5a1a5da4441a279f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 31 Aug 2018 13:16:18 +0200 Subject: Version Xcode application bundle when provisioning macOS images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By versioning the Xcode installation we open up for having multiple Xcode versions installed on the same image in the future, which allows for e.g. choosing the Xcode version in the build config. By running xcode-select to choose the bundle, we ensure that build steps that do not know that Xcode has been versioned will still pick up the right compiler and SDK paths when e.g. running xcrun -find clang. Done-with: Jędrzej Nowacki Change-Id: I0bd877bd344cebdd1fbf3a3035b00069f75c4c96 Reviewed-by: Jędrzej Nowacki Reviewed-by: Simon Hausmann --- coin/provisioning/common/macos/install_xcode.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/coin/provisioning/common/macos/install_xcode.sh b/coin/provisioning/common/macos/install_xcode.sh index 5fcf26a0..5eddb72f 100755 --- a/coin/provisioning/common/macos/install_xcode.sh +++ b/coin/provisioning/common/macos/install_xcode.sh @@ -55,6 +55,14 @@ function InstallXCode() { xzcat < "$sourceFile" | (cd /Applications/ && sudo cpio -dmi) fi + echo "Versioning application bundle" + majorVersion=$(echo $version | cut -d '.' -f 1) + versionedAppBundle="/Applications/Xcode${majorVersion}.app" + sudo mv /Applications/Xcode.app ${versionedAppBundle} + + echo "Selecting Xcode" + sudo xcode-select --switch ${versionedAppBundle} + echo "Accept license" sudo xcodebuild -license accept -- cgit v1.2.3