Skip to content

Commit

Permalink
build: migrate config-properties gradle to kts
Browse files Browse the repository at this point in the history
  • Loading branch information
ujizin committed May 12, 2024
1 parent 09556cd commit 1c7ffdb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ tasks.withType<Detekt>().configureEach {
}
}

apply(from = "config-properties.gradle")
apply(from = "config-properties.gradle.kts")
17 changes: 0 additions & 17 deletions config-properties.gradle

This file was deleted.

17 changes: 17 additions & 0 deletions config-properties.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Create variables with empty default values
extra["RELEASE_STORE_FILE"] = "/"
extra["RELEASE_STORE_PASSWORD"] = ""
extra["RELEASE_KEY_ALIAS"] = ""
extra["RELEASE_KEY_PASSWORD"] = ""

val secretPropsFile = project.rootProject.file("local.properties")
if (secretPropsFile.exists()) {
val p = java.util.Properties()
java.io.FileInputStream(secretPropsFile).use { p.load(it) }
p.forEach { name, value -> extra["$name"] = value }
} else {
extra["RELEASE_STORE_FILE"] = System.getenv("RELEASE_STORE_FILE")
extra["RELEASE_STORE_PASSWORD"] = System.getenv("RELEASE_STORE_PASSWORD")
extra["RELEASE_KEY_ALIAS"] = System.getenv("RELEASE_KEY_ALIAS")
extra["RELEASE_KEY_PASSWORD"] = System.getenv("RELEASE_KEY_PASSWORD")
}

0 comments on commit 1c7ffdb

Please sign in to comment.