kotlinx-atomicfu
kotlinx-atomicfu copied to clipboard
Warning about compileOnly dependency with Kotlin 2.0.20-Beta1
When building a project that uses AtomicFU with Kotlin 2.0.20-Beta1, I get this warning:
w: A compileOnly dependency is used in targets: Kotlin/JS.
Dependencies:
- org.jetbrains.kotlinx:atomicfu:0.25.0 (source sets: jsMain)
Using compileOnly dependencies in these targets is not currently supported, because compileOnly dependencies must be present during the compilation of projects that depend on this project.
To ensure consistent compilation behaviour, compileOnly dependencies should be exposed as api dependencies.
Example:
kotlin {
sourceSets {
nativeMain {
dependencies {
compileOnly("org.example:lib:1.2.3")
// additionally add the compileOnly dependency as an api dependency:
api("org.example:lib:1.2.3")
}
}
}
}
This warning can be suppressed in gradle.properties:
kotlin.suppressGradlePluginWarnings=IncorrectCompileOnlyDependencyWarning