Skip to content

Commit

Permalink
Android build (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
samtstern authored May 22, 2018
2 parents 853bc49 + d36d46c commit 3f8dadb
Show file tree
Hide file tree
Showing 23 changed files with 362 additions and 63 deletions.
8 changes: 8 additions & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.gradle
.idea/
*.iml
build/
/local.properties
.DS_Store
/captures
google-services.json
14 changes: 7 additions & 7 deletions android/analytics/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
compileSdkVersion 27
buildToolsVersion '27.0.2'

defaultConfig {
applicationId "com.google.samples.quickstart.analytics"
minSdkVersion 14
targetSdkVersion 25
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
Expand All @@ -20,11 +20,11 @@ android {
}

dependencies {
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:support-v4:27.1.0'

// [START gms_compile]
compile 'com.google.android.gms:play-services-analytics:11.6.0'
implementation 'com.google.android.gms:play-services-analytics:15.0.0'
// [END gms_compile]
}
7 changes: 3 additions & 4 deletions android/analytics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@
buildscript {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.0.1'
}
}

allprojects {
repositories {
jcenter()
mavenLocal()
maven { url 'https://maven.google.com' }
}
}
Binary file modified android/analytics/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions android/analytics/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Tue Apr 11 22:55:43 SGT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip
6 changes: 3 additions & 3 deletions android/analytics/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -155,7 +155,7 @@ if $cygwin ; then
fi

# Escape application args
save ( ) {
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
Expand Down
41 changes: 41 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
buildscript {
repositories {
jcenter()
mavenLocal()
maven { url 'https://maven.google.com' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.3.0'
}
}

plugins {
id 'com.github.ben-manes.versions' version '0.17.0'
}

allprojects {
repositories {
//mavenLocal() must be listed at the top to facilitate testing
mavenLocal()
jcenter()
maven { url 'https://maven.google.com' }
maven { url 'https://maven.fabric.io/public' }
}

// See: https://github.com/ben-manes/gradle-versions-plugin
dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { selection ->
boolean numbersOnly = (/^[\d.]+$/ ==~ selection.candidate.version)
if (!numbersOnly) {
selection.reject("Rejecting: ${selection.candidate.version}")
}
}
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
17 changes: 8 additions & 9 deletions android/gcm/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
compileSdkVersion 27
buildToolsVersion '27.0.2'

defaultConfig {
applicationId "gcm.play.android.samples.com.gcmquickstart"
minSdkVersion 14
targetSdkVersion 25
targetSdkVersion 27
versionCode 1
versionName "1.0"

Expand All @@ -25,15 +25,14 @@ android {
}

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

compile 'com.android.support:appcompat-v7:25.3.1'
implementation 'com.android.support:appcompat-v7:27.1.0'

// Testing dependencies
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support:support-annotations:25.3.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestImplementation 'com.android.support.test:runner:0.5'
androidTestImplementation 'com.android.support:support-annotations:27.1.0'
}

apply plugin: 'com.google.gms.google-services'
10 changes: 3 additions & 7 deletions android/gcm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,18 @@ buildscript {
repositories {
jcenter()
mavenLocal()
maven { url 'https://maven.google.com' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
mavenLocal()
maven {
url "https://maven.google.com"
}
maven { url 'https://maven.google.com' }
}
}
Binary file modified android/gcm/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions android/gcm/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Tue Apr 11 22:55:49 SGT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip
6 changes: 3 additions & 3 deletions android/gcm/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -155,7 +155,7 @@ if $cygwin ; then
fi

# Escape application args
save ( ) {
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
Expand Down
Binary file added android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 3f8dadb

Please sign in to comment.