Skip to content

Commit

Permalink
Add dynamic version code
Browse files Browse the repository at this point in the history
  • Loading branch information
filiphsps authored Jul 27, 2016
1 parent 950a66d commit 73ed89e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ apply plugin: 'com.android.application'
apply plugin: 'android-apt'
apply plugin: 'com.getkeepsafe.dexcount'

def getVersionCode = { ->
def code = project.hasProperty('versionCode') ? versionCode.toInteger() : 1
return code
}
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
Expand All @@ -10,7 +14,7 @@ android {
minSdkVersion 17
targetSdkVersion 24
multiDexEnabled true
versionCode 1
versionCode getVersionCode()
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -64,4 +68,4 @@ dependencies {
testCompile 'org.powermock:powermock-module-junit4:1.6.5'
testCompile 'org.powermock:powermock-api-mockito:1.6.5'

}
}

0 comments on commit 73ed89e

Please sign in to comment.