0
0
mirror of https://github.com/TrianguloY/UrlChecker.git synced 2024-09-19 20:02:16 +02:00

prepare gradle signing config for release

This commit is contained in:
TrianguloY 2024-08-28 18:39:23 +02:00
parent f30d6bd3e5
commit 87754cf474

View File

@ -32,6 +32,13 @@ android {
} }
} }
// rename output apks
applicationVariants.configureEach {
outputs.configureEach {
outputFileName = "URLCheck-$versionName${name == "release" ? "" : "-$name"}.apk"
}
}
lint { lint {
// users are free to update translations whenever // users are free to update translations whenever
// this mean that they are not usually up to date // this mean that they are not usually up to date
@ -58,6 +65,30 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
} }
// configure signing for release
private String secret(String name) { project.hasProperty(name) ? project.property(name) : System.getenv(name) }
if (secret('RELEASE_STORE_FILE')) {
println("Secrets provided, release will be signed")
android {
signingConfigs {
release {
storeFile file(secret('RELEASE_STORE_FILE'))
storePassword secret('RELEASE_STORE_PASSWORD')
keyAlias secret('RELEASE_KEY_ALIAS')
keyPassword secret('RELEASE_KEY_PASSWORD')
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
} else {
println("No secrets provided, release will not be signed")
}
// Generate translation related fields // Generate translation related fields
android { android {
defaultConfig { defaultConfig {