aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-08-31 13:16:18 +0200
committerLiang Qi <liang.qi@qt.io>2018-09-04 08:29:08 +0000
commitb5a989133a7fe5272e109b5a1a5da4441a279f85 (patch)
tree1131eb048d485dbaeed1181c3817e0e0c0495dc7
parent61ce2045bee5df55c49584a94c7c451482b26c67 (diff)
Version Xcode application bundle when provisioning macOS images
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 <jedrzej.nowacki@qt.io> Change-Id: I0bd877bd344cebdd1fbf3a3035b00069f75c4c96 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rwxr-xr-xcoin/provisioning/common/macos/install_xcode.sh8
1 files changed, 8 insertions, 0 deletions
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