diff --git a/.gitignore b/.gitignore index 74b3680c2..4a60bc4c3 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,9 @@ gradle-app.setting app/release/* app/beta/* app/alpha/* +app/nightly/* + + +#Exclude signing configurations & keystore +signing.properties +*.keystore diff --git a/app/build.gradle b/app/build.gradle index b7eb68fc2..26b560967 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -38,11 +38,16 @@ android { multiDexEnabled true } + signingConfigs { + release + } + buildTypes { release { minifyEnabled true shrinkResources true zipAlignEnabled true + signingConfig signingConfigs.release proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } @@ -51,6 +56,11 @@ android { applicationIdSuffix = ".beta" } + nightly { + initWith release + applicationIdSuffix = ".nightly" + } + debug { applicationIdSuffix = ".debug" } @@ -163,4 +173,24 @@ dependencies { //Love <3 api("com.gitlab.AuroraOSS:gplayapi:514f061739") +} + +Properties props = new Properties() +def propFile = new File("signing.properties") +if (propFile.canRead()) { + props.load(new FileInputStream(propFile)) + + if (props != null && props.containsKey("STORE_FILE") && props.containsKey("STORE_PASSWORD") && + props.containsKey("KEY_ALIAS") && props.containsKey("KEY_PASSWORD")) { + android.signingConfigs.release.storeFile = file(props["STORE_FILE"]) + android.signingConfigs.release.storePassword = props["STORE_PASSWORD"] + android.signingConfigs.release.keyAlias = props["KEY_ALIAS"] + android.signingConfigs.release.keyPassword = props["KEY_PASSWORD"] + } else { + println "signing.properties found but some entries are missing" + android.buildTypes.release.signingConfig = null + } +} else { + println "signing.properties not found" + android.buildTypes.release.signingConfig = null } \ No newline at end of file