forked from alexstyl/Memento-Calendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·34 lines (26 loc) · 906 Bytes
/
build.sh
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
#!/bin/bash
# Exit on error
set -e
# Limit memory usage
OPTS='-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'
# Copy mock secret.gradle file if necessary
if [ ! -f secret.gradle ]; then
echo "Secret.gradle not found. Using sample"
cp secret.gradle.sample secret.gradle
fi
# Work off travis
if [[ -v TRAVIS_PULL_REQUEST ]]; then
echo "TRAVIS_PULL_REQUEST: $TRAVIS_PULL_REQUEST"
else
echo "TRAVIS_PULL_REQUEST: unset, setting to false"
TRAVIS_PULL_REQUEST=false
fi
# Build
if [ $TRAVIS_PULL_REQUEST = false ] ; then
# For a merged commit, build all configurations.
GRADLE_OPTS=$OPTS ./gradlew clean build
else
# On a pull request, just build debug which is much faster and catches
# obvious errors.
GRADLE_OPTS=$OPTS ./gradlew clean :mobile:assembleDebug
fi