apply plugin: 'com.android.application'android {    compileSdkVersion 26    defaultConfig {        applicationId "com.example.builder.myapplication"        minSdkVersion 15        targetSdkVersion 26        versionCode 1        versionName "1.0"        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"    }    buildTypes {        release {            minifyEnabled false            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'        }    }    //自动生成指定名称的release发布版的 apk文件    android.applicationVariants.all { variant ->        def appName        if (project.hasProperty("applicationName")) {            appName = applicationName        } else {            appName = parent.name        }        variant.outputs.all { output ->            outputFileName = "Builder_${buildTime()}.apk"        }    }}def buildTime() {    def date = new Date()    def formattedDate = date.format('yyyyMMdd')    return formattedDate}

更多相关文章

  1. android 常用的代码
  2. 使用FragmentTabHost时,tabwidget被frament覆盖。
  3. Android(安卓)WebView加载本地Html文件
  4. Android(安卓)Studio批量打包
  5. android 重命名文件
  6. Android获取WiFi ip相关信息
  7. Android拍照、录像、录音代码范例
  8. 分享几点Android(安卓)开发中的小技巧吧。不知道算不算?
  9. NPM 和webpack 的基础使用

随机推荐

  1. Cocos2d-x Mac下环境搭建
  2. Android(安卓)ionic工程中调用webrtc获取
  3. Android沉浸式状态栏设计的实例代码
  4. Android(安卓)音视频开发(五) -- 使用 Me
  5. Binder通信机制
  6. android-实现黑名单拦截
  7. GreenDao 问题集合
  8. 游戏开发学习路线规划(整理自网络)
  9. android Dialog去掉黑色的背景和边框
  10. showDividers属性和showAsAction属性