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

dokka-core should use api instead implementation #1724

Closed
elect86 opened this issue Feb 3, 2021 · 0 comments · Fixed by #1771
Closed

dokka-core should use api instead implementation #1724

elect86 opened this issue Feb 3, 2021 · 0 comments · Fixed by #1771
Labels

Comments

@elect86
Copy link

elect86 commented Feb 3, 2021

Describe the bug

If I try to apply Dokka to a precompiled script, I get

Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
    class org.jetbrains.dokka.gradle.GradleDokkaSourceSetBuilder, unresolved supertypes: org.jetbrains.dokka.DokkaConfigurationBuilder

Unless I add dokka-core as well

dependencies {
    implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.4.20")
    implementation("org.jetbrains.dokka:dokka-core:1.4.20") // this
}

Expected behaviour

Working fine without dokka-core

To Reproduce

Clone this, tmp branch and try to sync

Dokka configuration

dokkaHtml {
    dokkaSourceSets.configureEach {
        sourceLink { // here the problem
            localDirectory.set(file("src/main/kotlin"))
            remoteUrl.set(URL("https://github.com/kotlin-graphics/kotlin-unsigned/tree/master/src/main/kotlin"))
            remoteLineSuffix.set("#L")
        }
    }
    finalizedBy(netlifyBadge)
}

Installation

  • Operating system: macOS/Windows/Linux
  • Build tool: Gradle v6.8.1
  • Dokka version: 1.4.20

Additional context

Kudos to Björn for finding this out!

The problem is that the dokka-gradle-plugin here:

implementation(project(":core"))

defines dokka-core as implementation dependency, but then uses classes from dokka-core in the API, for example here:
where DokkaConfigurationBuilder is used as superclass and thus is part of the API and is needed by downstream projects in their compile class path.
So it should actually declare it as api dependency, not implementation dependency.
Adding dokka-core manually to your compile class path like you did works around this bug,
but imho you should report this to the dokka project.

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

Successfully merging a pull request may close this issue.

1 participant