本文参看:张云飞Vir博客,并改成自己能懂的几个点。
直接上gradle.build(module)吧!
android {
signingConfigs {
config {
}
}
compileSdkVersion 24
buildToolsVersion "25.0.0"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.xxx.xxx"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0.0"
}
//这里就是核心代码,注意其结构目录位置,属于 android {}下的
applicationVariants.all { variant ->
variant.outputs.each { output ->
def today = new Date().format('MMdd-HHmm');//自定义添加日期
def outputFile = output.outputFile;//def意为定义,其实你可以把它当做Strin