From d80eaf348de2e932efd367ff5dfad262097bc3aa Mon Sep 17 00:00:00 2001 From: Martin Ndegwa Date: Mon, 14 Oct 2024 13:12:59 +0300 Subject: [PATCH] Escape mapbox.sdk.token in the Gradle config files --- library/build.gradle | 4 ++-- sample/build.gradle | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library/build.gradle b/library/build.gradle index cd6e0d94..1780dd6f 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -55,7 +55,7 @@ android { properties.load(project.rootProject.file("local.properties").newDataInputStream()) if (properties != null && properties.containsKey("mapbox.sdk.token")) { - buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", localProperties["mapbox.sdk.token"] + buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", "\"" + localProperties["mapbox.sdk.token"] + "\"" } else { println("One of the required config variables is not set in your local.properties"); buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", "\"sample_key\"" @@ -75,7 +75,7 @@ android { properties.load(project.rootProject.file("local.properties").newDataInputStream()) if (properties != null && properties.containsKey("mapbox.sdk.token")) { - buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", localProperties["mapbox.sdk.token"] + buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", "\"" + localProperties["mapbox.sdk.token"] + "\"" } else { println("One of the required config variables is not set in your local.properties"); buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", "\"sample_key\"" diff --git a/sample/build.gradle b/sample/build.gradle index 4922f264..605c46ae 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -37,7 +37,7 @@ android { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", localProperties["mapbox.sdk.token"] + buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", "\"" + localProperties["mapbox.sdk.token"] + "\"" buildConfigField "String", "CGR_USERNAME", localProperties["cgr.username"] buildConfigField "String", "CGR_PASSWORD", localProperties["cgr.password"] buildConfigField "String", "CGR_URL", localProperties["cgr.url"] @@ -47,7 +47,7 @@ android { debug { // See bug https://github.com/vanniktech/gradle-android-junit-jacoco-plugin/issues/183 testCoverageEnabled true - buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", localProperties["mapbox.sdk.token"] + buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", "\"" + localProperties["mapbox.sdk.token"] + "\"" buildConfigField "String", "CGR_USERNAME", localProperties["cgr.username"] buildConfigField "String", "CGR_PASSWORD", localProperties["cgr.password"] buildConfigField "String", "CGR_URL", localProperties["cgr.url"]