diff --git a/app/build.gradle b/app/build.gradle index 15b042d..60f0e9f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,6 +5,8 @@ plugins { id 'androidx.navigation.safeargs.kotlin' } +def useReleaseKeystore = rootProject.file("signing/app-release.jks").exists() + android { compileSdk buildConfig.compileSdk @@ -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 @@ -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' } } diff --git a/build.gradle b/build.gradle index c1b6bdd..aa3c089 100644 --- a/build.gradle +++ b/build.gradle @@ -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 } \ No newline at end of file diff --git a/signing/app-debug.jks b/signing/app-debug.jks new file mode 100644 index 0000000..06f2a38 Binary files /dev/null and b/signing/app-debug.jks differ diff --git a/signing/app-release.gpg b/signing/app-release.gpg new file mode 100644 index 0000000..89f7ad4 Binary files /dev/null and b/signing/app-release.gpg differ