-
Notifications
You must be signed in to change notification settings - Fork 239
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·71 lines (58 loc) · 1.83 KB
/
build.sh
File metadata and controls
executable file
·71 lines (58 loc) · 1.83 KB
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
### Bash script for building Talkback-for-Partners Android apk
###
### The following environment variables must be set before executing this script
### ANDROID_SDK # path to local copy of Android SDK
# For help in getting the correct version numbers of gradle, the gradle plugin,
# and Java, see the following:
# https://developer.android.com/build/releases/gradle-plugin#updating-gradle
# https://docs.gradle.org/current/userguide/compatibility.html
START_TIME=$SECONDS
echo "pwd: $(pwd)"
echo "ls"; ls
# Use these environment variables to get more info during the build
# GRADLE_DEBUG=--debug
# GRADLE_STACKTRACE=--stacktrace
echo "#### GRADLE_DEBUG: $GRADLE_DEBUG"
echo "#### GRADLE_STACKTRACE: $GRADLE_STACKTRACE"
if [[ -z "$ANDROID_SDK" ]]; then
echo "#### The environment variable ANDROID_SDK is not set"
exit 1
else
echo "#### ANDROID_SDK: $ANDROID_SDK"
fi
echo
echo "#### Write local.properties file"
echo "sdk.dir=${ANDROID_SDK}" > local.properties
echo "#### Content of local.properties"; cat local.properties
echo
if ! java -version; then
echo "#### java command not found in PATH"
exit 1
fi
if ! gradle -version; then
echo "#### gradle command not found in PATH"
exit 1
fi
if [[ "$GRADLE_DEBUG" = "--debug" ]]; then
echo "#### gradle buildEnvironment"
gradle buildEnvironment
echo
echo "#### gradle dependencies"
gradle dependencies
echo
echo "#### gradle properties"
gradle properties
echo
fi
echo "#### gradle $GRADLE_DEBUG $GRADLE_STACKTRACE assembleDebug"
gradle ${GRADLE_DEBUG} ${GRADLE_STACKTRACE} assembleDebug
BUILD_EXIT_CODE=$?
echo
if [[ $BUILD_EXIT_CODE -eq 0 ]]; then
echo "#### find . -name *.apk"
find . -name "*.apk"
echo
fi
DURATION=$(( SECONDS - START_TIME ))
echo "#### Build took this many seconds: $DURATION"
exit $BUILD_EXIT_CODE ### This should be the last line in this file