Add branch and commit hash to version name

pull/316/head^2
Alinson S. Xavier 8 years ago
parent b2734b179c
commit c05f50998f

@ -11,6 +11,7 @@ buildscript {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'org.jacoco:org.jacoco.core:+' classpath 'org.jacoco:org.jacoco.core:+'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
classpath 'org.ajoberstar:grgit:1.5.0'
} }
} }

@ -1,3 +1,6 @@
VERSION_CODE = 33
VERSION_NAME = 1.7.6
MIN_SDK_VERSION = 19 MIN_SDK_VERSION = 19
TARGET_SDK_VERSION = 25 TARGET_SDK_VERSION = 25
COMPILE_SDK_VERSION = 25 COMPILE_SDK_VERSION = 25

@ -3,15 +3,25 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply plugin: 'jacoco' apply plugin: 'jacoco'
import org.ajoberstar.grgit.Grgit
ext {
git = Grgit.open(currentDir: projectDir)
GIT_COMMIT = git.head().id.substring(0, 8)
GIT_BRANCH = git.branch.current.name
}
android { android {
compileSdkVersion COMPILE_SDK_VERSION as Integer compileSdkVersion COMPILE_SDK_VERSION as Integer
buildToolsVersion BUILD_TOOLS_VERSION buildToolsVersion BUILD_TOOLS_VERSION
defaultConfig { defaultConfig {
applicationId "org.isoron.uhabits" versionCode VERSION_CODE as Integer
versionName "$VERSION_NAME ($GIT_BRANCH $GIT_COMMIT)"
minSdkVersion MIN_SDK_VERSION as Integer minSdkVersion MIN_SDK_VERSION as Integer
targetSdkVersion TARGET_SDK_VERSION as Integer targetSdkVersion TARGET_SDK_VERSION as Integer
applicationId "org.isoron.uhabits"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions { javaCompileOptions {

@ -19,9 +19,7 @@
--> -->
<manifest <manifest
package="org.isoron.uhabits" package="org.isoron.uhabits"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android">
android:versionCode="33"
android:versionName="1.7.6">
<uses-permission android:name="android.permission.VIBRATE"/> <uses-permission android:name="android.permission.VIBRATE"/>

Loading…
Cancel
Save