Created
September 23, 2017 21:28
-
-
Save Gizmodo/3320c03b3b183994b60f0915d4bfd8d0 to your computer and use it in GitHub Desktop.
Gradle
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
//this is BAD! | |
def buildDateTime = new Date().format(‘yyMMddHHmm’).toInteger() | |
android { | |
defaultConfig { | |
versionCode buildDateTime | |
} | |
} | |
Instead, disable this on development builds: | |
def buildDateTime = project.hasProperty(‘devBuild’) ? 100 : new Date().format(‘yyMMddHHmm’).toInteger() | |
android { | |
defaultConfig { | |
versionCode buildDateTime | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment