From 5c077f199cbd16b459a77061509e0504029f78db Mon Sep 17 00:00:00 2001 From: Joey Pender Date: Thu, 30 Jun 2022 09:14:21 -0500 Subject: [PATCH] feat(google-maps): provides variables for configuring dependencies (#1063) --- google-maps/README.md | 13 +++++++++++++ google-maps/android/build.gradle | 22 ++++++++++++++-------- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/google-maps/README.md b/google-maps/README.md index 27fe38ee5..3bf74337a 100644 --- a/google-maps/README.md +++ b/google-maps/README.md @@ -39,6 +39,19 @@ To use certain location features, the SDK requires the following permissions to ``` +### Variables + +This plugin will use the following project variables (defined in your app's `variables.gradle` file): + +- `$googleMapsPlayServicesVersion`: version of `com.google.android.gms:play-services-maps` (default: `18.0.2`) +- `$googleMapsUtilsVersion`: version of `com.google.maps.android:android-maps-utils` (default: `2.3.0`) +- `$googleMapsKtxVersion`: version of `com.google.maps.android:maps-ktx` (default: `3.4.0`) +- `$googleMapsUtilsKtxVersion`: version of `com.google.maps.android:maps-utils-ktx` (default: `3.4.0`) +- `$kotlinxCoroutinesVersion`: version of `org.jetbrains.kotlinx:kotlinx-coroutines-android` and `org.jetbrains.kotlinx:kotlinx-coroutines-core` (default: `1.6.3`) +- `$androidxCoreKTXVersion`: version of `androidx.core:core-ktx` (default: `1.8.0`) +- `$kotlin_version`: version of `org.jetbrains.kotlin:kotlin-stdlib-jdk7` (default: `1.7.0`) + + ## Usage The Google Maps Capacitor plugin ships with a web component that must be used to render the map in your application as it enables us to embed the native view more effectively on iOS. The plugin will automatically register this web component for use in your application. diff --git a/google-maps/android/build.gradle b/google-maps/android/build.gradle index 3377e79d4..61e1889ad 100644 --- a/google-maps/android/build.gradle +++ b/google-maps/android/build.gradle @@ -3,10 +3,16 @@ ext { androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2' androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3' androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0' + androidxCoreKTXVersion = project.hasProperty('androidxCoreKTXVersion') ? rootProject.ext.androidxCoreKTXVersion : '1.8.0' + googleMapsPlayServicesVersion = project.hasProperty('googleMapsPlayServicesVersion') ? rootProject.ext.googleMapsPlayServicesVersion : '18.0.2' + googleMapsUtilsVersion = project.hasProperty('googleMapsUtilsVersion') ? rootProject.ext.googleMapsUtilsVersion : '2.3.0' + googleMapsKtxVersion = project.hasProperty('googleMapsKtxVersion') ? rootProject.ext.googleMapsKtxVersion : '3.4.0' + googleMapsUtilsKtxVersion = project.hasProperty('googleMapsUtilsKtxVersion') ? rootProject.ext.googleMapsUtilsKtxVersion : '3.4.0' + kotlinxCoroutinesVersion = project.hasProperty('kotlinxCoroutinesVersion') ? rootProject.ext.kotlinxCoroutinesVersion : '1.6.3' } buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '1.7.0' repositories { google() mavenCentral() @@ -44,8 +50,8 @@ android { } dependencies { - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinxCoroutinesVersion") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion") } } @@ -62,11 +68,11 @@ dependencies { testImplementation "junit:junit:$junitVersion" androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion" androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion" - implementation "androidx.core:core-ktx:1.6.0" + implementation "androidx.core:core-ktx:$androidxCoreKTXVersion" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'com.google.maps.android:maps-ktx:3.3.0' - implementation 'com.google.maps.android:maps-utils-ktx:3.3.0' - implementation 'com.google.maps.android:android-maps-utils:2.2.3' - implementation 'com.google.android.gms:play-services-maps:18.0.2' + implementation "com.google.maps.android:maps-ktx:$googleMapsKtxVersion" + implementation "com.google.maps.android:maps-utils-ktx:$googleMapsUtilsKtxVersion" + implementation "com.google.maps.android:android-maps-utils:$googleMapsUtilsVersion" + implementation "com.google.android.gms:play-services-maps:$googleMapsPlayServicesVersion" }