-
Notifications
You must be signed in to change notification settings - Fork 755
/
Copy pathbuild.gradle
271 lines (246 loc) · 11.2 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
//设置app空壳始终是application模式
apply plugin: 'com.android.application'
//apply plugin: 'com.yc.spi.loader'
//apply plugin: 'com.yc.time.loader'
//关于debug工具依赖gradle,debug下依赖的
apply from: rootProject.file('debug.gradle')
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"]
applicationId "com.yc.lifehelper"
ndk {
abiFilters "armeabi", "armeabi-v7a" //, "x86", "mips"
}
// 64k
multiDexEnabled true
// 支持模糊视图
renderscriptSupportModeEnabled true
}
//签名
/*signingConfigs {
debug {
v1SigningEnabled true
v2SigningEnabled true
try {
def signP = getSigningProperties(true)
storeFile file(signP[0])
storePassword signP[1]
keyAlias signP[2]
keyPassword signP[3]
} catch (ex) {
ex.printStackTrace()
}
}
release {
v1SigningEnabled true
v2SigningEnabled true
try {
def signP = getSigningProperties(false)
storeFile file(signP[0])
storePassword signP[1]
keyAlias signP[2]
keyPassword signP[3]
} catch (ex) {
ex.printStackTrace()
}
}
}*/
buildTypes {
//正式
release {
buildConfigField "boolean", "IS_DEBUG", "false"
buildConfigField "String", "buildTime", "\"" + releaseTime() + "\""
//混淆
minifyEnabled true
//Zipalign优化
zipAlignEnabled true
// 移除无用的resource文件
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
//仿真
release {
buildConfigField "boolean", "IS_DEBUG", "false"
buildConfigField "String", "buildTime", "\"" + releaseTime() + "\""
//混淆
minifyEnabled false
//Zipalign优化
zipAlignEnabled true
// 移除无用的resource文件
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
//测试
debug{
buildConfigField "boolean", "IS_DEBUG", "true"
buildConfigField "String", "buildTime", "\"" + releaseTime() + "\""
//混淆
minifyEnabled false
//Zipalign优化
zipAlignEnabled true
// 移除无用的resource文件
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
//jdk1.8
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
//避免项目中存在相同的jar包,导致运行失败
dexOptions {
preDexLibraries = false
}
//fix:Failed resolution of: Landroidx/databinding/DataBinderMapperImpl;
//问题:使用dataBinding 时报错
//原因:使用模块化项目时,子模块使用dataBinding ,主app 也要添加dataBinding支持
buildFeatures {
dataBinding = true
viewBinding = true
}
//出现错误的原因是:AndroidStudio严格审查png图片,就是png没有达到AndroidStudio的要求
//注:最重要的就是.9图要严格要求做好。禁止Gradle检查PNG的合法性
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
//lint配置信息,这里主要是设置自定义lint检测后报告路径,LintOptions类型
//命令行:gradlew lint 注意,studio自带lint检查,setting——> Inspection
// lintOptions {
// println("开始执行lint检测代码逻辑")
// // 设置为 true,则当 Lint 发现错误时停止 Gradle 构建
// //移除lint检测的error
// abortOnError false
// // 设置为 true,则当有错误时会显示文件的全路径或绝对路径 (默认情况下为true)
// absolutePaths true
// // 仅检查指定的问题(根据 id 指定)
// check 'NewApi', 'InlinedApi'
// // 设置为 true 则检查所有的问题,包括默认不检查问题
// checkAllWarnings true
// // 设置为 true 后,release 构建都会以 Fatal 的设置来运行 Lint。
// // 如果构建时发现了致命(Fatal)的问题,会中止构建(具体由 abortOnError 控制)
// checkReleaseBuilds true
// // 不检查指定的问题(根据问题 id 指定)
// disable 'TypographyFractions','TypographyQuotes'
// // 检查指定的问题(根据 id 指定)
// enable 'RtlHardcoded','RtlCompat', 'RtlEnabled'
// // 在报告中是否返回对应的 Lint 说明
// explainIssues true
// // 写入报告的路径,默认为构建目录下的 lint-results.html
// //htmlOutput file("lint-report.html")
// // 设置为 true 则会生成一个 HTML 格式的报告
// htmlReport true
// // 设置为 true 则只报告错误
// ignoreWarnings true
// // 重新指定 Lint 规则配置文件
// //lintConfig file("default-lint.xml")
// // 设置为 true 则错误报告中不包括源代码的行号
// noLines true
// // 设置为 true 时 Lint 将不报告分析的进度
// quiet true
// // 设置为 true 则显示一个问题所在的所有地方,而不会截短列表
// showAll true
// // 配置写入输出结果的位置,格式可以是文件或 stdout
// textOutput 'stdout'
// // 设置为 true,则生成纯文本报告(默认为 false)
// textReport false
// // 设置为 true,则会把所有警告视为错误处理
// warningsAsErrors true
// // 写入检查报告的文件(不指定默认为 lint-results.xml)
// //xmlOutput file("lint-report.xml")
// // 设置为 true 则会生成一个 XML 报告
// xmlReport false
// // 将指定问题(根据 id 指定)的严重级别(severity)设置为 Fatal
// fatal 'NewApi', 'InlineApi'
// // 将指定问题(根据 id 指定)的严重级别(severity)设置为 Error
// error 'Wakelock', 'TextViewEdits'
// // 将指定问题(根据 id 指定)的严重级别(severity)设置为 Warning
// warning 'ResourceAsColor'
// // 将指定问题(根据 id 指定)的严重级别(severity)设置为 ignore
// ignore 'TypographyQuotes'
// }
}
static def releaseTime() {
return new Date().format("MMddHHmmss", TimeZone.getTimeZone("Asia/Shanghai"))
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation(rootProject.ext.dependencies["appcompat"])
implementation(rootProject.ext.dependencies["annotation"])
implementation(rootProject.ext.dependencies["material"])
implementation project(path: ':CustomWidget')
implementation project(path: ':CountTimerLib')
implementation project(path: ':ToolUtilsLib')
// implementation project(path: ':DemoBusiness')
// implementation project(path: ':StatusBusiness')
implementation project(path: ':AppStatusLib')
implementation project(path: ':LocaleHelperLib')
implementation project(path: ':MonitorKeepAlive')
implementation project(path: ':HttpServer')
implementation project(path: ':LibraryLayer')
implementation project(path: ':ImageServer')
implementation project(path: ':ZxingServerLib')
implementation project(path: ':NfcServer')
implementation project(path: ':LongAliveLib')
implementation project(path: ':MonitorNetLib')
implementation project(path: ':BannerViewLib')
implementation project(path: ':BlurViewLib')
implementation project(path: ':ActivityManager')
implementation project(path: ':AppSwitchView')
implementation project(path: ':ApplicationLib')
implementation project(path: ':MonitorFileLib')
implementation project(path: ':MonitorNetLib')
implementation project(path: ':MonitorCrashLib')
implementation project(path: ':MonitorCatonLib')
implementation project(path: ':MonitorAnrLib')
implementation project(path: ':MonitorAliveLib')
// implementation project(path: ':LeakCanarySdk')
implementation(rootProject.ext.dependencies["AutoCloserLib"])
//implementation project(path: ':AutoCloserLib')
// implementation(rootProject.ext.dependencies["AppStartLib"])
implementation project(path: ':ParallelTaskLib')
// implementation project(path: ':MvpTodoBusiness')
// implementation project(path: ':MvvmDatabinding')
// implementation project(path: ':MvvmTodoLive')
// implementation project(path: ':MvcTodoBusiness')
implementation project(path: ':BusinessInterface')
implementation project(path: ':ThreadPoolLib')
// implementation project(path: ':JetpackBusiness')
implementation project(path: ':AppProcessLib')
implementation project(path: ':NotifyMessage')
implementation project(path: ':BaseClassLib')
implementation project(path: ':AppTraceTool')
implementation project(path: ':AppLogLib')
// implementation project(path: ':BleBusiness')
implementation project(path: ':AppBaseStore')
implementation project(path: ':AppCommon')
// implementation project(path: ':ThreadBusiness')
// implementation project(path: ':NotifyBusiness')
// implementation project(path: ':KotlinBusiness')
implementation project(path: ':MonitorFpsLib')
implementation project(path: ':AppCommonInter')
implementation project(path: ':AppLogClient')
implementation project(path: ':AppLogService')
implementation project(path: ':MonitorTimeLib')
implementation project(path: ':NtpTimeLib')
implementation project(path: ':AppWidget')
implementation project(path: ':MonitorPhone')
implementation project(path: ':MonitorPingLib')
implementation project(path: ':EventUploadLib')
// implementation project(path: ':MonitorPrivacy')
// implementation 'com.github.yangchong211.YCAppTool:BlurViewLib:1.3.7'
// implementation 'com.github.yangchong211.YCAppTool:BannerViewLib:1.3.7'
// implementation 'com.github.yangchong211.YCAppTool:NfcServer:1.3.7'
// implementation 'com.github.yangchong211.YCAppTool:ZxingServerLib:1.3.7'
// implementation 'com.github.yangchong211.YCAppTool:AppStatusLib:1.3.7'
// implementation 'com.github.yangchong211.YCAppTool:SerialTaskLib:1.3.7'
implementation(rootProject.ext.dependencies["RoundCorners"])
implementation(rootProject.ext.dependencies["CardViewLib"])
implementation(rootProject.ext.dependencies["RedDotView"])
implementation(rootProject.ext.dependencies["EasyExecutor"])
implementation(rootProject.ext.dependencies["ThreadTaskLib"])
}