Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 22, 2024. It is now read-only.

Dokka multiproject example using Gradle #103

Open
kamildoleglo wants to merge 2 commits into Kotlin:master
base: master
Choose a base branch
Loading
from kamildoleglo:add_dokka_multiproject_example

Conversation

Copy link
Contributor

@kamildoleglo kamildoleglo commented Mar 20, 2019

No description provided.

dokka {
externalDocumentationLink {
url = new URL("file://${project(":projectA").buildDir}/dokka/project-a/")
packageListUrl = new URL(url, "package-list")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work when publishing this documentation online? Does this create relative URLs? 🤔

Copy link
Contributor Author

@kamildoleglo kamildoleglo Mar 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well actually that depends. Some links are created as relative, regardless of this config, but some are not. For example the "all types" page is created with absolute paths, but the links in specific class pages are created with relative paths. I think it'll change in future versions of Dokka.
As for the publishing - I think you can set the URL to your domain (http://example.com/...) and create package list URL with local path (file://projectname/...) and that should work.
I didn't test it, though

@kamildoleglo kamildoleglo force-pushed the add_dokka_multiproject_example branch from 1533216 to d7f388a Compare August 29, 2019 09:26
Copy link

nateridderman-lilly commented Jun 24, 2020
edited
Loading

This fails for me when run locally.

$ ./gradlew.bat :projectA:dokka :projectB:dokka --stacktrace
> Task :projectB:dokka FAILED
...
1) Error injecting constructor, java.lang.RuntimeException: Exception while loading package-list from ExternalDocumentationLinkImpl(url=file://C:/Code/kotlin-examples/gradle/dokka-multiproject-gradle-example/projectA/build/dokka/project-a/, packageListUrl=file://C:/Code/kotlin-examples/gradle/dokka-multiproject-gradle-example/projectA/build/dokka/project-a/package-list)
...
Caused by: java.net.UnknownHostException: C
 at org.jetbrains.dokka.PackageListProvider.loadPackageList(ExternalDocumentationLinkResolver.kt:137)
 at org.jetbrains.dokka.PackageListProvider.<init>(ExternalDocumentationLinkResolver.kt:57)
 ... 83 more

Copy link
Contributor Author

The package-list from projectA has not been generated yet, that's probably why this error occurs. You should run ./gradlew dokka or ./gradlew :projectA:dokka && ./gradlew :projectB:dokka if you wanted to run separate tasks (although that's not the point of this example)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Reviewers
1 more reviewer

@pocmo pocmo pocmo left review comments

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /