summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
Diffstat (limited to 'android')
-rwxr-xr-xandroid/build.sh18
1 files changed, 15 insertions, 3 deletions
diff --git a/android/build.sh b/android/build.sh
index e8392f345d..e37fd3bf2f 100755
--- a/android/build.sh
+++ b/android/build.sh
@@ -30,11 +30,15 @@ while [ -n "${1:-""}" ]; do
shift 1
done
-if [[ "$GRADLE_BUILD_TYPE" == "release" ]]; then
+function assert_clean_working_directory {
if [[ -n "$(git status --porcelain)" ]]; then
- echo "Dirty working directory! Will not accept that for an official release."
- exit 1
+ echo "Dirty working directory! Will not accept that for an official release."
+ exit 1
fi
+}
+
+if [[ "$GRADLE_BUILD_TYPE" == "release" ]]; then
+ assert_clean_working_directory
if [ ! -f "$SCRIPT_DIR/credentials/keystore.properties" ]; then
echo "ERROR: No keystore.properties file found" >&2
@@ -80,6 +84,14 @@ if [[ "$BUILD_BUNDLE" == "yes" ]]; then
$GRADLE_CMD --console plain "${BUNDLE_TASKS[@]}"
fi
+# When building releases, we check that the working directory is clean before building,
+# further up. Now verify that this is still true. The build process should never make the
+# working directory dirty.
+# This could for example happen if lockfiles are outdated, and the build process updates them.
+if [[ "$GRADLE_BUILD_TYPE" == "release" ]]; then
+ assert_clean_working_directory
+fi
+
if [[ "$RUN_PLAY_PUBLISH_TASKS" == "yes" && "${#PLAY_PUBLISH_TASKS[@]}" -ne 0 ]]; then
$GRADLE_CMD --console plain "${PLAY_PUBLISH_TASKS[@]}"
fi