-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakepackage.sh
executable file
·40 lines (36 loc) · 1.35 KB
/
makepackage.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
#
# Script to make an installable package of the plugin.
#
# Uses xcodebuild, pkgbuild and productbuild.
#
# Create a clean install directory...
if test -d build/Package; then
sudo chmod -R u+w build/Package
sudo rm -rf build/Package
fi
mkdir -p build/Package/Root
mkdir -p build/Package/Resources
# Install into this directory...
xcodebuild -project "$PWD/ChiptuneImporter.xcodeproj" \
-target ChiptuneImporter \
-configuration Release \
install \
DSTROOT="$PWD/build/Package/Root"
# Extract the version number from the project...
ver=$(git describe | sed 's/release_//')
if [[ ! ( $? -eq 0 ) ]]; then
ver=$(/usr/libexec/PlistBuddy -c "Print:CFBundleShortVersionString" "ChiptuneImporter/ChiptuneImporter-Info.plist");
fi
# Make the package with pkgbuild and the product distribution with productbuild...
echo pkgbuild...
pkgbuild --identifier com.danielecattaneo.chiptuneimporter \
--version "$ver" \
--root build/Package/Root \
--scripts ./PackageResources/Scripts \
"./ChiptuneImporter.pkg"
productbuild --distribution ./PackageResources/Distribution.xml \
--resources ./PackageResources/Resources \
--package-path ./ \
"./ChiptuneImporter-$ver.pkg"
rm ./ChiptuneImporter.pkg