-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathbuilder.sh
More file actions
executable file
·44 lines (37 loc) · 1.49 KB
/
builder.sh
File metadata and controls
executable file
·44 lines (37 loc) · 1.49 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
#!/usr/bin/env bash
if [ "$RUN_STATIC_CODE_ANALYSIS" = true ]; then
echo "Running Static Code Analysis"
./gradlew staticCodeAnalysis
fi
if [ "$RUN_APP_UNIT_TESTS" = true ] ; then
echo "Running App Unit Tests"
./gradlew runUnitTests
fi
if [ "$RUN_APP_ACCEPTANCE_TESTS" = true ] ; then
echo "Running Acceptance Tests"
./gradlew runAcceptanceTests
fi
buildOption=''
if [ "$BUILD_WITH_STACKTRACE" = true ] ; then
buildOption="--stacktrace "
echo "Stacktrace option enabled"
fi
if [ "$CLEAN_PROJECT_BEFORE_BUILD" = true ] ; then
echo "Cleaning the Project"
./gradlew clean
else
echo "Cleaning the project will be skipped"
fi
if [ "$BUILD_CLIENT" = true ] ; then
echo "Compiling the client with Flavor:${CUSTOM_FLAVOR} and BuildType:${BUILD_TYPE}"
./gradlew ${buildOption}assemble${FLAVOR_TYPE}${BUILD_TYPE} -PisFDroidRelease=true
else
echo "Building the client will be skipped"
fi
if [ "$SIGN_APK" = true ] ; then
echo "Signing APK with given details"
clientVersion=$(sed -ne "s/.*ANDROID_CLIENT_MAJOR_VERSION = \"\([^']*\)\"/\1/p" buildSrc/src/main/kotlin/Dependencies.kt)
/home/android-agent/android-sdk/build-tools/35.0.0/apksigner sign --ks ${HOME}/wire-android/${KEYSTORE_PATH} --ks-key-alias ${KEYSTORE_KEY_NAME} --ks-pass pass:${KSTOREPWD} --key-pass pass:${KEYPWD} "${HOME}/wire-android/app/build/outputs/apk/wire-${CUSTOM_FLAVOR,,}-${BUILD_TYPE,,}-${clientVersion}${PATCH_VERSION}.apk"
else
echo "Apk will not be signed by the builder script"
fi