-
Notifications
You must be signed in to change notification settings - Fork 2
/
lib.gradle
97 lines (85 loc) · 2.68 KB
/
lib.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//是否library
def isLibrary = ext.has('isLibrary')
ext.isLibrary = isLibrary
//
def isMainLibrary = ext.has('isMainLibrary')
ext.isMainLibrary = isMainLibrary
//设置到ext中,供lib的build.gradle使用
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion build_version.compileSdkVersion
buildToolsVersion build_version.buildToolsVersion
defaultConfig {
minSdkVersion build_version.minSdkVersion
targetSdkVersion build_version.targetSdkVersion
versionCode build_version.versionCode
versionName build_version.versionName
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
debug {
//混淆
minifyEnabled false
//是否清理无用资源
shrinkResources false
//是否启用zipAlign压缩
zipAlignEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
release {
release {
//混淆
minifyEnabled false
//是否清理无用资源
shrinkResources false
//是否启用zipAlign压缩
zipAlignEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
repositories {
flatDir {
dirs 'libs'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
//防止编译的时候oom、GC
dexOptions {
preDexLibraries false
maxProcessCount 8
//分配给gradle的内存
javaMaxHeapSize "4g"
}
lintOptions {
// true--关闭lint报告的分析进度
// quiet false
// true--所有正式版构建执行规则生成崩溃的lint检查,如果有崩溃问题将停止构建
checkReleaseBuilds false
// true--错误发生后停止gradle构建
abortOnError false
}
aaptOptions {
//停用 PNG 处理
cruncherEnabled false
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//kotlin 协程
api depend_plugins.kotlin_stdlib, depend_plugins.kotlin_coroutines, depend_plugins.kotlin_coroutines_core
}