整理:build.gradle配置
This commit is contained in:
parent
7bc7bfa514
commit
9f41ff7d0b
|
@ -71,8 +71,16 @@ android {
|
|||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled true
|
||||
// 调试模式开关
|
||||
debuggable false
|
||||
jniDebuggable false
|
||||
// 压缩对齐开关
|
||||
zipAlignEnabled true
|
||||
// 移除无用的资源
|
||||
shrinkResources true
|
||||
// 代码混淆开关
|
||||
minifyEnabled true
|
||||
// 混淆配置
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
if (isNeedPackage.toBoolean()) {
|
||||
signingConfig signingConfigs.release
|
||||
|
@ -94,8 +102,16 @@ android {
|
|||
}
|
||||
}
|
||||
debug {
|
||||
minifyEnabled true
|
||||
// 调试模式开关
|
||||
debuggable true
|
||||
jniDebuggable true
|
||||
// 压缩对齐开关
|
||||
zipAlignEnabled true
|
||||
// 移除无用的资源
|
||||
shrinkResources true
|
||||
// 代码混淆开关
|
||||
minifyEnabled true
|
||||
// 混淆配置
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
if (isNeedPackage.toBoolean()) {
|
||||
signingConfig signingConfigs.release
|
||||
|
@ -116,13 +132,6 @@ android {
|
|||
buildConfigField "String", "APP_ID_UMENG", '"60254fc7425ec25f10f4293e"'
|
||||
}
|
||||
}
|
||||
/*debug {
|
||||
debuggable true
|
||||
minifyEnabled false
|
||||
|
||||
signingConfig signingConfigs.debug
|
||||
buildConfigField "String", "APP_ID_UMENG", '"60254fc7425ec25f10f4293e"'
|
||||
}*/
|
||||
}
|
||||
|
||||
//ABI配置——按CPU架构分别打包
|
||||
|
@ -149,6 +158,7 @@ android {
|
|||
excludes += ['META-INF/DEPENDENCIES.txt', 'META-INF/LICENSE.txt', 'META-INF/NOTICE.txt', 'META-INF/NOTICE', 'META-INF/LICENSE', 'META-INF/DEPENDENCIES', 'META-INF/notice.txt', 'META-INF/license.txt', 'META-INF/dependencies.txt', 'META-INF/LGPL2.1']
|
||||
}
|
||||
}
|
||||
|
||||
android.applicationVariants.all { variant ->
|
||||
// Assigns a different version code for each output APK.
|
||||
variant.outputs.each {
|
||||
|
@ -162,7 +172,6 @@ android {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
jniLibs.srcDirs = ['libs']
|
||||
|
@ -205,7 +214,7 @@ dependencies {
|
|||
//屏幕适配AutoSize:https://github.com/JessYanCoding/AndroidAutoSize
|
||||
implementation 'me.jessyan:autosize:1.2.1'
|
||||
//umeng统计
|
||||
implementation 'com.umeng.umsdk:common:9.5.4'
|
||||
implementation 'com.umeng.umsdk:common:9.5.6'
|
||||
implementation 'com.umeng.umsdk:asms:1.6.3'
|
||||
|
||||
//预加载占位控件
|
||||
|
@ -268,6 +277,9 @@ dependencies {
|
|||
|
||||
//Location 是一个通过 Android 自带的 LocationManager 来实现的定位功能:https://github.com/jenly1314/Location
|
||||
implementation 'com.github.pppscn:location:1.0.0'
|
||||
|
||||
//跨平台socket通信统一接口:https://gitee.com/xuankaicat/kmnkt
|
||||
//implementation 'com.github.pppscn.kmnkt:socket:2.0.0-alpha06'
|
||||
}
|
||||
//自动添加X-Library依赖
|
||||
apply from: 'x-library.gradle'
|
||||
|
|
17
build.gradle
17
build.gradle
|
@ -36,6 +36,23 @@ allprojects {
|
|||
maven { url 'https://oss.sonatype.org/content/repositories/public' }
|
||||
maven { url "https://jitpack.io" }
|
||||
}
|
||||
|
||||
// 设置全局编码
|
||||
tasks.withType(JavaCompile) {
|
||||
options.encoding = 'UTF-8'
|
||||
}
|
||||
|
||||
// 设置文档编码
|
||||
tasks.withType(Javadoc) {
|
||||
options {
|
||||
encoding 'UTF-8'
|
||||
charSet 'UTF-8'
|
||||
links 'http://docs.oracle.com/javase/7/docs/api'
|
||||
}
|
||||
}
|
||||
|
||||
// 将构建文件统一输出到项目根目录下的 build 文件夹
|
||||
setBuildDir(new File(rootDir, "build/${path.replaceAll(':', '/')}"))
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
|
|
Loading…
Reference in New Issue