[#256] Fix release signing config
This commit is contained in:
parent
d410d62f64
commit
93347c3116
|
@ -52,6 +52,30 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val releaseKeystorePath = project.property("ZCASH_RELEASE_KEYSTORE_PATH").toString()
|
||||||
|
val releaseKeystorePassword = project.property("ZCASH_RELEASE_KEYSTORE_PASSWORD").toString()
|
||||||
|
val releaseKeyAlias = project.property("ZCASH_RELEASE_KEY_ALIAS").toString()
|
||||||
|
val releaseKeyAliasPassword =
|
||||||
|
project.property("ZCASH_RELEASE_KEY_ALIAS_PASSWORD").toString()
|
||||||
|
val isReleaseSigningConfigured = listOf(
|
||||||
|
releaseKeystorePath,
|
||||||
|
releaseKeystorePassword,
|
||||||
|
releaseKeyAlias,
|
||||||
|
releaseKeyAliasPassword
|
||||||
|
).all { !it.isNullOrBlank() }
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
if (isReleaseSigningConfigured) {
|
||||||
|
// If this block doesn't execute, the output will be unsigned
|
||||||
|
create("release").apply {
|
||||||
|
storeFile = File(releaseKeystorePath)
|
||||||
|
storePassword = releaseKeystorePassword
|
||||||
|
keyAlias = releaseKeyAlias
|
||||||
|
keyPassword = releaseKeyAliasPassword
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
getByName("release").apply {
|
getByName("release").apply {
|
||||||
isMinifyEnabled = project.property("IS_MINIFY_ENABLED").toString().toBoolean()
|
isMinifyEnabled = project.property("IS_MINIFY_ENABLED").toString().toBoolean()
|
||||||
|
@ -60,29 +84,8 @@ android {
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||||
"proguard-project.txt"
|
"proguard-project.txt"
|
||||||
)
|
)
|
||||||
}
|
if (isReleaseSigningConfigured) {
|
||||||
}
|
signingConfig = signingConfigs.getByName("release")
|
||||||
|
|
||||||
signingConfigs {
|
|
||||||
val releaseKeystorePath = project.property("ZCASH_RELEASE_KEYSTORE_PATH").toString()
|
|
||||||
val releaseKeystorePassword = project.property("ZCASH_RELEASE_KEYSTORE_PASSWORD").toString()
|
|
||||||
val releaseKeyAlias = project.property("ZCASH_RELEASE_KEY_ALIAS").toString()
|
|
||||||
val releaseKeyAliasPassword =
|
|
||||||
project.property("ZCASH_RELEASE_KEY_ALIAS_PASSWORD").toString()
|
|
||||||
val isReleaseSigningConfigured = listOf(
|
|
||||||
releaseKeystorePath,
|
|
||||||
releaseKeystorePassword,
|
|
||||||
releaseKeyAlias,
|
|
||||||
releaseKeyAliasPassword
|
|
||||||
).all { !it.isNullOrBlank() }
|
|
||||||
|
|
||||||
if (isReleaseSigningConfigured) {
|
|
||||||
// If this block doesn't execute, the output will be unsigned
|
|
||||||
create("release").apply {
|
|
||||||
storeFile = File(releaseKeystorePath)
|
|
||||||
storePassword = releaseKeystorePassword
|
|
||||||
keyAlias = releaseKeyAlias
|
|
||||||
keyPassword = releaseKeyAliasPassword
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue