Skip to content

Commit

Permalink
Add Signing Configurations
Browse files Browse the repository at this point in the history
Signed-off-by: Kshitij Patil <[email protected]>
  • Loading branch information
Kshitij09 committed Nov 1, 2021
1 parent 30ae5b2 commit 290f7bd
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
36 changes: 34 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ plugins {
id 'androidx.navigation.safeargs.kotlin'
}

def useReleaseKeystore = rootProject.file("signing/app-release.jks").exists()

android {
compileSdk buildConfig.compileSdk

Expand All @@ -13,7 +15,7 @@ android {
minSdk buildConfig.minSdk
targetSdk buildConfig.targetSdk
versionCode 1
versionName "0.1"
versionName "1.0.0-rc01"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// The following argument makes the Android Test Orchestrator run its
Expand All @@ -30,10 +32,40 @@ android {
}
}
}
signingConfigs {
debug {
storeFile rootProject.file("signing/app-debug.jks")
storePassword "kotlin"
keyAlias "tazabazar-debug"
keyPassword "kotlin"
}

release {
if (useReleaseKeystore) {
storeFile rootProject.file("signing/app-release.jks")
storePassword propOrDef('TAZABAZAR_RELEASE_PWD', "")
keyAlias "tazabazar-release"
keyPassword propOrDef('TAZABAZAR_RELEASE_PWD', "")
}
}
}

buildTypes {
debug {
signingConfig signingConfigs.debug
versionNameSuffix "-dev"
applicationIdSuffix ".debug"
}

release {
minifyEnabled false
if (useReleaseKeystore) {
signingConfig signingConfigs.release
} else {
// Otherwise just use the debug keystore (this is mainly for PR CI builds)
signingConfig signingConfigs.debug
}
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Expand Down
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,9 @@ subprojects {

task clean(type: Delete) {
delete rootProject.buildDir
}

Object propOrDef(String propertyName, Object defaultValue) {
def propertyValue = project.properties[propertyName]
return propertyValue != null ? propertyValue : defaultValue
}
Binary file added signing/app-debug.jks
Binary file not shown.
Binary file added signing/app-release.gpg
Binary file not shown.

0 comments on commit 290f7bd

Please sign in to comment.