diff --git a/backend/mirai-console/build.gradle.kts b/backend/mirai-console/build.gradle.kts index 6aad5bba4..3bb13026b 100644 --- a/backend/mirai-console/build.gradle.kts +++ b/backend/mirai-console/build.gradle.kts @@ -65,10 +65,9 @@ dependencies { compileAndTestRuntime(kotlinx("serialization-core", Versions.serialization)) compileAndTestRuntime(kotlin("reflect")) - implementation("org.jetbrains:annotations:19.0.0") - + smartImplementation("net.mamoe.yamlkt:yamlkt:${Versions.yamlkt}") + smartImplementation("org.jetbrains:annotations:19.0.0") smartApi(kotlinx("coroutines-jdk8", Versions.coroutines)) - smartApi("net.mamoe.yamlkt:yamlkt:${Versions.yamlkt}") testApi("net.mamoe:mirai-core-qqandroid:${Versions.core}") testApi(kotlin("stdlib-jdk8")) diff --git a/buildSrc/src/main/kotlin/dependencyExtensions.kt b/buildSrc/src/main/kotlin/dependencyExtensions.kt index d1b817404..76b6fd9b5 100644 --- a/buildSrc/src/main/kotlin/dependencyExtensions.kt +++ b/buildSrc/src/main/kotlin/dependencyExtensions.kt @@ -26,9 +26,22 @@ fun DependencyHandler.compileAndTestRuntime(any: Any) { fun DependencyHandler.smartApi( dependencyNotation: String +): ExternalModuleDependency { + return smart("api", dependencyNotation) +} + +fun DependencyHandler.smartImplementation( + dependencyNotation: String +): ExternalModuleDependency { + return smart("implementation", dependencyNotation) +} + +private fun DependencyHandler.smart( + configuration: String, + dependencyNotation: String ): ExternalModuleDependency { return addDependencyTo( - this, "api", dependencyNotation + this, configuration, dependencyNotation ) { fun exclude(group: String, module: String) { exclude(mapOf(