Skip to content

Commit

Permalink
Update versionName
Browse files Browse the repository at this point in the history
  • Loading branch information
Patryk Michalik committed Mar 27, 2021
1 parent c094fe5 commit acff752
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
35 changes: 16 additions & 19 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit acff752

Please sign in to comment.