Statistics
| Branch: | Tag: | Revision:

orfox / jenkins-build @ e3d01857

History | View | Annotate | Download (1.66 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
set -e
13
set -x
14

    
15
if [ -z $WORKSPACE ]; then
16
    WORKSPACE=`pwd`
17
fi
18

    
19
if [ -z $ANDROID_HOME ]; then
20
    if [ -e ~/.android/bashrc ]; then
21
        . ~/.android/bashrc
22
    else
23
        echo "ANDROID_HOME must be set!"
24
        exit
25
    fi
26
fi
27

    
28
if [ -z $ANDROID_NDK_HOME ]; then
29
    if which ndk-build 2>&1 /dev/null; then
30
        ANDROID_NDK_HOME=`which ndk-build |  sed 's,/ndk-build,,'`
31
    else
32
        echo "ANDROID_NDK_HOME not set and 'ndk-build' not in PATH"
33
        exit
34
    fi
35
fi
36
# reset version code/name to current date
37
versionCodeDate=`date +%s`
38
versionNameDate=`date +%Y-%m-%d_%H.%M.%S`
39

    
40
sed -i \
41
    -e "s,android:versionCode=\"[0-9][0-9]*\",android:versionCode=\"$versionCodeDate\"," \
42
    -e "s,android:versionName=\"\([^\"][^\"]*\)\",android:versionName=\"\1.$versionNameDate\"," \
43
    AndroidManifest.xml
44

    
45
#use ndk-r8e
46
export NDK_BASE=$NDK_BASE"-r8e"
47

    
48
#set the mozconfig to be used
49
cd $WORKSPACE
50
export MOZCONFIG="$WORKSPACE/external/tor-browser/.mozconfig-android"
51

    
52
#switch to gecko dev and build
53
cd external/tor-browser
54
./mach configure
55
./mach build
56
./mach package
57
./mach build-backend -b AndroidEclipse
58

    
59
#------------------------------------------------------------------------------#
60
# run local tests
61
cd $WORKSPACE/tests
62
./run-tests.sh
63

    
64
# only tell jenkins there was an error if we got ERROR or FATAL
65
[ $(($? & 1)) = "1" ] && exit 1
66
[ $(($? & 2)) = "2" ] && exit 2
67
set -e