-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmakepackage.sh
More file actions
executable file
·56 lines (50 loc) · 1.96 KB
/
makepackage.sh
File metadata and controls
executable file
·56 lines (50 loc) · 1.96 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
#
# Script to make an installable package of the plugin.
#
# Uses xcodebuild, pkgbuild and productbuild.
#
recreate_dir() {
if test -d "$1"; then
sudo chmod -R u+w "$1"
sudo rm -rf "$1"
fi
mkdir -p "$1"/Root
}
# Create a clean install directory...
recreate_dir build/Package-qlwindowsapps
recreate_dir build/Package-WindowsAppsImporter
# Install into this directory...
xcodebuild -workspace "$PWD/QLWindowsApps.xcworkspace" \
-scheme QLWindowsApps \
-configuration Release \
install \
DSTROOT="$PWD/build/Package-qlwindowsapps/Root"
xcodebuild -workspace "$PWD/QLWindowsApps.xcworkspace" \
-scheme WindowsAppsImporter \
-configuration Release \
install \
DSTROOT="$PWD/build/Package-WindowsAppsImporter/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" "MicrosoftBinaries/Info.plist")
fi
# Make the package with pkgbuild and the product distribution with productbuild...
echo pkgbuild...
pkgbuild --identifier com.danielecattaneo.qlgenerator.qlwindowsapps \
--version "$ver" \
--root build/Package-qlwindowsapps/Root \
--scripts ./MicrosoftBinaries/PackageResources/Scripts \
"./QLWindowsApps.pkg"
pkgbuild --identifier com.danielecattaneo.WindowsAppsImporter \
--version "$ver" \
--root build/Package-WindowsAppsImporter/Root \
--scripts ./WindowsAppsImporter/PackageResources/Scripts \
"./WindowsAppsImporter.pkg"
productbuild --distribution ./PackageResources/Distribution.xml \
--resources ./PackageResources/Resources \
--package-path ./ \
"./QLWindowsApps-$ver.pkg"
rm ./QLWindowsApps.pkg
rm ./WindowsAppsImporter.pkg