Statistics
| Branch: | Tag: | Revision:

trustedintents / make-release-build @ 45bc8e17

History | View | Annotate | Download (1.03 KB)

1
#!/bin/bash
2
# bash is required because we need bash's printf to guarantee a cross-platform
3
# timestamp format.
4

    
5
set -e
6
set -x
7

    
8
if [ -z $ANDROID_HOME ]; then
9
    if [ -e ~/.android/bashrc ]; then
10
        . ~/.android/bashrc
11
    else
12
        echo "ANDROID_HOME must be set!"
13
        exit
14
    fi
15
fi
16

    
17
# standardize timezone to reduce build differences
18
export TZ=UTC
19

    
20
git reset --hard
21
git clean -fdx
22

    
23
cd trustedintents
24
./setup-ant
25

    
26
ant release-all
27

    
28
jarname=trustedintents-$(git describe)
29
rm -f ${jarname}*.asc
30

    
31
# standardize timestamps in ZIP headers
32
if which strip-nondeterminism > /dev/null; then
33
    for f in ${jarname}*.jar; do
34
	strip-nondeterminism -t jar -T $(git log -n1 --format=format:%at) $f
35
    done
36
fi
37

    
38
for f in ${jarname}*.jar; do
39
    sha256sum $f
40
done
41

    
42
if which gpg > /dev/null; then
43
    if [ -z "`gpg --list-secret-keys`" ]; then
44
        echo "No GPG secret keys found, not signing APK"
45
    else
46
        for f in ${jarname}*.*; do
47
            gpg --armor --detach-sign $f
48
        done
49
    fi
50
else
51
    echo "gpg not found, not signing APK"
52
fi