У меня есть Kotlin Multi-Platform Gradle Multi-Project с двумя подпроектами:
- yass2-core : базовый проект
- yass2- хвост : зависит от yass2-core
версии: Gradle 6.3, Kotlin 1.3.71, Java 11.0.6
build.gradle.kts:
val coreProject = project("yass2-core") {
kotlin {
sourceSets {
val commonMain by getting {
dependencies {
api(kotlin("stdlib-common"))
}
}
val commonTest by getting {
dependencies {
}
}
}
}
}
project("yass2-tail") {
kotlin {
sourceSets {
val commonMain by getting {
dependencies {
api(coreProject)
}
}
val commonTest by getting {
dependencies {
implementation(project(":yass2-core", "commonTestImplementation"))
}
}
}
}
}
Зависимость main работает нормально, но зависимость test дает ошибку gradle:
Could not determine the dependencies of task ':yass2-tail:jvmTest'.
> Could not resolve all task dependencies for configuration ':yass2-tail:jvmTestRuntimeClasspath'.
> Could not resolve project :yass2-core.
Required by:
project :yass2-tail
> Selected configuration 'commonTestImplementation' on 'project :yass2-core'
but it can't be used as a project dependency because it isn't intended for consumption by other components.
Итак, как правильно определить зависимость test ?