Skip to content

Commit

Permalink
fix: Remove misleading double quotes (#51)
Browse files Browse the repository at this point in the history
* Remove misleading double quotes

According to this issue: #46
and also my personal pain and experience, there is a misleading double quotes in the sample files, and that caused me to not able to use the maps and suffer a couple of days, so I thought we can fix the documentation or better, we can remove them from the string so it will work both ways

Signed-off-by: Amin Keshavarzian <[email protected]>

* Remove misleading double quotes

According to this issue: #46
and also my personal pain and experience, there is a misleading double quotes in the sample files, and that caused me to not able to use the maps and suffer a couple of days, so I thought we can fix the documentation or better, we can remove them from the string so it will work both ways

Signed-off-by: Amin Keshavarzian <[email protected]>
  • Loading branch information
aminsepahan authored Feb 10, 2022
1 parent b1c5dba commit 21daec7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fun Variant.inject(properties: Properties, ignore: List<String>) {
}.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,
Expand All @@ -80,7 +80,7 @@ fun InternalBaseVariant.inject(properties: Properties, ignore: List<String>) {
}.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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand All @@ -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"),
)
}

Expand All @@ -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")
)
}

Expand All @@ -150,7 +150,7 @@ class SecretsPluginTest {
variant.inject(properties = properties, ignore = emptyList())

check(
Pair("key1", "\"value\""),
Pair("key1", "value"),
Pair("key2", "value2")
)
}
Expand Down

0 comments on commit 21daec7

Please sign in to comment.