-
Notifications
You must be signed in to change notification settings - Fork 1
/
subprojects.gradle
95 lines (85 loc) · 3.36 KB
/
subprojects.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
// 子项目配置
subprojects { project ->
afterEvaluate {
if (project.hasProperty("android")) {
android {
// 编译版本配置
compileSdkVersion versions.build.target_sdk
defaultConfig {
minSdkVersion versions.build.min_version
targetSdkVersion versions.build.target_sdk
versionCode versions.build.version_code
versionName versions.build.version_name
}
lintOptions {
checkReleaseBuilds false
// 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
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
}
} else {
println "==== with no android property: ${project.name} ===="
}
if (project.plugins.hasPlugin('com.android.library')) {
android {
buildTypes {
debug {
minifyEnabled false
consumerProguardFiles 'proguard-rules.pro'
}
release {
minifyEnabled true
consumerProguardFiles 'proguard-rules.pro'
}
}
}
if (project.name.contains('module')) {
println "==== add arguments: ${project.name} ===="
android {
defaultConfig {
javaCompileOptions {
annotationProcessorOptions {
arguments = ['MODULE_NAME': project.getName()]
}
}
}
}
}
} else if (project.plugins.hasPlugin('com.android.application')) {
android {
buildTypes {
debug {
shrinkResources false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
zipAlignEnabled true
shrinkResources true
minifyEnabled true
// Zipalign优化
zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
}
}
}