Skip to content

Commit

Permalink
Sign release builds from keystore.properties file
Browse files Browse the repository at this point in the history
  • Loading branch information
ldeso committed May 9, 2024
1 parent a811c00 commit afbccf0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
/release
.DS_Store
.gradle
keystore.properties
local.properties
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

- Remove encrypted Dependency Info Block

### Note

- Sign release builds from keystore.properties file

## [1.8.5](https://github.com/ldeso/blitz/releases/tag/v1.8.5) – 2024-05-02

This release updates dependencies.
Expand Down
21 changes: 19 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright 2024 Léo de Souza
// SPDX-License-Identifier: Apache-2.0

import java.util.Properties

plugins {
kotlin("android") version libs.versions.kotlin
alias(libs.plugins.android.application)
Expand All @@ -23,7 +25,22 @@ android {
}

signingConfigs {
getByName("debug") {
register("release") {
val keystorePropertiesFile = file("keystore.properties")
if (keystorePropertiesFile.isFile) {
val keystoreProperties = Properties()
keystoreProperties.load(keystorePropertiesFile.inputStream())
storeFile = file(keystoreProperties.getProperty("storeFile"))
storePassword = keystoreProperties.getProperty("storePassword")
keyAlias = keystoreProperties.getProperty("keyAlias")
keyPassword = keystoreProperties.getProperty("keyPassword")
} else {
val debugSigningConfig = getByName("debug")
storeFile = debugSigningConfig.storeFile
storePassword = debugSigningConfig.storePassword
keyAlias = debugSigningConfig.keyAlias
keyPassword = debugSigningConfig.keyPassword
}
enableV3Signing = true
enableV4Signing = true
}
Expand All @@ -34,7 +51,7 @@ android {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"))
signingConfig = signingConfigs.getByName("debug")
signingConfig = signingConfigs["release"]
}
}

Expand Down

0 comments on commit afbccf0

Please sign in to comment.