From acff752e6ab5e9babb020e94180953a85c21d8bd Mon Sep 17 00:00:00 2001 From: Patryk Michalik Date: Sat, 27 Mar 2021 07:51:29 +0100 Subject: [PATCH] Update `versionName` --- app/build.gradle | 35 +++++++++++------------- gradle/wrapper/gradle-wrapper.properties | 3 +- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 852a8a0..6a88484 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,42 +1,39 @@ apply plugin: 'com.android.application' +final def commitHash = { -> + final def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'rev-parse', '--short=7', 'HEAD' + standardOutput = stdout + } + stdout.toString().trim() +} + android { compileSdkVersion 29 buildToolsVersion "29.0.2" - signingConfigs { - travis { - storeFile file("../app/debug.jks") - storePassword System.getenv("STORE_PASSWORD") - keyAlias "Lawnchair" - keyPassword System.getenv("KEY_PASSWORD") - } - } - defaultConfig { applicationId "app.lawnchair.lawnfeed" minSdkVersion 21 targetSdkVersion 29 - if (System.getenv("TRAVIS") == "true") { - versionCode = Integer.valueOf(System.getenv("TRAVIS_BUILD_NUMBER")) - versionName = System.getenv("MAJOR_MINOR") + "." + System.getenv("TRAVIS_BUILD_NUMBER") - } else { - versionCode 1 - versionName "dev" - } + versionCode 1 + versionName "3.0+${commitHash()}" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + applicationVariants.all { variant -> + variant.outputs.all { + outputFileName = "Lawnfeed ${variant.versionName}.apk" + } } buildTypes { debug { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - if (System.getenv("TRAVIS") == "true" && System.getenv("TRAVIS_EVENT_TYPE") != "pull_request") { - signingConfig signingConfigs.travis - } } release { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d2c45a4..10201af 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Sat Mar 27 07:42:52 CET 2021 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip