-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-client-titanium.sh
executable file
·91 lines (63 loc) · 2.37 KB
/
build-client-titanium.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/sh
######################### INIT PROCESS ##############################
BUILD=./build/client-titanium
DIST=./dist/client-titanium
TIPACK_TOKEN="tipack|[email protected]|0pensh0veFTW!"
DEV_PROD="dev"
TIPACK_PROJECT=""
TIPACK_VERSION=""
function usage
{
echo "usage: $0 [-d|-b|-p]"
}
function pause(){
read -p "$*"
}
DEV_PROD="dev"
TIPACK_PROJECT="org.battlehack.lineapp.client-1"
TIPACK_VERSION="1.0.0"
echo ""
echo "Uploading to: $TIPACK_PROJECT version: $TIPACK_VERSION"
if [ "$DEV_PROD" == "prod" ]; then
pause "Press [Enter] to start uploading process."
fi
echo ""
######################### BUILD PROCESS ##############################
\rm -rf $BUILD
mkdir $BUILD
\rm -rf $DIST
mkdir $DIST
cat ./src/bootstrap-titanium.js >> $BUILD/app.js
egrep -v "^include" ./lib/tipack4js -d recurse -h --include "*.js" --exclude "AppWrapper.js" >> $BUILD/app.js
egrep -v "^include" ./lib/underscore -d recurse -h --include "*.js" >> $BUILD/app.js
egrep -v "^include" ./lib/http -d recurse -h --include "*.js" >> $BUILD/app.js
egrep -v "^include" ./lib/xml -d recurse -h --include "*.js" >> $BUILD/app.js
egrep -v "^include" ./src/client-titanium -d recurse -h --include "*.js" --exclude "app.js" >> $BUILD/app.js
egrep -v "^include" ./src/client-titanium -d recurse -h --include "app.js">> $BUILD/app.js
if [ "$DEV_PROD" == "dev" ]; then
echo "Dev: Copying app.js"
cp $BUILD/app.js $DIST/app.js
\
else
echo "Prod: Running closure"
java -jar -Xmx1024m ./utils/closure/compiler.jar --jscomp_off internetExplorerChecks --js $BUILD/app.js --js_output_file $DIST/app.js
fi
cp ./src/client-titanium/*.png $DIST/ 2>/dev/null
cp ./src/client-titanium/*.html $DIST/ 2>/dev/null
######################### DEPLOY PROCESS ##############################
chmod a+rw $DIST/*
cd ./utils/tipack-1.0.0/
_CLASSPATH=""
if [ "$(uname)" == "Darwin" ]; then
# Do something under Mac OS X platform
_CLASSPATH=$(echo *.jar | tr ' ' ':')
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
# Do something under Linux platform
echo "No classpath defined for linux!"
elif [ "$(expr substr $(uname -s) 1 9)" == "CYGWIN_NT" ]; then
# Do something under Windows NT platform
_CLASSPATH="*;./*"
fi
echo "Classpath is: $_CLASSPATH"
java -Xmx1024m -cp $_CLASSPATH com.openrest.tipack.v1_0.Uploader $TIPACK_TOKEN $TIPACK_PROJECT $TIPACK_VERSION ../.$DIST
cd ../..