Last active
July 23, 2019 03:44
-
-
Save akperkins/3ee431f8ae9fdf0304d08669dbc0130f to your computer and use it in GitHub Desktop.
Example of auto-generating the versionCode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
// version information | |
def versionMajor = 1 | |
def versionMinor = 0 | |
def versionPatch = 0 | |
android { | |
compileSdkVersion 26 | |
buildToolsVersion "26.0.2" | |
defaultConfig { | |
applicationId "com.example" | |
minSdkVersion 19 | |
targetSdkVersion 26 | |
versionCode versionMajor * 10000 + versionMinor * 100 + versionPatch | |
versionName "${versionMajor}.${versionMinor}.${versionPatch}" | |
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | |
} | |
buildTypes { | |
release { | |
minifyEnabled false | |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |
} | |
} | |
} | |
dependencies { | |
compile fileTree(dir: 'libs', include: ['*.jar']) | |
testCompile 'junit:junit:4.12' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment