Skip to content

Commit bd29e17

Browse files
authored
[PM-16052] Add CI_INFO build config field (#4471)
1 parent f28f5ee commit bd29e17

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

app/build.gradle.kts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ val userProperties = Properties().apply {
3333
}
3434
}
3535

36+
/**
37+
* Loads CI-specific build properties that are not checked into source control.
38+
*/
39+
val ciProperties = Properties().apply {
40+
val ciPropsFile = File(rootDir, "ci.properties")
41+
if (ciPropsFile.exists()) {
42+
FileInputStream(ciPropsFile).use { load(it) }
43+
}
44+
}
45+
3646
android {
3747
namespace = "com.x8bit.bitwarden"
3848
compileSdk = libs.versions.compileSdk.get().toInt()
@@ -52,6 +62,12 @@ android {
5262
}
5363

5464
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
65+
66+
buildConfigField(
67+
type ="String",
68+
name = "CI_INFO",
69+
value = "\"${ciProperties.getOrDefault("ci.info", "local")}\""
70+
)
5571
}
5672

5773
androidResources {

0 commit comments

Comments
 (0)