-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcreate_bundle.ios
70 lines (60 loc) · 1.61 KB
/
create_bundle.ios
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
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
(($# < 1)) && echo "Missing parameters" && exit 1
TARGET=$1
APP_NAME=${2:-$TARGET}
TARGET_APP="$APP_NAME".app
CONFIG=${3:-Release}
VERSION=${4:-0.1}
DEST="build/${APP_NAME}/${CONFIG}/iOS/${TARGET_APP}"
mkdir -p "${DEST}"
INFO=
RFMT=
ICON=
#SETTINGS_BUNDLE=
#ITUNESARTWORK=
if [[ -f "sources/ios/Info.plist" ]]
then
INFO="sources/ios/Info.plist"
cp "$INFO" "${DEST}/"
else
INFO="${DEST}/Info.plist"
cp templates/ios/Info.plist.ios.tmpl "$INFO"
sed -i "s,%TARGET%,${TARGET},g" "$INFO"
sed -i "s,%APP_NAME%,${APP_NAME},g" "$INFO"
sed -i "s,%VERSION%,${VERSION},g" "$INFO"
fi
# any NIB
#if [[ -f "sources/RecentFilesMenuTemplate.nib" ]]
#then
# RFMT="sources/RecentFilesMenuTemplate.nib"
# cp "$RFMT" "${DEST}/Contents/Resources/"
#else
# RFMT="${DEST}/Contents/Resources/RecentFilesMenuTemplate.nib"
# cp "templates/RecentFilesMenuTemplate.nib" "$RFMT"
#fi
ICON="$DEST"/"${APP_NAME}".png
if [[ -f "sources/ios/Icon.png" ]]
then
cp "sources/ios/Icon.png" "$ICON"
bash ./templates/ios/convert_icon_to_ios.sh "sources/ios/Icon.png" "$DEST"
else
ICON="${DEST}/Icon.png"
cp "templates/ios/Icons/"* "$DEST"/
fi
DEFAULT_ICON="$DEST"/Default.png
if [[ -f "sources/ios/Default.png" ]]
then
cp "sources/ios/Default.png" "$DEFAULT_ICON"
else
cp "templates/ios/Default.png" "$DEFAULT_ICON"
fi
if [[ -f "sources/ios/README" ]]
then
cp "sources/ios/README" "$DEST"/
else
cp "templates/README.tmpl" "$DEST"/README
sed -i "s,%APP_NAME%,${APP_NAME},g" "$DEST"/README
fi
## optional ? not used ? required ?
echo 'APPL????' > "${DEST}/PkgInfo"
cp "$TARGET" "${DEST}/"