aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/bundle/update-specs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'share/qbs/modules/bundle/update-specs.sh')
-rwxr-xr-xshare/qbs/modules/bundle/update-specs.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/share/qbs/modules/bundle/update-specs.sh b/share/qbs/modules/bundle/update-specs.sh
new file mode 100755
index 000000000..869fb011f
--- /dev/null
+++ b/share/qbs/modules/bundle/update-specs.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Update build specs from Xcode - this script should be run when new Xcode releases are made.
+specs_dir="$(xcrun --sdk macosx --show-sdk-platform-path)/Developer/Library/Xcode/Specifications"
+spec_files=("MacOSX Package Types.xcspec" "MacOSX Product Types.xcspec")
+for spec_file in "${spec_files[@]}" ; do
+ printf "%s\n" "$(plutil -convert json -r -o - "$specs_dir/$spec_file")" > "${spec_file// /-}"
+done
+xcode_version="$(/usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' \
+ "$(xcode-select --print-path)/../Info.plist")"
+echo "Updated build specs from Xcode $xcode_version"