Skip to content

Commit dd8eaee

Browse files
PIMOB-4287: fix local prop keys parsing for both app run configurations + ci
1 parent 41b06d2 commit dd8eaee

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

app/build.gradle

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,17 @@ android {
4949
def localProps = new Properties()
5050
def localPropsFile = rootProject.file("local.properties")
5151
if (localPropsFile.exists()) {
52-
localPropsFile.withInputStream { localProps.load(it) }
52+
localProps.load(localPropsFile.newDataInputStream())
5353
}
5454

5555
defaultConfig {
56-
buildConfigField("String", "SANDBOX_PUBLIC_KEY", "${localProps.getProperty("sandbox.components.public_key") ?: ""}")
57-
buildConfigField("String", "SANDBOX_SECRET_KEY", "${localProps.getProperty("sandbox.components.secret_key") ?: ""}")
58-
buildConfigField("String", "SANDBOX_PROCESSING_CHANNEL_ID", "${localProps.getProperty("sandbox.components.processing_channel_id") ?: ""}")
59-
}
60-
buildFeatures {
61-
buildConfig true
56+
buildConfigField "String", "SANDBOX_PUBLIC_KEY", "\"${localProps.getProperty("sandbox.components.public_key") ?: ""}\""
57+
buildConfigField "String", "SANDBOX_SECRET_KEY", "\"${localProps.getProperty("sandbox.components.secret_key") ?: ""}\""
58+
buildConfigField "String", "SANDBOX_PROCESSING_CHANNEL_ID", "\"${localProps.getProperty("sandbox.components.processing_channel_id") ?: ""}\""
59+
60+
buildFeatures {
61+
buildConfig true
62+
}
6263
}
6364
}
6465

example_app_frames/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ android {
1818
buildConfigField(
1919
"String",
2020
"SANDBOX_PUBLIC_KEY",
21-
this["sandbox.components.public_key"].toString(),
21+
"\"${this["sandbox.components.public_key"]}\"",
2222
)
2323
buildConfigField(
2424
"String",
2525
"SANDBOX_SECRET_KEY",
26-
this["sandbox.components.secret_key"].toString(),
26+
"\"${this["sandbox.components.secret_key"]}\"",
2727
)
2828
buildConfigField(
2929
"String",
3030
"SANDBOX_PROCESSING_CHANNEL_ID",
31-
this["sandbox.components.processing_channel_id"].toString(),
31+
"\"${this["sandbox.components.processing_channel_id"]}\"",
3232
)
3333
}
3434
}

0 commit comments

Comments
 (0)