forked from firebase/quickstart-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·48 lines (43 loc) · 1.88 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Exit on error
set -e
# Work off travis
if [[ ! -z 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
# Copy mock google-services file
echo "Using mock google-services.json"
cp mock-google-services.json admob/app/google-services.json
cp mock-google-services.json analytics/app/google-services.json
cp mock-google-services.json app-indexing/app/google-services.json
cp mock-google-services.json auth/app/google-services.json
cp mock-google-services.json config/app/google-services.json
cp mock-google-services.json crash/app/google-services.json
cp mock-google-services.json database/app/google-services.json
cp mock-google-services.json dynamiclinks/app/google-services.json
cp mock-google-services.json firestore/app/google-services.json
cp mock-google-services.json functions/app/google-services.json
cp mock-google-services.json inappmessaging/app/google-services.json
cp mock-google-services.json perf/app/google-services.json
cp mock-google-services.json messaging/app/google-services.json
cp mock-google-services.json mlkit/app/google-services.json
cp mock-google-services.json mlkit-langid/app/google-services.json
cp mock-google-services.json mlkit-smartreply/app/google-services.json
cp mock-google-services.json mlkit-translate/app/google-services.json
cp mock-google-services.json storage/app/google-services.json
# Install preview deps
${ANDROID_HOME}/tools/bin/sdkmanager --channel=3 \
"tools" "platform-tools" "build-tools;26.0.0-rc2" "platforms;android-26"
# Build
if [ $TRAVIS_PULL_REQUEST = false ] ; then
echo "Building full project"
# For a merged commit, build all configurations.
./gradlew clean ktlint build
else
# On a pull request, just build debug which is much faster and catches
# obvious errors.
./gradlew clean ktlint assembleDebug check
fi