Skip to content
Snippets Groups Projects
Commit ea45f5e4 authored by Lennart Goedhart's avatar Lennart Goedhart
Browse files

Change gradle signing mechanism

parent 01e6adf9
No related branches found
No related tags found
No related merge requests found
......@@ -74,10 +74,20 @@ android {
buildConfigField "String", "BUGFENDER_API_KEY", getBugfenderApiKey()
}
signingConfigs {
release {
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.release
}
}
......@@ -88,35 +98,6 @@ android {
}
}
task signRelease {
doLast {
def command = [
'jarsigner',
'-verbose',
'-sigalg',
'SHA1withRSA',
'-digestalg',
'SHA1',
'-keystore',
'/Users/lennart/keystores/nightscout_android.jks',
'app/build/outputs/apk/app-release-unsigned.apk',
'nightscoutandroidkey'
]
def proc = new ProcessBuilder(command)
.redirectOutput(ProcessBuilder.Redirect.INHERIT)
.redirectInput(ProcessBuilder.Redirect.INHERIT)
.redirectError(ProcessBuilder.Redirect.INHERIT)
.start()
proc.waitFor()
if (0 != proc.exitValue()) {
throw new RuntimeException("Could not sign APK.")
}
}
}
task zipalignRelease {
doLast {
def command = [
......@@ -145,8 +126,8 @@ release {
tagTemplate = 'v${version}'
buildTasks = ['build']
beforeReleaseBuild.dependsOn 'clean'
afterReleaseBuild.dependsOn 'signRelease', 'zipalignRelease'
versionPropertyFile = 'release.properties'
afterReleaseBuild.dependsOn 'zipalignRelease'
versionPropertyFile = 'app/release.properties'
}
dependencies {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment