Skip to content

Commit 2d02929

Browse files
samtsternkroikie
authored andcommitted
Travis CI Builds (firebase#21)
* TravisCI Build Configuration * Standardize build tools version * Add travis script * Make all samples not abort on lint and proguard their release builds * Add travis build status image * Fast builds for pull requests, fail on error
1 parent 6bfa61a commit 2d02929

File tree

15 files changed

+746
-17
lines changed

15 files changed

+746
-17
lines changed

.travis.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
language: android
2+
android:
3+
components:
4+
- platform-tools
5+
- tools
6+
- build-tools-23.0.3
7+
- android-23
8+
- extra-google-google_play_services
9+
- extra-google-m2repository
10+
- extra-android-m2repository
11+
- extra-android-support
12+
- addon-google_apis-google-23
13+
licenses:
14+
- 'android-sdk-preview-license-52d11cd2'
15+
- 'android-sdk-license-.+'
16+
- 'google-gdk-license-.+'
17+
script:
18+
- ./build.sh

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Firebase Quickstarts for Android
22

3+
[![Build Status](https://travis-ci.org/firebase/quickstart-android.svg?branch=master)](https://travis-ci.org/firebase/quickstart-android)
4+
35
A collection of quickstart samples demonstrating the Firebase APIs on Android. For more information, see https://firebase.google.com.
46

57
## How to make contributions?
68
Please read and follow the steps in the [CONTRIBUTING.md](CONTRIBUTING.md)
79

810
## License
9-
See [LICENSE](LICENSE)
11+
See [LICENSE](LICENSE)

admob/app/build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,18 @@ android {
1313

1414
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1515
}
16+
1617
buildTypes {
1718
release {
18-
minifyEnabled false
19+
minifyEnabled true
1920
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2021
}
2122
}
23+
24+
lintOptions {
25+
abortOnError false
26+
}
27+
2228
packagingOptions {
2329
exclude 'LICENSE.txt'
2430
}

analytics/app/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
22

33
android {
44
compileSdkVersion 23
5-
buildToolsVersion "23.0.2"
5+
buildToolsVersion "23.0.3"
66

77
defaultConfig {
88
applicationId "com.google.firebase.quickstart.analytics"
@@ -11,6 +11,11 @@ android {
1111
versionCode 1
1212
versionName "1.0"
1313
}
14+
15+
lintOptions {
16+
abortOnError false
17+
}
18+
1419
buildTypes {
1520
release {
1621
minifyEnabled true

app-indexing/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
22

33
android {
44
compileSdkVersion 23
5-
buildToolsVersion "23.0.2"
5+
buildToolsVersion "23.0.3"
66

77
defaultConfig {
88
applicationId "com.google.samples.quickstart.app_indexing"

auth/app/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
22

33
android {
44
compileSdkVersion 23
5-
buildToolsVersion "23.0.2"
5+
buildToolsVersion "23.0.3"
66

77
defaultConfig {
88
applicationId "com.google.firebase.quickstart.auth"
@@ -19,6 +19,10 @@ android {
1919
}
2020
}
2121

22+
lintOptions {
23+
abortOnError false
24+
}
25+
2226
productFlavors {
2327

2428
// Build variant to include the Facebook Android SDk

build.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
# Exit on error
4+
set -e
5+
6+
# List of all samples
7+
samples=( admob analytics app-indexing auth config crash database dynamiclinks invites messaging storage )
8+
9+
for sample in "${samples[@]}"
10+
do
11+
echo "Building ${sample}"
12+
13+
if [ $TRAVIS_PULL_REQUEST = false ] ; then
14+
# For a merged commit, build all configurations.
15+
cd $sample && \
16+
cp ../mock-google-services.json ./app/google-services.json && \
17+
./gradlew clean build
18+
19+
# Back to parent directory.
20+
cd -
21+
else
22+
# On a pull request, just build debug which is much faster and catches
23+
# obvious errors.
24+
cd $sample && \
25+
cp ../mock-google-services.json ./app/google-services.json && \
26+
./gradlew clean :app:assembleDebug
27+
28+
# Back to parent directory.
29+
cd -
30+
fi
31+
done

config/app/build.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
22

33
android {
44
compileSdkVersion 23
5-
buildToolsVersion "23.0.2"
5+
buildToolsVersion "23.0.3"
66

77
defaultConfig {
88
applicationId "com.google.samples.quickstart.config"
@@ -11,9 +11,14 @@ android {
1111
versionCode 1
1212
versionName "1.0"
1313
}
14+
15+
lintOptions {
16+
abortOnError false
17+
}
18+
1419
buildTypes {
1520
release {
16-
minifyEnabled false
21+
minifyEnabled true
1722
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
1823
}
1924
}

crash/app/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
22

33
android {
44
compileSdkVersion 23
5-
buildToolsVersion "23.0.2"
5+
buildToolsVersion "23.0.3"
66

77
defaultConfig {
88
applicationId "com.google.samples.quickstart.crash"
@@ -11,6 +11,11 @@ android {
1111
versionCode 1
1212
versionName "1.0"
1313
}
14+
15+
lintOptions {
16+
abortOnError false
17+
}
18+
1419
buildTypes {
1520
release {
1621
minifyEnabled true

database/app/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
22

33
android {
44
compileSdkVersion 23
5-
buildToolsVersion "23.0.2"
5+
buildToolsVersion "23.0.3"
66

77
defaultConfig {
88
applicationId "com.google.firebase.quickstart.database"
@@ -11,6 +11,11 @@ android {
1111
versionCode 1
1212
versionName "1.0"
1313
}
14+
15+
lintOptions {
16+
abortOnError false
17+
}
18+
1419
buildTypes {
1520
release {
1621
minifyEnabled true

dynamiclinks/app/build.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
22

33
android {
44
compileSdkVersion 23
5-
buildToolsVersion "23.0.2"
5+
buildToolsVersion "23.0.3"
66

77
defaultConfig {
88
applicationId "com.google.firebase.quickstart.deeplinks"
@@ -11,9 +11,14 @@ android {
1111
versionCode 1
1212
versionName "1.0"
1313
}
14+
15+
lintOptions {
16+
abortOnError false
17+
}
18+
1419
buildTypes {
1520
release {
16-
minifyEnabled false
21+
minifyEnabled true
1722
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
1823
}
1924
}

invites/app/build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
22

33
android {
44
compileSdkVersion 23
5-
buildToolsVersion "23.0.2"
5+
buildToolsVersion "23.0.3"
66

77
defaultConfig {
88
applicationId "com.google.firebase.quickstart.invites"
@@ -16,11 +16,15 @@ android {
1616

1717
buildTypes {
1818
release {
19-
minifyEnabled false
19+
minifyEnabled true
2020
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2121
}
2222
}
2323

24+
lintOptions {
25+
abortOnError false
26+
}
27+
2428
packagingOptions {
2529
exclude 'LICENSE.txt'
2630
}

messaging/app/build.gradle

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
22

33
android {
44
compileSdkVersion 23
5-
buildToolsVersion "23.0.2"
5+
buildToolsVersion "23.0.3"
66

77
defaultConfig {
88
applicationId "com.google.firebase.quickstart.fcm"
@@ -13,12 +13,18 @@ android {
1313

1414
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1515
}
16+
1617
buildTypes {
1718
release {
18-
minifyEnabled false
19+
minifyEnabled true
1920
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2021
}
2122
}
23+
24+
lintOptions {
25+
abortOnError false
26+
}
27+
2228
packagingOptions {
2329
exclude 'LICENSE.txt'
2430
}

0 commit comments

Comments
 (0)