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

Incorrect localDirectory after updating to Dokka 1.5.0 #2024

Closed
breandan opened this issue Jul 13, 2021 · 4 comments
Closed

Incorrect localDirectory after updating to Dokka 1.5.0 #2024

breandan opened this issue Jul 13, 2021 · 4 comments
Assignees
Labels

Comments

@breandan
Copy link

breandan commented Jul 13, 2021

After updating to Dokka 1.5.0, the sourceLink.localDirectory was detected as /core/core/ instead of /core/. Please see the error below:

* What went wrong:
Some problems were found with the configuration of task ':kotlingrad:dokkaHtmlPartial' (type 'DokkaTaskPartial').
  - In plugin 'org.jetbrains.dokka.gradle.DokkaPlugin' type 'org.jetbrains.dokka.gradle.DokkaTaskPartial' property 'unsuppressedSourceSets.$0.sourceLinks.$0.localDirectory' specifies directory '/home/runner/work/kotlingrad/kotlingrad/core/core/src/main/kotlin' which doesn't exist.
    
    Reason: An input file was expected to be present but it doesn't exist.

This is my Dokka configuration from the project's main build.gradle.kts:

subprojects {
  apply<DokkaPlugin>()

  tasks.withType<DokkaTaskPartial> {
    dokkaSourceSets.configureEach {
      jdkVersion.set(15)

      sourceLink {
        localDirectory.set(file("core/src/main/kotlin"))
        remoteUrl.set(URL("https://github.com/breandan/kotlingrad/blob/master/core/src/main/kotlin"))
        remoteLineSuffix.set("#L")
      }

      sourceLink {
        localDirectory.set(file("samples/src/main/kotlin"))
        remoteUrl.set(URL("https://github.com/breandan/kotlingrad/blob/master/samples/src/main/kotlin"))
        remoteLineSuffix.set("#L")
      }

      perPackageOption {
        matchingRegex.set("(.*?)")
        suppress.set(true)
      }

      perPackageOption {
        matchingRegex.set("edu.umontreal.kotlingrad.*")
        suppress.set(false)
      }

      externalDocumentationLink("https://ejml.org/javadoc/")
    }
  }
}

Here is the full stack trace from running ./gradlew dokkaHtmlMultiModule --no-daemon --no-parallel --stacktrace -Dorg.gradle.jvmargs="-XX:MaxMetaspaceSize=2G" I received after updating to Dokka 1.5.0.

@breandan breandan added the bug label Jul 13, 2021
breandan added a commit to breandan/kotlingrad that referenced this issue Jul 13, 2021
@breandan breandan changed the title Incorrect project root after updating to Dokka 1.5.0 Incorrect localDirectory after updating to Dokka 1.5.0 Jul 13, 2021
@MarcinAman
Copy link
Contributor

I can't debug your case since this project fails to resolve artifactcom.github.breandan:kaliningraph:0.1.7

@breandan
Copy link
Author

breandan commented Sep 18, 2021

I have migrated our project off JitPack, so the above issue should now be resolved. Here is the build log after updating from Dokka 1.4.32 to 1.5.30: https://gist.github.com/breandan/5685325b2f683aa866735381e4b81650

For the specific commit, please see breandan/kotlingrad@94b8e72. Previously the Dokka workflow completed successfully, but after updating to 1.5.30 it failed. Please let me know if you need any additional information to help debug. Thanks!

@IgnatBeresnev
Copy link
Member

The problem seems quite strange, so instead of trying to figure out what exactly happened 2 major releases ago, I went ahead and fixed Dokka in the linked project, see breandan/kotlingrad#31. Source links work as expected there.

Hopefully this resolves the issue, so I'm closing it for now. Do let us know if you experience anything similar to this.

@breandan
Copy link
Author

Wow, thank you for investigating this issue and the kind contribution. Much appreciated!

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

3 participants