android 中的每日构造 ——android stuido 中的build.gradle示例
来源:互联网 发布:撒贝宁智商知乎 编辑:程序博客网 时间:2024/06/09 21:12
import org.tmatesoft.svn.core.wc.*apply plugin: 'com.android.application'//发布时间def releaseTime() { return new Date().format("yyyyMMdd", TimeZone.getTimeZone("GMT"))}//获取svn的版本号def getSvnRevision() { ISVNOptions options = SVNWCUtil.createDefaultOptions(true); SVNClientManager clientManager = SVNClientManager.newInstance(options); SVNStatusClient statusClient = clientManager.getStatusClient(); SVNStatus status = statusClient.doStatus(rootDir, false); SVNRevision revision = status.getCommittedRevision(); return revision.getNumber();}android { compileSdkVersion 23 buildToolsVersion "23.0.0" useLibrary 'org.apache.http.legacy' defaultConfig { multiDexEnabled true applicationId "com.example.agentproject" minSdkVersion 15 targetSdkVersion 20 versionCode 2 versionName "2.0.26" } //签名 signingConfigs { debug { keyAlias 'sdroid' keyPassword 'test123456' storeFile file('signer/client.jks') storePassword 'test123456' } release { keyAlias 'sdroid' keyPassword 'test123456' storeFile file('signer/client.jks') storePassword 'test123456' } } buildTypes { debug { signingConfig signingConfigs.debug }
release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release // 配置release包的签名及生成的apk的文件名 applicationVariants.all { variant -> variant.outputs.each { output -> def outputFile = output.outputFile //这里修改文件名 def fileName = "at.apk" output.outputFile = new File(outputFile.parent, fileName) } } } } lintOptions{ abortOnError false }}//编译依赖文件dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile 'org.tmatesoft.svnkit:svnkit-dav:1.8.14' compile files('libs/dom4j-1.6.1.jar')}//最后将生成的apk复制到指定目录下并修改名称build { doLast { def versionName = android.defaultConfig.versionName def sourceName = "at.apk"; def fileName = "at-android-${versionName}-build${getSvnRevision()}-${releaseTime()}.apk" def fromFile = "./build/outputs/apk/" + sourceName def intoFile = "../target/${releaseTime()}/"; // copy --> rename copy { from fromFile into intoFile rename(sourceName, fileName) } }}
0 0
- android 中的每日构造 ——android stuido 中的build.gradle示例
- Android stuido 中的keystore
- Android stuido 中的keystore
- android中的build.gradle详解
- android studio中的build.gradle文件
- Android Studio中的build.gradle文件解析
- Android Studio中的build.gradle文件解析
- Android入门——Android Studio中的build.gradle文件解析
- android开发项目中的build.gradle文件介绍
- 如何解决Android Studio中的Gradle Build Running问题
- Android打包——详解build.gradle
- Android stuido Gradle模式的使用
- Android 中的Gradle
- Android中的Gradle
- Android中的Gradle详解
- 理解Android中的Gradle
- android gradle 配置 build.gradle
- Android Gradle Build
- C/C++常用头文件及函数汇总
- Android 可拖拽悬浮按钮
- 微信小程序的逻辑层
- Redis集群的搭建
- 005-搭建私有仓库,上传镜像报错:server gave HTTP response to HTTPS client
- android 中的每日构造 ——android stuido 中的build.gradle示例
- uploadify多文件上传
- Arduino串口读入字符串
- hdu 6030 Happy Necklace
- BAT | 批处理下载ftp文件
- word自动生成目录和调整页码字体的方法
- 简谈二维码(QRcode)的C语言生成,在单片机平台的实现
- 合肥地铁4号、5号线周五开工 部分道路因施工将封闭
- IMAC/XCode OC项目修改指向SVN地址的方法