Skip to content

Commit 2d5ca14

Browse files
committed
fix signing from environment
1 parent f10c1d5 commit 2d5ca14

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

build.gradle.kts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,28 @@ fun getBuildProperty(property: String): String {
3131
return "n/a"
3232
}
3333

34+
fun getBuildSignKey(property: String): String {
35+
val prop: String? = project.findProperty(property) as String?
36+
if(prop != null) {
37+
return prop
38+
}
39+
40+
val env: String? = System.getenv(property)
41+
if (env != null) {
42+
return env.replace("\\n", "\n")
43+
}
44+
45+
return "n/a"
46+
}
47+
3448
fun isReleaseVersion(): Boolean {
3549
return !(project.version.toString().endsWith("SNAPSHOT"))
3650
}
3751

3852
ext {
3953
set("publishUser", getBuildProperty("PUBLISH_USER"))
4054
set("publishKey", getBuildProperty("PUBLISH_KEY"))
41-
set("signKey", getBuildProperty("SIGN_KEY"))
55+
set("signKey", getBuildSignKey("SIGN_KEY"))
4256
set("signPwd", getBuildProperty("SIGN_PWD"))
4357
}
4458

0 commit comments

Comments
 (0)