-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathbuild.gradle
93 lines (87 loc) · 3.42 KB
/
build.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
apply plugin: 'com.android.application'
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode rootProject.ext.android["versionCode"]
versionName rootProject.ext.android["versionName"]
testInstrumentationRunner rootProject.ext.dependencies["androidJUnitRunner"]
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
}
buildTypes {
debug {
buildConfigField "boolean", "LOG_DEBUG", "true"
buildConfigField "boolean", "USE_CANARY", "true"
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
buildConfigField "boolean", "LOG_DEBUG", "false"
buildConfigField "boolean", "USE_CANARY", "false"
minifyEnabled true
shrinkResources true
zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
useLibrary 'org.apache.http.legacy'
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
//预编译
preDexLibraries true
//支持大工程
jumboMode = true
//线程数
threadCount = 16
//dex内存,公式:dex内存 + 1G < Gradle内存
javaMaxHeapSize "4g"
additionalParameters = [
'--multi-dex',//多分包
'--set-max-idx-number=60000'//每个包内方法数上限
]
}
lintOptions {
checkReleaseBuilds false
disable 'InvalidPackage'
disable "ResourceType"
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
sourceSets {
main {
manifest.srcFile './AndroidManifest.xml'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
runtimeOnly project(":module:module_app")
runtimeOnly project(":module:module_zhihu")
runtimeOnly project(":module:module_gank")
runtimeOnly project(":module:module_gold")
implementation project(":component:CommonRes")//因为 CommonRes 依赖了 CommonSDK, 所以如果业务模块需要公共 UI 组件就依赖 CommonRes, 如果不需要就只依赖 CommonSDK
implementation project(":component:CommonService")
implementation project(":component:CommonResource")
//tools
annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
annotationProcessor rootProject.ext.dependencies["dagger2-compiler"]
//view
annotationProcessor(rootProject.ext.dependencies["butterknife-compiler"]) {
exclude module: 'support-annotations'
}
//test
testImplementation rootProject.ext.dependencies["junit"]
debugImplementation rootProject.ext.dependencies["canary-debug"]
releaseImplementation rootProject.ext.dependencies["canary-release"]
testImplementation rootProject.ext.dependencies["canary-release"]
}