-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdepends_compose.gradle
219 lines (204 loc) · 8.27 KB
/
depends_compose.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
//Kotlin业务模块通用依赖
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'
android {
//编译版本
compileSdkVersion COMPILE_SDK_VERSION as int
buildToolsVersion BUILD_TOOLS_VERSION
//lint设置
lintOptions {
//lint 不被终止
abortOnError false
//打Release版本时,不进行检测
checkReleaseBuilds false
//关闭检索的功能
disable 'GoogleAppIndexingWarning'
}
//Java1.8支持
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
//Kotlin Java1.8支持
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
//构建功能
buildFeatures {
//支持 DataBinding
dataBinding = true
//支持 ViewBinding
viewBinding = true
//支持Compose
compose true
}
//单元测试,Robolectric支持
testOptions {
unitTests {
includeAndroidResources = true
}
}
//在本地单元测试中启用 @AndroidEntryPoint 类的转换
hilt {
enableTransformForLocalTests = true
}
//注解编译参数设置,Hilt需要开启
kapt {
correctErrorTypes true
}
//Compose支持
composeOptions {
kotlinCompilerExtensionVersion X_COMPOSE
kotlinCompilerVersion KOTLIN_VERSION
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
}
//将源代码打包进aar
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.javaDirectories
}
artifacts {
archives sourcesJar
}
//Gradle可以缓存SNAPSHOT构建,以确保Gradle始终选择构建的“最新”版本:
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
dependencies {
//arch-base
implementation project(':core-arch')
implementation project(':core-base')
implementation project(':core-utils')
kapt project(':core-arch-processor')
kapt project(':core-eventbus-processor')
//arch-test
testImplementation project(':core-test')
kaptTest project(':core-arch-processor')
kaptTest project(':core-eventbus-processor')
//Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${KOTLIN_VERSION}"
//Kotlin-协程
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:${KOTLIN_COROUTINES}"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${KOTLIN_COROUTINES}"
//Kotlin-协程_TEST
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:${KOTLIN_COROUTINES}"
//Kotlin-工具类
implementation "com.louiscad.splitties:splitties-toast:${SPLITTIES}"
//X_Core
implementation "androidx.core:core-ktx:${X_CORE}"
//X_APPCOMPAT
implementation "androidx.appcompat:appcompat:${X_APPCOMPAT}"
//X_Fragment
implementation "androidx.fragment:fragment-ktx:${X_FRAGMENT}"
testImplementation "androidx.fragment:fragment-testing:${X_FRAGMENT}"
//X_Lifecycle
implementation "androidx.lifecycle:lifecycle-livedata-ktx:${X_LIFECYCLE}"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${X_LIFECYCLE}"
implementation "androidx.lifecycle:lifecycle-common-java8:${X_LIFECYCLE}"
//X_Navigation
implementation "androidx.navigation:navigation-ui-ktx:${X_NAVIGATION}"
implementation "androidx.navigation:navigation-fragment-ktx:${X_NAVIGATION}"
//X_Material
implementation "com.google.android.material:material:${X_MATERIAL}"
//X_CardView
implementation "androidx.cardview:cardview:${X_CARD_VIEW}"
//X_RecyclerView
implementation "androidx.recyclerview:recyclerview:${X_RECYCLE_RVIEW}"
//X_ConstraintLayout
implementation "androidx.constraintlayout:constraintlayout:${X_CONSTRAINT}"
//X_ViewPager
implementation "androidx.viewpager2:viewpager2:${X_VIEWPAGER}"
//X_Paging
implementation "androidx.paging:paging-runtime-ktx:${X_PAGING}"
//X_WorkManager
implementation "androidx.work:work-runtime-ktx:${X_WORK}"
//X_START_UP
implementation "androidx.startup:startup-runtime:${X_START_UP}"
//X_Room
implementation "androidx.room:room-ktx:${X_ROOM}"
implementation "androidx.room:room-runtime:${X_ROOM}"
kapt "androidx.room:room-compiler:${X_ROOM}"
//X_Room_TEST
testImplementation "androidx.room:room-testing:${X_ROOM}"
kaptTest "androidx.room:room-compiler:${X_ROOM}"
//X_COMPOSE
implementation "androidx.compose.ui:ui:${X_COMPOSE}"
// Tooling support (Previews, etc.)
implementation "androidx.compose.ui:ui-tooling:${X_COMPOSE}"
// Foundation (Border, Background, Box, Image, Scroll, shapes, animations, etc.)
implementation "androidx.compose.foundation:foundation:${X_COMPOSE}"
// Material Design
implementation "androidx.compose.material:material:${X_COMPOSE}"
// Material design icons
implementation "androidx.compose.material:material-icons-core:${X_COMPOSE}"
implementation "androidx.compose.material:material-icons-extended:${X_COMPOSE}"
// Integration with activities
implementation "androidx.activity:activity-compose:${X_COMPOSE_ACTIVITY}"
// Integration with ViewModels
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:${X_LIFECYCLE}"
// Integration with observables
implementation "androidx.compose.runtime:runtime:${X_COMPOSE}"
implementation "androidx.compose.runtime:runtime-livedata:${X_COMPOSE}"
//X_Hilt
implementation "androidx.hilt:hilt-work:${X_HILT}"
kapt "androidx.hilt:hilt-compiler:${X_HILT}"
//X_Hilt_TEST
kaptTest "androidx.hilt:hilt-compiler:${X_HILT}"
//Hilt
implementation "com.google.dagger:hilt-android:${HILT}"
kapt "com.google.dagger:hilt-android-compiler:${HILT}"
//Hilt_TEST
testImplementation "com.google.dagger:hilt-android-testing:${HILT}"
kaptTest "com.google.dagger:hilt-android-compiler:${HILT}"
//Arouter
implementation "com.alibaba:arouter-api:${AROUTER_API}"
kapt "com.alibaba:arouter-compiler:${AROUTER_API}"
//Arouter_TEST
kaptTest "com.alibaba:arouter-compiler:${AROUTER_API}"
//OkHttp
implementation "com.squareup.okhttp3:okhttp:${OKHTTP}"
implementation "com.squareup.okhttp3:logging-interceptor:${OKHTTP}"
//OkHttp-TEST
testImplementation "com.squareup.okhttp3:mockwebserver:${OKHTTP}"
testImplementation "com.squareup.okhttp3:okhttp-tls:${OKHTTP}"
testImplementation "com.github.andrzejchm.RESTMock:android:${TEST_REST_MOCK}"
//Retrofit
implementation "com.squareup.retrofit2:retrofit:${RETROFIT}"
implementation "com.squareup.retrofit2:converter-gson:${RETROFIT}"
//单元测试-Android
testImplementation "androidx.test:runner:${TEST_X_RUNNER}"
testImplementation "androidx.test:core:${TEST_X_CORE}"
testImplementation "androidx.test:rules:${TEST_X_RULES}"
testImplementation "androidx.test.ext:junit:${TEST_X_JUNIT}"
testImplementation "androidx.test.espresso:espresso-core:${TEST_X_ESPRESSO}"
testImplementation "androidx.test.espresso:espresso-intents:${TEST_X_ESPRESSO}"
//单元测试
testImplementation "junit:junit:${TEST_JUNIT}"
testImplementation "org.robolectric:robolectric:${TEST_ROBOLECTRIC}"
testImplementation "org.mockito:mockito-core:${TEST_MOCKITO}"
testImplementation "org.mockito:mockito-inline:${TEST_MOCKITO}"//解决Mockito无法mock final class的问题
testImplementation "org.powermock:powermock-core:${TEST_POWER_MOCK}"
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:${TEST_MOCKITO_KOTLIN}"
//Json解析
implementation "com.google.code.gson:gson:${GSON}"
//Json动画Lottie
implementation "com.airbnb.android:lottie:${LOTTIE}"
//上下拉刷新SmartRefreshLayout
implementation "com.scwang.smart:refresh-layout-kernel:${SMART_REFRESH_LAYOUT}"
//RecyclerView适配器
implementation "com.github.CymChad:BaseRecyclerViewAdapterHelper:${BASE_RECYCLERVIEW_ADAPTER_HELPER}"
//日志展示
implementation "com.orhanobut:logger:${ORHANOBUT_LOGGER}"
//浏览器内核X5
implementation "com.tencent.tbs:tbssdk:${TBSSDK}"
//键值对存储Mmkv
implementation "com.tencent:mmkv:${MMKV}"
//Bug统计Bugly
implementation "com.tencent.bugly:crashreport:${BUGLY}"
}