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

Commit 225189b

Browse files
committed
正式包添加 DoKit 依赖
1 parent cdbd0ee commit 225189b

File tree

6 files changed

+16
-6
lines changed

6 files changed

+16
-6
lines changed

buildSrc/src/main/kotlin/Dependency.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ object Libs {
121121
const val permissionX = "com.permissionx.guolindev:permissionx:$permissionXVersion"
122122
const val browser = "androidx.browser:browser:$browserVersion"
123123
const val webKit = "androidx.webkit:webkit:$webKitVersion"
124-
const val doraemonKit = "com.didichuxing.doraemonkit:dokitx:$doraemonKitVersion"
124+
const val doraemonKitDebug = "com.didichuxing.doraemonkit:dokitx:$doraemonKitVersion"
125+
const val doraemonKitRelease = "com.didichuxing.doraemonkit:dokitx-no-op:$doraemonKitVersion"
125126

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

buildSrc/src/main/kotlin/Enum.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ enum class BuildConfigField(val tag: String) {
2323
VersionCode("VERSION_CODE"),
2424
VersionName("VERSION_NAME"),
2525
CdnPrefix("CDN_PREFIX"),
26-
ApiHost("API_HOST")
26+
ApiHost("API_HOST"),
27+
DoraemonKitKey("DORAEMON_KIT_KEY")
2728
}
2829

2930
enum class GradleTask(val task: String) {

buildSrc/src/main/kotlin/ProjectConfig.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ fun DependencyHandler.debugImplementation(vararg names: Any): Array<Dependency?>
7070
add("debugImplementation", it)
7171
}.toTypedArray()
7272

73+
fun DependencyHandler.releaseImplementation(vararg names: Any): Array<Dependency?> =
74+
names.map {
75+
add("releaseImplementation", it)
76+
}.toTypedArray()
77+
7378
fun DependencyHandler.kapt(vararg names: Any): Array<Dependency?> =
7479
names.map {
7580
add("kapt", it)
@@ -231,6 +236,10 @@ private fun Project.setupCommon(module: Module? = null): BaseExtension {
231236
putBuildConfigStringField(BuildConfigField.VersionName.tag, globalVersionName)
232237
putBuildConfigStringField(BuildConfigField.CdnPrefix.tag, cdnPrefix)
233238
putBuildConfigStringField(BuildConfigField.ApiHost.tag, apiHosts[name])
239+
putBuildConfigStringField(
240+
BuildConfigField.DoraemonKitKey.tag,
241+
"4a8c3eef29f029bc197705faad83f43d"
242+
)
234243
}
235244
}
236245
}

common/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dependencies {
99
)
1010
debugImplementation(
1111
Libs.leakCanary,
12-
Libs.doraemonKit
12+
Libs.doraemonKitDebug
1313
)
14+
releaseImplementation(Libs.doraemonKitRelease)
1415
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import com.scwang.smart.refresh.footer.ClassicsFooter
66
import com.scwang.smart.refresh.header.ClassicsHeader
77
import com.scwang.smart.refresh.layout.SmartRefreshLayout
88
import io.goooler.demoapp.base.core.BaseApplication
9-
import io.goooler.demoapp.common.type.CommonConstants
109
import io.goooler.demoapp.common.util.CrashHandler
1110
import io.goooler.demoapp.common.util.debugRun
1211

@@ -29,7 +28,7 @@ abstract class CommonApplication : BaseApplication() {
2928
}
3029

3130
private fun initDoKit() {
32-
DoraemonKit.install(this, CommonConstants.DORAEMON_KIT_KEY)
31+
DoraemonKit.install(this, BuildConfig.DORAEMON_KIT_KEY)
3332
}
3433

3534
private fun initSmartRefresh() {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
package io.goooler.demoapp.common.type
44

55
object CommonConstants {
6-
internal const val DORAEMON_KIT_KEY = "4a8c3eef29f029bc197705faad83f43d"
76

87
const val DEFAULT_PAGE_SIZE = 20
98

0 commit comments

Comments
 (0)