Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.

Commit cdbd0ee

Browse files
committed
DoraemonKit 初步接入
1 parent 15acfeb commit cdbd0ee

File tree

7 files changed

+24
-1
lines changed

7 files changed

+24
-1
lines changed

.idea/dictionaries/Administrator.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
- [x] [Retrofit](https://github.com/square/retrofit/releases)
4141
- [x] [Moshi](https://github.com/square/moshi/releases)
4242
- [x] [LeakCanary](https://github.com/square/leakcanary/releases)
43+
- [x] [DoraemonKit](https://github.com/didi/DoraemonKit/releases)
4344
- [x] [Coil](https://github.com/coil-kt/coil/releases)
4445
- [x] [Glide](https://github.com/bumptech/glide/releases)
4546
- [x] [ARouter](https://github.com/alibaba/ARouter/releases)

buildSrc/src/main/kotlin/Dependency.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ private const val collectionVersion = "1.1.0"
5858
private const val bintrayPublishVersion = "1.0.0"
5959
private const val browserVersion = "1.3.0"
6060
private const val webKitVersion = "1.4.0"
61+
private const val doraemonKitVersion = "3.3.5"
6162
const val dependencyUpdateVersion = "0.36.0"
6263
const val kotlinterVersion = "3.3.0"
6364

@@ -120,6 +121,7 @@ object Libs {
120121
const val permissionX = "com.permissionx.guolindev:permissionx:$permissionXVersion"
121122
const val browser = "androidx.browser:browser:$browserVersion"
122123
const val webKit = "androidx.webkit:webkit:$webKitVersion"
124+
const val doraemonKit = "com.didichuxing.doraemonkit:dokitx:$doraemonKitVersion"
123125

124126
const val protobufPlugin = "com.google.protobuf:protobuf-gradle-plugin:$protobufVersion"
125127
const val arouterPlugin = "com.alibaba:arouter-register:$arouterRegisterVersion"

buildSrc/src/main/kotlin/ProjectConfig.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ fun DependencyHandler.implementation(vararg names: Any): Array<Dependency?> =
6565
add("implementation", it)
6666
}.toTypedArray()
6767

68+
fun DependencyHandler.debugImplementation(vararg names: Any): Array<Dependency?> =
69+
names.map {
70+
add("debugImplementation", it)
71+
}.toTypedArray()
72+
6873
fun DependencyHandler.kapt(vararg names: Any): Array<Dependency?> =
6974
names.map {
7075
add("kapt", it)
@@ -209,7 +214,6 @@ fun Project.setupApp(
209214
compileOptions.isCoreLibraryDesugaringEnabled = true
210215
dependencies.run {
211216
add("coreLibraryDesugaring", Libs.desugar)
212-
add("debugImplementation", Libs.leakCanary)
213217
}
214218
block()
215219
}

common/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@ dependencies {
77
Libs.okHttpLogInterceptor,
88
Libs.okHttpBrotliInterceptor
99
)
10+
debugImplementation(
11+
Libs.leakCanary,
12+
Libs.doraemonKit
13+
)
1014
}

common/src/main/kotlin/io/goooler/demoapp/common/CommonApplication.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package io.goooler.demoapp.common
22

33
import com.alibaba.android.arouter.launcher.ARouter
4+
import com.didichuxing.doraemonkit.DoraemonKit
45
import com.scwang.smart.refresh.footer.ClassicsFooter
56
import com.scwang.smart.refresh.header.ClassicsHeader
67
import com.scwang.smart.refresh.layout.SmartRefreshLayout
78
import io.goooler.demoapp.base.core.BaseApplication
9+
import io.goooler.demoapp.common.type.CommonConstants
810
import io.goooler.demoapp.common.util.CrashHandler
911
import io.goooler.demoapp.common.util.debugRun
1012

@@ -15,6 +17,7 @@ abstract class CommonApplication : BaseApplication() {
1517
CrashHandler.init()
1618
initArouter()
1719
initSmartRefresh()
20+
initDoKit()
1821
}
1922

2023
private fun initArouter() {
@@ -25,6 +28,10 @@ abstract class CommonApplication : BaseApplication() {
2528
ARouter.init(this)
2629
}
2730

31+
private fun initDoKit() {
32+
DoraemonKit.install(this, CommonConstants.DORAEMON_KIT_KEY)
33+
}
34+
2835
private fun initSmartRefresh() {
2936
SmartRefreshLayout.setDefaultRefreshHeaderCreator { context, refreshLayout ->
3037
refreshLayout.setPrimaryColorsId(

common/src/main/kotlin/io/goooler/demoapp/common/type/CommonConstants.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
@file:Suppress("SpellCheckingInspection")
2+
13
package io.goooler.demoapp.common.type
24

35
object CommonConstants {
6+
internal const val DORAEMON_KIT_KEY = "4a8c3eef29f029bc197705faad83f43d"
7+
48
const val DEFAULT_PAGE_SIZE = 20
59

610
object RequestFields {

0 commit comments

Comments
 (0)