Skip to content
This repository was archived by the owner on Jul 2, 2025. It is now read-only.

Commit 3f8dadb

Browse files
authored
Android build (#365)
2 parents 853bc49 + d36d46c commit 3f8dadb

23 files changed

+362
-63
lines changed

android/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.gradle
2+
.idea/
3+
*.iml
4+
build/
5+
/local.properties
6+
.DS_Store
7+
/captures
8+
google-services.json

android/analytics/app/build.gradle

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

33
android {
4-
compileSdkVersion 25
5-
buildToolsVersion "25.0.3"
4+
compileSdkVersion 27
5+
buildToolsVersion '27.0.2'
66

77
defaultConfig {
88
applicationId "com.google.samples.quickstart.analytics"
99
minSdkVersion 14
10-
targetSdkVersion 25
10+
targetSdkVersion 27
1111
versionCode 1
1212
versionName "1.0"
1313
}
@@ -20,11 +20,11 @@ android {
2020
}
2121

2222
dependencies {
23-
compile 'com.android.support:appcompat-v7:25.3.1'
24-
compile 'com.android.support:design:25.3.1'
25-
compile 'com.android.support:support-v4:25.3.1'
23+
implementation 'com.android.support:appcompat-v7:27.1.0'
24+
implementation 'com.android.support:design:27.1.0'
25+
implementation 'com.android.support:support-v4:27.1.0'
2626

2727
// [START gms_compile]
28-
compile 'com.google.android.gms:play-services-analytics:11.6.0'
28+
implementation 'com.google.android.gms:play-services-analytics:15.0.0'
2929
// [END gms_compile]
3030
}

android/analytics/build.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
buildscript {
44
repositories {
55
jcenter()
6+
maven { url 'https://maven.google.com' }
67
mavenLocal()
78
}
89
dependencies {
9-
classpath 'com.android.tools.build:gradle:2.3.2'
10-
11-
// NOTE: Do not place your application dependencies here; they belong
12-
// in the individual module build.gradle files
10+
classpath 'com.android.tools.build:gradle:3.0.1'
1311
}
1412
}
1513

1614
allprojects {
1715
repositories {
1816
jcenter()
1917
mavenLocal()
18+
maven { url 'https://maven.google.com' }
2019
}
2120
}
117 Bytes
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Tue Apr 11 22:55:43 SGT 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
43
zipStoreBase=GRADLE_USER_HOME
54
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip

android/analytics/gradlew

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
3333
# Use the maximum available, or set MAX_FD != -1 to use that value.
3434
MAX_FD="maximum"
3535

36-
warn ( ) {
36+
warn () {
3737
echo "$*"
3838
}
3939

40-
die ( ) {
40+
die () {
4141
echo
4242
echo "$*"
4343
echo
@@ -155,7 +155,7 @@ if $cygwin ; then
155155
fi
156156

157157
# Escape application args
158-
save ( ) {
158+
save () {
159159
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160160
echo " "
161161
}

android/build.gradle

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
buildscript {
2+
repositories {
3+
jcenter()
4+
mavenLocal()
5+
maven { url 'https://maven.google.com' }
6+
}
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:3.0.1'
9+
classpath 'com.google.gms:google-services:3.3.0'
10+
}
11+
}
12+
13+
plugins {
14+
id 'com.github.ben-manes.versions' version '0.17.0'
15+
}
16+
17+
allprojects {
18+
repositories {
19+
//mavenLocal() must be listed at the top to facilitate testing
20+
mavenLocal()
21+
jcenter()
22+
maven { url 'https://maven.google.com' }
23+
maven { url 'https://maven.fabric.io/public' }
24+
}
25+
26+
// See: https://github.com/ben-manes/gradle-versions-plugin
27+
dependencyUpdates.resolutionStrategy = {
28+
componentSelection { rules ->
29+
rules.all { selection ->
30+
boolean numbersOnly = (/^[\d.]+$/ ==~ selection.candidate.version)
31+
if (!numbersOnly) {
32+
selection.reject("Rejecting: ${selection.candidate.version}")
33+
}
34+
}
35+
}
36+
}
37+
}
38+
39+
task clean(type: Delete) {
40+
delete rootProject.buildDir
41+
}

android/gcm/app/build.gradle

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

33
android {
4-
compileSdkVersion 25
5-
buildToolsVersion "25.0.3"
4+
compileSdkVersion 27
5+
buildToolsVersion '27.0.2'
66

77
defaultConfig {
88
applicationId "gcm.play.android.samples.com.gcmquickstart"
99
minSdkVersion 14
10-
targetSdkVersion 25
10+
targetSdkVersion 27
1111
versionCode 1
1212
versionName "1.0"
1313

@@ -25,15 +25,14 @@ android {
2525
}
2626

2727
dependencies {
28-
compile fileTree(dir: 'libs', include: ['*.jar'])
29-
compile 'com.google.android.gms:play-services-gcm:11.6.0'
28+
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
3029

31-
compile 'com.android.support:appcompat-v7:25.3.1'
30+
implementation 'com.android.support:appcompat-v7:27.1.0'
3231

3332
// Testing dependencies
34-
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
35-
androidTestCompile 'com.android.support.test:runner:0.5'
36-
androidTestCompile 'com.android.support:support-annotations:25.3.1'
33+
androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
34+
androidTestImplementation 'com.android.support.test:runner:0.5'
35+
androidTestImplementation 'com.android.support:support-annotations:27.1.0'
3736
}
3837

3938
apply plugin: 'com.google.gms.google-services'

android/gcm/build.gradle

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,18 @@ buildscript {
44
repositories {
55
jcenter()
66
mavenLocal()
7+
maven { url 'https://maven.google.com' }
78
}
89
dependencies {
9-
classpath 'com.android.tools.build:gradle:2.3.2'
10+
classpath 'com.android.tools.build:gradle:3.0.1'
1011
classpath 'com.google.gms:google-services:3.1.0'
11-
12-
// NOTE: Do not place your application dependencies here; they belong
13-
// in the individual module build.gradle files
1412
}
1513
}
1614

1715
allprojects {
1816
repositories {
1917
jcenter()
2018
mavenLocal()
21-
maven {
22-
url "https://maven.google.com"
23-
}
19+
maven { url 'https://maven.google.com' }
2420
}
2521
}
117 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)