Skip to content

Commit 320cd5b

Browse files
committed
Build: signing config
1 parent 2c7324a commit 320cd5b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

app/build.gradle.kts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,24 @@ android {
1919
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2020
}
2121

22+
val hasSigning = listOf(
23+
"RELEASE_STORE_FILE",
24+
"RELEASE_STORE_PASSWORD",
25+
"RELEASE_KEY_ALIAS",
26+
"RELEASE_KEY_PASSWORD"
27+
).all { project.hasProperty(it) }
28+
29+
signingConfigs {
30+
if (hasSigning) {
31+
create("release") {
32+
storeFile = file(project.property("RELEASE_STORE_FILE") as String)
33+
storePassword = project.property("RELEASE_STORE_PASSWORD") as String
34+
keyAlias = project.property("RELEASE_KEY_ALIAS") as String
35+
keyPassword = project.property("RELEASE_KEY_PASSWORD") as String
36+
}
37+
}
38+
}
39+
2240
buildTypes {
2341
release {
2442
ndk {
@@ -30,6 +48,9 @@ android {
3048
getDefaultProguardFile("proguard-android-optimize.txt"),
3149
"proguard-rules.pro"
3250
)
51+
if (hasSigning) {
52+
signingConfig = signingConfigs.getByName("release")
53+
}
3354
}
3455
}
3556
compileOptions {

0 commit comments

Comments
 (0)