-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
197 lines (164 loc) · 7.24 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
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
}
apply from: '../common.gradle'
android {
defaultConfig {
applicationId "com.dzl.duanzil"
}
buildFeatures {
//android.dataBinding.enabled has been replace to android.buildFeatures.dataBinding
dataBinding = true
}
// Apk 签名的那些事:https://www.jianshu.com/p/a1f8e5896aa2
signingConfigs {
config {
storeFile file(StoreFile)
storePassword StorePassword
keyAlias KeyAlias
keyPassword KeyPassword
}
}
buildTypes {
release {
debuggable false
jniDebuggable true
zipAlignEnabled true
shrinkResources true
minifyEnabled true
signingConfig signingConfigs.config
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField "String", "API_BASE", "\"http://tools.cretinzp.com/jokes/\""
buildConfigField "boolean", "DEBUG", 'false'
// 仅保留两种架构的 so 库,根据 Bugly 统计得出
ndk {
// armeabi:万金油架构平台(占用率:0%)
// armeabi-v7a:曾经主流的架构平台(占用率:10%)
// arm64-v8a:目前主流架构平台(占用率:95%)
abiFilters 'armeabi-v7a', 'arm64-v8a'
}
}
debug {
// 调试模式开关
debuggable true
jniDebuggable true
// 压缩对齐开关
zipAlignEnabled false
// 移除无用的资源
shrinkResources false
// 代码混淆开关
minifyEnabled false
signingConfig signingConfigs.config
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField "String", "API_BASE", "\"http://tools.cretinzp.com/jokes/\""
buildConfigField "boolean", "DEBUG", 'true'
// 调试模式下只保留一种架构的 so 库,提升打包速度
ndk {
abiFilters 'armeabi-v7a'
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
applicationVariants.all { variant ->
// apk 输出文件名配置
variant.outputs.all { output ->
outputFileName = rootProject.getName() + '_v' + variant.versionName + '_' + variant.buildType.name
if (variant.buildType.name == buildTypes.release.getName()) {
outputFileName += '_' + new Date().format('MMdd')
}
outputFileName += '.apk'
}
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation "androidx.activity:activity-ktx:1.5.1"
implementation "androidx.fragment:fragment-ktx:1.5.1"
implementation project(':library:base')
implementation project(':library:camerax')
implementation project(':video:dkplayer-java')
implementation project(':video:dkplayer-ui')
implementation project(':video:dkplayer-videocache')
implementation project(':video:dkplayer-players:exo')
implementation project(':video:dkplayer-players:ijk')
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation 'com.github.hackware1993:MagicIndicator:1.7.0'
//沉浸式
implementation 'com.gyf.immersionbar:immersionbar:3.0.0'
implementation "com.gyf.immersionbar:immersionbar-components:3.0.0"
implementation "com.gyf.immersionbar:immersionbar-ktx:3.0.0"
// 日志打印框架:https://github.com/JakeWharton/timber
implementation 'com.jakewharton.timber:timber:4.7.1'
//MMKV
implementation 'com.tencent:mmkv-static:1.2.10'
// 吐司框架
implementation 'com.github.getActivity:ToastUtils:9.5'
//网络框架
implementation 'com.github.LvKang-insist:LvHttp:1.2.0'
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
//协程基础库
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1"
//协程 Android 库,提供 UI 调度器
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1"
// viewModel 的ktx扩展
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.5.1"
//rv适配器
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.7'
//屏幕适配
implementation 'com.github.JessYanCoding:AndroidAutoSize:v1.2.1'
//刷新组件
implementation 'io.github.scwang90:refresh-layout-kernel:2.0.5'
implementation 'io.github.scwang90:refresh-header-material:2.0.5'
implementation 'io.github.scwang90:refresh-footer-ball:2.0.5'
implementation 'io.github.scwang90:refresh-footer-classics:2.0.5'
implementation 'com.github.bumptech.glide:glide:4.13.0'
kapt 'com.github.bumptech.glide:compiler:4.13.0'
implementation 'jp.wasabeef:glide-transformations:4.3.0'
//图像视图
implementation 'com.davemorrissey.labs:subsampling-scale-image-view-androidx:3.10.0'
//嵌套滚动容器
implementation 'com.github.donkingliang:ConsecutiveScroller:4.6.1'
// PictureSelector 基础 (必须)
implementation 'io.github.lucksiege:pictureselector:v3.0.5'
// 图片压缩 (按需引入)
implementation 'io.github.lucksiege:compress:v3.0.5'
// 图片裁剪 (按需引入)
implementation 'io.github.lucksiege:ucrop:v3.0.5'
//视频压缩
implementation 'com.github.yellowcath:VideoProcessor:2.4.2'
//权限处理
implementation 'com.guolindev.permissionx:permissionx:1.6.4'
//Banner
implementation 'io.github.youth5201314:banner:2.2.2'
// 多语种:https://github.com/getActivity/MultiLanguages
// 悬浮窗:https://github.com/getActivity/XToast
// 日志输出:https://github.com/getActivity/Logcat
// 工具类:https://github.com/Blankj/AndroidUtilCode
// 轮播图:https://github.com/bingoogolapple/BGABanner-Android
// 二维码:https://github.com/bingoogolapple/BGAQRCode-Android
// 跑马灯:https://github.com/sunfusheng/MarqueeView
// 对象注解:https://www.jianshu.com/p/f1f888e4a35f
// 对象存储:https://github.com/leavesC/DoKV
// 多渠道打包:https://github.com/Meituan-Dianping/walle
// 设备唯一标识:http://msa-alliance.cn/col.jsp?id=120
// 嵌套滚动容器:https://github.com/donkingliang/ConsecutiveScroller
// 隐私调用监控:https://github.com/huage2580/PermissionMonitor
}