Skip to content

Commit

Permalink
feat: use local.properties file for signing configs
Browse files Browse the repository at this point in the history
  • Loading branch information
razinj committed Jun 23, 2024
1 parent 9aa8804 commit 7c75be0
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,24 @@ android {

signingConfigs {
release {
if (project.hasProperty('CONTEXT_LAUNCHER_UPLOAD_STORE_FILE')) {
project.logger.lifecycle('[!] Release upload keystore file found.')
storeFile file(CONTEXT_LAUNCHER_UPLOAD_STORE_FILE)
storePassword CONTEXT_LAUNCHER_UPLOAD_STORE_PASSWORD
keyAlias CONTEXT_LAUNCHER_UPLOAD_KEY_ALIAS
keyPassword CONTEXT_LAUNCHER_UPLOAD_KEY_PASSWORD
def keystorePropertiesFile = file('local.properties')
if (keystorePropertiesFile.exists()) {
def keystoreProperties = new Properties()
keystorePropertiesFile.withInputStream { stream ->
keystoreProperties.load(stream)
}

if (keystoreProperties.containsKey('CONTEXT_LAUNCHER_UPLOAD_STORE_FILE')) {
project.logger.lifecycle('[!] Release upload keystore file found.')
storeFile file(keystoreProperties['CONTEXT_LAUNCHER_UPLOAD_STORE_FILE'])
storePassword keystoreProperties['CONTEXT_LAUNCHER_UPLOAD_STORE_PASSWORD']
keyAlias keystoreProperties['CONTEXT_LAUNCHER_UPLOAD_KEY_ALIAS']
keyPassword keystoreProperties['CONTEXT_LAUNCHER_UPLOAD_KEY_PASSWORD']
} else {
project.logger.lifecycle('[X] Release upload keystore file not found.')
}
} else {
project.logger.lifecycle('[X] Release upload keystore file not found.')
project.logger.lifecycle('[X] local.properties file not found.')
}
}
debug {
Expand Down

0 comments on commit 7c75be0

Please sign in to comment.