Skip to content

Instantly share code, notes, and snippets.

@Hackforid
Last active April 14, 2016 06:53
Show Gist options
  • Save Hackforid/0478c4196d39c2bcf1a4a055c7b6d395 to your computer and use it in GitHub Desktop.
Save Hackforid/0478c4196d39c2bcf1a4a055c7b6d395 to your computer and use it in GitHub Desktop.
// format name
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
if (output.outputFile != null && output.outputFile.name.endsWith('.apk')) {
def outputName = "Danjuan-" + versionName + "-" + output.outputFile.name
outputName = outputName.replace(' ', '')
def file = output.outputFile
output.outputFile = new File(file.parent, outputName)
}
}
}
// From http://stackoverflow.com/questions/19172565/how-append-date-build-to-versionnamesuffix-on-gradle
beta {
packageNameSuffix ".beta"
versionNameSuffix "-beta" + "-build" + getDate()
signingConfig signingConfigs.debug
}
def getDate() {
def date = new Date()
def formattedDate = date.format('yyyyMMddHHmmss')
return formattedDate
}
// skip the lint check permanently from your incremental builds
tasks.whenTaskAdded { task ->
if (task.name.equals("lint")) {
task.enabled = false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment