Import yamlkt using 'implementation', improve buildscript

This commit is contained in:
Him188 2020-09-20 21:32:05 +08:00
parent e10a17ccd4
commit 71a02e7630
2 changed files with 16 additions and 4 deletions

View File

@ -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"))

View File

@ -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(