diff --git a/secrets-gradle-plugin/src/main/java/com/google/android/libraries/mapsplatform/secrets_gradle_plugin/Extensions.kt b/secrets-gradle-plugin/src/main/java/com/google/android/libraries/mapsplatform/secrets_gradle_plugin/Extensions.kt index 567a48e..eee245e 100644 --- a/secrets-gradle-plugin/src/main/java/com/google/android/libraries/mapsplatform/secrets_gradle_plugin/Extensions.kt +++ b/secrets-gradle-plugin/src/main/java/com/google/android/libraries/mapsplatform/secrets_gradle_plugin/Extensions.kt @@ -63,7 +63,7 @@ fun Variant.inject(properties: Properties, ignore: List) { }.filter { key -> key.isNotEmpty() && !ignoreRegexs.any { it.containsMatchIn(key) } }.forEach { key -> - val value = properties.getProperty(key) + val value = properties.getProperty(key).removeSurrounding("\"") val translatedKey = key.replace(javaVarRegexp, "") buildConfigFields.put( translatedKey, @@ -80,7 +80,7 @@ fun InternalBaseVariant.inject(properties: Properties, ignore: List) { }.filter { key -> key.isNotEmpty() && !ignoreRegexs.any { it.containsMatchIn(key) } }.forEach { key -> - val value = properties.getProperty(key) + val value = properties.getProperty(key).removeSurrounding("\"") val translatedKey = key.replace(javaVarRegexp, "") buildConfigField("String", translatedKey, value.addParenthesisIfNeeded()) mergedFlavor.manifestPlaceholders[translatedKey] = value diff --git a/secrets-gradle-plugin/src/test/kotlin/com/google/android/libraries/mapsplatform/secrets_gradle_plugin/SecretsPluginTest.kt b/secrets-gradle-plugin/src/test/kotlin/com/google/android/libraries/mapsplatform/secrets_gradle_plugin/SecretsPluginTest.kt index f20a13e..297470e 100644 --- a/secrets-gradle-plugin/src/test/kotlin/com/google/android/libraries/mapsplatform/secrets_gradle_plugin/SecretsPluginTest.kt +++ b/secrets-gradle-plugin/src/test/kotlin/com/google/android/libraries/mapsplatform/secrets_gradle_plugin/SecretsPluginTest.kt @@ -90,7 +90,7 @@ class SecretsPluginTest { variant.inject(properties = properties, ignore = ignoreList) check( - Pair("key", "\"someValue\"") + Pair("key", "someValue") ) checkKeysNotIn("ignoreKey", "sdk.dir", "sdk.foo") } @@ -110,8 +110,8 @@ class SecretsPluginTest { variant.inject(properties = properties, ignore = emptyList()) check( - Pair("key1", "\"someValue1\""), - Pair("key2", "\"someValue2\""), + Pair("key1", "someValue1"), + Pair("key2", "someValue2"), ) } @@ -130,8 +130,8 @@ class SecretsPluginTest { variant.inject(properties = properties, ignore = emptyList()) check( - Pair("sdkDir", "\"value\""), - Pair("sdkFoo", "\"value2\"") + Pair("sdkDir", "value"), + Pair("sdkFoo", "value2") ) } @@ -150,7 +150,7 @@ class SecretsPluginTest { variant.inject(properties = properties, ignore = emptyList()) check( - Pair("key1", "\"value\""), + Pair("key1", "value"), Pair("key2", "value2") ) }