Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning about compileOnly dependency with Kotlin 2.0.20-Beta1 #448

Open
lukellmann opened this issue Jun 30, 2024 · 1 comment
Open

Warning about compileOnly dependency with Kotlin 2.0.20-Beta1 #448

lukellmann opened this issue Jun 30, 2024 · 1 comment
Labels

Comments

@lukellmann
Copy link

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
@mvicsokolova
Copy link
Collaborator

This is a new warning introduced in 2.0.20. When JS transformations are enabled (kotlinx.atomicfu.enableJsIrTransformation=true), atomicfu-gradle-plugin adds compileOnly dependency to the library, causing this warning.

This warning is not going to become an error, though users of the Kord library might be affected.
I will replace compileOnly with api dependency in the next kotlinx-atomicfu release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants