Bug 1447734 - Specify Google Play Services library version in Gradle r=nalexander draft
authorJames Willcox <snorp@snorp.net>
Wed, 21 Mar 2018 12:50:11 -0500
changeset 770676 48627353d75e89235fb38c49d80f3b1a335836b3
parent 770641 b20dd5c8875e66d80d6ce4e6fdc0c2c1482e54ae
push id103469
push userbmo:snorp@snorp.net
push dateWed, 21 Mar 2018 17:51:10 +0000
reviewersnalexander
bugs1447734
milestone61.0a1
Bug 1447734 - Specify Google Play Services library version in Gradle r=nalexander MozReview-Commit-ID: KXcYJTlG2UC
build.gradle
mobile/android/app/build.gradle
mobile/android/moz.configure
mobile/android/thirdparty/build.gradle
--- a/build.gradle
+++ b/build.gradle
@@ -47,16 +47,17 @@ buildscript {
         // For in tree plugins.
         maven {
             url "file://${gradle.mozconfig.topsrcdir}/mobile/android/gradle/m2repo"
         }
     }
 
     ext.kotlin_version = '1.1.51'
     ext.support_library_version = '23.4.0'
+    ext.google_play_services_version = '8.4.0'
 
     dependencies {
         classpath 'com.android.tools.build:gradle:3.0.1'
         classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2'
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
     }
 }
 
--- a/mobile/android/app/build.gradle
+++ b/mobile/android/app/build.gradle
@@ -218,31 +218,31 @@ dependencies {
     implementation "com.android.support:cardview-v7:$support_library_version"
     implementation "com.android.support:recyclerview-v7:$support_library_version"
     implementation "com.android.support:design:$support_library_version"
     implementation "com.android.support:customtabs:$support_library_version"
     implementation "com.android.support:palette-v7:$support_library_version"
 
     if (mozconfig.substs.MOZ_NATIVE_DEVICES) {
         implementation "com.android.support:mediarouter-v7:$support_library_version"
-        implementation "com.google.android.gms:play-services-basement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
-        implementation "com.google.android.gms:play-services-base:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
-        implementation "com.google.android.gms:play-services-cast:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
+        implementation "com.google.android.gms:play-services-basement:$google_play_services_version"
+        implementation "com.google.android.gms:play-services-base:$google_play_services_version"
+        implementation "com.google.android.gms:play-services-cast:$google_play_services_version"
     }
 
     if (mozconfig.substs.MOZ_INSTALL_TRACKING) {
-        implementation "com.google.android.gms:play-services-analytics:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
-        implementation "com.google.android.gms:play-services-basement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
+        implementation "com.google.android.gms:play-services-analytics:$google_play_services_version"
+        implementation "com.google.android.gms:play-services-basement:$google_play_services_version"
     }
 
     if (mozconfig.substs.MOZ_ANDROID_GCM) {
-        implementation "com.google.android.gms:play-services-basement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
-        implementation "com.google.android.gms:play-services-base:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
-        implementation "com.google.android.gms:play-services-gcm:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
-        implementation "com.google.android.gms:play-services-measurement:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
+        implementation "com.google.android.gms:play-services-basement:$google_play_services_version"
+        implementation "com.google.android.gms:play-services-base:$google_play_services_version"
+        implementation "com.google.android.gms:play-services-gcm:$google_play_services_version"
+        implementation "com.google.android.gms:play-services-measurement:$google_play_services_version"
     }
 
     // Include LeakCanary in local builds, but not in official builds.  Mach
     // builds target the official audience, so LeakCanary will not be included
     // in any Mach build.
     localImplementation 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
     officialImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
     testImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
--- a/mobile/android/moz.configure
+++ b/mobile/android/moz.configure
@@ -13,19 +13,16 @@ option('--with-google-play-services',
        default=True)
 
 @depends('--with-google-play-services')
 def google_play_services(value):
     return bool(value)
 
 set_config('MOZ_ANDROID_GOOGLE_PLAY_SERVICES', depends_if(google_play_services)(lambda _: True))
 
-set_config('ANDROID_GOOGLE_PLAY_SERVICES_VERSION', '8.4.0')
-add_old_configure_assignment('ANDROID_GOOGLE_PLAY_SERVICES_VERSION', '8.4.0')
-
 option(env='MOZ_ANDROID_GCM',
        help='Enable GCM (Google Cloud Messaging) registration',
        default=google_play_services)
 
 set_config('MOZ_ANDROID_GCM',
            depends_if('MOZ_ANDROID_GCM')(lambda _: True))
 add_old_configure_assignment('MOZ_ANDROID_GCM',
                              depends_if('MOZ_ANDROID_GCM')(lambda _: True))
--- a/mobile/android/thirdparty/build.gradle
+++ b/mobile/android/thirdparty/build.gradle
@@ -42,17 +42,17 @@ android {
     }
 }
 
 dependencies {
     implementation "com.android.support:support-v4:$support_library_version"
     if (mozconfig.substs.MOZ_ANDROID_MMA) {
         implementation "com.android.support:appcompat-v7:$support_library_version"
         implementation "com.android.support:support-annotations:$support_library_version"
-        implementation "com.google.android.gms:play-services-gcm:${mozconfig.substs.ANDROID_GOOGLE_PLAY_SERVICES_VERSION}"
+        implementation "com.google.android.gms:play-services-gcm:$google_play_services_version"
     }
 }
 
 apply plugin: 'idea'
 
 idea {
     module {
         // This is cosmetic.  See the excludes in the root project.