-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathdeployTarget.sh
executable file
·61 lines (53 loc) · 1.3 KB
/
deployTarget.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# some variables have to be given like:
# $SRCROOT, $BUILD_DIR, $CONFIGURATION in this order
SRCROOT=`pwd`;
BUILD_DIR="build";
CONFIG="Release";
TARGET="Eloquent";
# check these values
if [ $SRCROOT = "" ]; then
echo "Have no SRCROOT!";
exit 1;
fi
if [ $BUILD_DIR = "" ]; then
echo "Have no BUILD_DIR!";
exit 1;
fi
if [ $CONFIG = "" ]; then
echo "Have no CONFIGURATION!";
exit 1;
fi
if [ $TARGET = "" ]; then
echo "Have no TARGET!";
exit 1;
fi
# increment "buildnumber" and write it to Info.plist
./increment_buildnumber.rb
./write_buildnumber.rb
xcodebuild clean
# build Deployment version
xcodebuild -target "$TARGET" -configuration "$CONFIG" build
#echo "rc = $RC";
#if [ $RC != 0 ]; then
# echo "build did not succeed!";
# exit 1;
#fi
# generate deploy archive
BUNDLEVERSION=`$SRCROOT/get_bundle_version.rb`;
DESTPATH="$SRCROOT/../deploy/$TARGET-""$BUNDLEVERSION";
mkdir "$DESTPATH";
# copy app
cp -r "$BUILD_DIR/$CONFIG/$TARGET.app" "$DESTPATH/";
# copy stuff from docs dir
cp -r "$SRCROOT/../docs-ms20" "$DESTPATH/docs";
DMGARCHIVE="$TARGET-${BUNDLEVERSION}.dmg";
ZIPARCHIVE="$DMGARCHIVE.zip";
# create disk image
echo "Destpath: $DESTPATH";
hdiutil create -srcfolder "$DESTPATH" "$SRCROOT/../deploy/$DMGARCHIVE";
sleep 2;
# zip it
cd "$SRCROOT/../deploy/";
zip "$ZIPARCHIVE" "$DMGARCHIVE";
exit 0