orfox / make-release-build @ master
History | View | Annotate | Download (2.88 KB)
1 | 0d8bf471 | Hans-Christoph Steiner | #!/bin/bash |
---|---|---|---|
2 | # bash is required because we need bash's printf to guarantee a cross-platform |
||
3 | # timestamp format. |
||
4 | |||
5 | if [ `dirname $0` != "." ]; then |
||
6 | echo "only run this script like ./`basename $0`" |
||
7 | exit |
||
8 | fi |
||
9 | |||
10 | if [ -z $ANDROID_HOME ]; then |
||
11 | if [ -e ~/.android/bashrc ]; then |
||
12 | . ~/.android/bashrc |
||
13 | else |
||
14 | echo "ANDROID_HOME must be set!" |
||
15 | exit |
||
16 | fi |
||
17 | fi |
||
18 | |||
19 | if [ -z $ANDROID_NDK_HOME ]; then |
||
20 | if which ndk-build 2>&1 /dev/null; then |
||
21 | ANDROID_NDK_HOME=`which ndk-build | sed 's,/ndk-build,,'` |
||
22 | else |
||
23 | echo "ANDROID_NDK_HOME not set and 'ndk-build' not in PATH" |
||
24 | exit |
||
25 | fi |
||
26 | fi |
||
27 | |||
28 | c14a98f0 | Nathan Freitas | export NDK_BASE=${ANDROID_NDK_HOME} |
29 | a5535623 | Nathan Freitas | export SDK_BASE=${ANDROID_SDK_HOME} |
30 | 0d8bf471 | Hans-Christoph Steiner | |
31 | set -e |
||
32 | set -x |
||
33 | |||
34 | # standardize timezone to reduce build differences |
||
35 | export TZ=UTC |
||
36 | # run the clock at 5% speed, ant requires a moving clock |
||
37 | TIMESTAMP=`printf '@%(%Y-%m-%d %H:%M:%S)T x0.05' \ |
||
38 | $(git log -n1 --format=format:%at)` |
||
39 | |||
40 | git reset --hard |
||
41 | git clean -fdx |
||
42 | git submodule foreach --recursive git reset --hard |
||
43 | git submodule foreach --recursive git clean -fdx |
||
44 | git submodule sync --recursive |
||
45 | git submodule foreach --recursive git submodule sync |
||
46 | git submodule update --init --recursive |
||
47 | |||
48 | # set the mozconfig to be used |
||
49 | 846f7497 | Hans-Christoph Steiner | export MOZCONFIG=`pwd`"/external/tor-browser/.mozconfig-orfox-release" |
50 | ee09c2f2 | Hans-Christoph Steiner | cp .mozconfig-orfox-release $MOZCONFIG |
51 | cat external/tor-browser/.mozconfig-orfox >> $MOZCONFIG |
||
52 | 0d8bf471 | Hans-Christoph Steiner | |
53 | 843db66d | Nathan Freitas | # Need to add in add-ons before the package step |
54 | 422f184a | n8fr8 | cp -r external/orfox-addons/*.xpi external/tor-browser/mobile/android/orfox/distribution/assets/distribution/extensions/ |
55 | 843db66d | Nathan Freitas | |
56 | 0d8bf471 | Hans-Christoph Steiner | # switch to gecko dev and build |
57 | cd external/tor-browser |
||
58 | ./mach configure |
||
59 | 5ba5a643 | Nathan Freitas | ./mach build |
60 | |||
61 | ba052675 | Hans-Christoph Steiner | # set the version, the official Mozilla so far has been too hard to figure out... |
62 | 1dd59645 | Nathan Freitas | |
63 | fcc3f9ee | n8fr8 | #52.2.0esr-7.0-1 STABLE! |
64 | 90139541 | n8fr8 | export versionName="Fennec-52.2.0esr/TorBrowser-7.0-1/Orfox-1.4.1-RC-1" |
65 | export versionCode="11" |
||
66 | ba052675 | Hans-Christoph Steiner | sed -i "s,versionName=\"[^\"]*\",versionName=\"$versionName\"," obj-tbb-arm-linux-androideabi/mobile/android/base/AndroidManifest.xml |
67 | sed -i "s,versionCode=\"[^\"]*\",versionCode=\"$versionCode\"," obj-tbb-arm-linux-androideabi/mobile/android/base/AndroidManifest.xml |
||
68 | |||
69 | 0d8bf471 | Hans-Christoph Steiner | ./mach package |
70 | ./mach build-backend -b AndroidEclipse |
||
71 | |||
72 | # make sure we're on a signed tag that matches the version name |
||
73 | describe=`git describe --always` |
||
74 | if [ $versionName != $describe ]; then |
||
75 | echo "WARNING: building $describe, which is not the latest release ($versionName)" |
||
76 | else |
||
77 | # make a clearer warning above by putting this here |
||
78 | set +x |
||
79 | echo "" |
||
80 | echo "" |
||
81 | echo "Checking git tag signature for release build:" |
||
82 | git tag -v $versionName |
||
83 | echo "" |
||
84 | echo "" |
||
85 | set -x |
||
86 | fi |
||
87 | |||
88 | 871fd9ed | n8fr8 | built=`ls -1 obj-tbb-*-linux-*/dist/fennec-*-unsigned-unaligned.apk` |
89 | 0d8bf471 | Hans-Christoph Steiner | apk="Orfox-$describe.apk" |
90 | cp $built $apk |
||
91 | |||
92 | if which gpg > /dev/null; then |
||
93 | if [ -z "`gpg --list-secret-keys`" ]; then |
||
94 | echo "No GPG secret keys found, not signing APK" |
||
95 | else |
||
96 | gpg --detach-sign $apk |
||
97 | fi |
||
98 | else |
||
99 | echo "gpg not found, not signing APK" |
||
100 | fi |