orfox / jenkins-build @ f02187c1
History | View | Annotate | Download (2.34 KB)
1 |
#!/bin/sh |
---|---|
2 |
# |
3 |
# this is the script run by the Jenkins server to run the build and tests. Be |
4 |
# sure to always run it in its dir, i.e. ./run-tests.sh, otherwise it might |
5 |
# remove things that you don't want it to. |
6 |
|
7 |
if [ `dirname $0` != "." ]; then |
8 |
echo "only run this script like ./`basename $0`" |
9 |
exit |
10 |
fi |
11 |
|
12 |
if [ -z $WORKSPACE ]; then |
13 |
WORKSPACE=`pwd` |
14 |
fi |
15 |
|
16 |
if [ -z $ANDROID_HOME ]; then |
17 |
if [ -e ~/.android/bashrc ]; then |
18 |
. ~/.android/bashrc |
19 |
else |
20 |
echo "ANDROID_HOME must be set!" |
21 |
exit |
22 |
fi |
23 |
fi |
24 |
|
25 |
if [ -z $ANDROID_NDK_HOME ]; then |
26 |
if which ndk-build 2>&1 /dev/null; then |
27 |
ANDROID_NDK_HOME=`which ndk-build | sed 's,/ndk-build,,'` |
28 |
else |
29 |
echo "ANDROID_NDK_HOME not set and 'ndk-build' not in PATH" |
30 |
exit |
31 |
fi |
32 |
fi |
33 |
|
34 |
export NDK_BASE=${ANDROID_NDK_HOME}-r8e |
35 |
if [ ! -e $NDK_BASE ]; then |
36 |
echo "Mozilla requires the use of Android NDK r8e only" |
37 |
echo "This script expects it at $NDK_BASE" |
38 |
exit 1 |
39 |
fi |
40 |
|
41 |
set -e |
42 |
set -x |
43 |
|
44 |
# standardize timezone to reduce build differences |
45 |
export TZ=UTC |
46 |
|
47 |
# set the mozconfig to be used |
48 |
cd $WORKSPACE |
49 |
export MOZCONFIG="$WORKSPACE/external/tor-browser/.mozconfig-orfox" |
50 |
|
51 |
# switch to gecko dev and build |
52 |
cd external/tor-browser |
53 |
./mach configure |
54 |
./mach build |
55 |
|
56 |
# Need to add in add-ons before the package step |
57 |
mkdir -p obj-tbb-arm-linux-androideabi/dist/bin/distribution/extensions/ |
58 |
cp -r $WORKSPACE/external/orfox-addons/* obj-tbb-arm-linux-androideabi/dist/bin/distribution/extensions/ |
59 |
|
60 |
|
61 |
# reset version code/name to current date |
62 |
versionCodeDate=`date '+%s'` |
63 |
versionNameDate=`date +%Y-%m-%d_%H.%M.%S` |
64 |
|
65 |
# THIS VERSIONING CAN BE USED FOR ALPHA, ANOTHER TYPE CAN BE USED FOR BETA AND RELEASE |
66 |
cat $WORKSPACE/external/tor-browser/obj-tbb-arm-linux-androideabi/mobile/android/base/AndroidManifest.xml | sed \ |
67 |
-e "s,android:versionCode=\"[0-9][0-9]*\",android:versionCode=\"$versionCodeDate\"," \ |
68 |
-e "s,android:versionName=\"\([^\"][^\"]*\)\",android:versionName=\"\1-esr-Orfox-0.0.1-$versionNameDate\"," \ |
69 |
> $WORKSPACE/external/tor-browser/tempManifest.xml |
70 |
mv $WORKSPACE/external/tor-browser/tempManifest.xml $WORKSPACE/external/tor-browser/obj-tbb-arm-linux-androideabi/mobile/android/base/AndroidManifest.xml |
71 |
|
72 |
|
73 |
./mach package |
74 |
./mach build-backend -b AndroidEclipse |
75 |
|
76 |
#------------------------------------------------------------------------------# |
77 |
# run local tests |
78 |
cd $WORKSPACE/tests |
79 |
./run-tests.sh |