forked from tidev/titanium-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·82 lines (63 loc) · 2.18 KB
/
build.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
#!/usr/bin/env bash
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#
# DO NOT RUN THIS LOCALLY!
#
# THIS SHELL SCRIPT IS INTENDED FOR JENKINS CI BUILDS.
# IT MAKES LOTS OF ASSUMPTIONS ABOUT YOUR SYSTEM AND BUILDS ALL PLATFORMS
# FOR ALL OSES. IT ALSO ATTEMPTS TO UPLOAD THE BUILT ZIPS UP TO S3
#
# IF YOU'D LIKE TO BUILD TITANIUM LIKE YOU DID WITH SCONS BEFORE, PLEASE
# SEE THE BUILDING SECTION IN README.MD
#
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if [ "$1" != "" ]; then
BRANCH=$1
else
BRANCH="master"
fi
# !! THIS ASSUMES THAT JENKINS HAS COPIED OVER THE WINDOWS SDK PORTION INTO
# 'windows' directory AS CHILD OF ROOT !!
echo '*********** Building ***********'
date
export JAVA_HOME=/usr/lib/jvm/java-6-sun
#npm test
# Get the version from package.json!
VERSION=`sed -n 's/^ *"version": *"//p' package.json | tr -d '"' | tr -d ','`
echo 'VERSION: ' $VERSION
TIMESTAMP=`date +'%Y%m%d%H%M%S'`
echo 'TIMESTAMP: ' $TIMESTAMP
VTAG=$VERSION.v$TIMESTAMP
echo 'VTAG: ' $VTAG
BASENAME=dist/mobilesdk-$VTAG
echo 'BASENAME: ' $BASENAME
echo 'PATH: ' $PATH
export ANDROID_NDK=$JENKINS_HOME/android-ndk-r11c
echo 'NODE_APPC_BRANCH: latest stable from npm'
cd build
npm install .
node scons.js build
node scons.js package --version-tag $VTAG --all
cd ..
if [ "$PYTHON" = "" ]; then
PYTHON=python
fi
echo
echo 'BUILD_URL: ' $BUILD_URL
echo
SDK_ARCHIVE="$BASENAME-osx.zip"
echo 'SDK_ARCHIVE: ' $SDK_ARCHIVE
echo
echo Latest changes:
echo $CHANGES_SINCE_LAST_SUCCESS
echo
# $PYTHON $TITANIUM_BUILD/common/s3_cleaner.py mobile $BRANCH
$PYTHON $TITANIUM_BUILD/common/s3_uploader.py mobile $BASENAME-osx.zip $BRANCH $GIT_COMMIT $BUILD_URL
$PYTHON $TITANIUM_BUILD/common/s3_uploader.py mobile $BASENAME-linux.zip $BRANCH $GIT_COMMIT $BUILD_URL
$PYTHON $TITANIUM_BUILD/common/s3_uploader.py mobile $BASENAME-win32.zip $BRANCH $GIT_COMMIT $BUILD_URL
if [ -e "dist/parity.html" ]; then
mv dist/parity.html $BASENAME-parity.html
$PYTHON $TITANIUM_BUILD/common/s3_uploader.py mobile $BASENAME-parity.html $BRANCH $GIT_COMMIT $BUILD_URL
fi
date
echo '*****************************************'