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

DAGP fails to recognize KMP project dependencies #1345

Open
realdadfish opened this issue Dec 19, 2024 · 1 comment
Open

DAGP fails to recognize KMP project dependencies #1345

realdadfish opened this issue Dec 19, 2024 · 1 comment

Comments

@realdadfish
Copy link

realdadfish commented Dec 19, 2024

I have a multiplatform component with several modules that have dependencies under one another, i.e. kmp-module depends on kmp-dep1 and kmp-dep2 modules as well as kotlin-stdlib naturally.

Now DAGP reports this:

Advice for :kmp-module
These transitive dependencies should be declared directly:
  api("org.jetbrains.kotlin:kotlin-stdlib:2.0.21")
  api(project(":kmp-dep1"))
  api(project(":kmp-dep2"))

which is what I'm already doing:

kotlin {
    applyDefaultHierarchyTemplate()
    sourceSets {
        commonMain.dependencies {
            api(kotlin("stdlib"))
            // using Gradle project accessors, but makes no difference 
            // if old-style project(":kmp-dep1") syntax is used
            api(projects.kmpDep1)
            api(projects.kmpDep2)
        }
        androidMain.dependencies { ... }
        desktopMain.dependencies { ... }
    }
}

Other non-project KMP dependencies are not flagged. Also, it makes no difference if I repeat the specific api declarations in the other two source sets, androidMain and desktopMain. This is with DAGP 2.6.1.

$ gradle --version

------------------------------------------------------------
Gradle 8.10.1
------------------------------------------------------------

Build time:    2024-09-09 07:42:56 UTC
Revision:      8716158d3ec8c59e38f87a67f1f311f297b79576

Kotlin:        1.9.24
Groovy:        3.0.22
Ant:           Apache Ant(TM) version 1.10.14 compiled on August 16 2023
Launcher JVM:  17.0.9 (Eclipse Adoptium 17.0.9+9)
Daemon JVM:    /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home (no JDK specified, using current Java home)
OS:            Mac OS X 14.6.1 aarch64
@realdadfish realdadfish changed the title DAGP fails to assess KMP dependencies as being present DAGP fails to recognize KMP project dependencies Dec 19, 2024
@realdadfish
Copy link
Author

Side-note, the stdlib dependency is suggested whether or not I configured a bundle for "org.jetbrains.kotlin". Seems to be similar to #658.

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

No branches or pull requests

1 participant