Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Dokka: Generate aggregated API docs #691

Closed
pocmo opened this issue Aug 31, 2018 · 5 comments
Closed

Dokka: Generate aggregated API docs #691

pocmo opened this issue Aug 31, 2018 · 5 comments
Assignees
Labels
📖 documentation Writing code documentation, wiki articles, ..
Milestone

Comments

@pocmo
Copy link
Contributor

pocmo commented Aug 31, 2018

Currently we create separate API docs for all modules. Because of that you can't jump between modules in the documentation. For example if you are on the page about GeckoEngine you can't get to Engine because this class is in a different module.

┆Issue is synchronized with this Jira Task

@pocmo pocmo added the 📖 documentation Writing code documentation, wiki articles, .. label Aug 31, 2018
@pocmo pocmo added this to the 0.22 🍄 milestone Aug 31, 2018
@pocmo pocmo self-assigned this Aug 31, 2018
@pocmo
Copy link
Contributor Author

pocmo commented Sep 4, 2018

I wasn't able to come up with a satisfying solution on Friday.

The only thing about generating a multi module documentation is this issue in the dokka repository:
Kotlin/dokka#157

One of the mentioned solutions is to create a module just for generating the documentation and letting this module depend on all other modules. This sounds like it's too hacky for us and I was trying to avoid this.

I pushed my state here:
pocmo@f2df8f2

This branch does:

  • Generate a multi-module documentation
  • Links from classes to the source code on GitHub
  • Links to the Android documentation for Android classes
  • Links to the Kotlin documentation for Kotlin classes

It does not:

  • Major: Know about dependencies. For example the GeckoRuntime parameter in GeckoEngine is labelled as: runtime: <ERROR CLASS>
  • Minor: Group by "module"/"artifact" somewhere. You can only browse by package.

Also: telemetry has a different package layout and looks a bit weird in that mix: #698.

@pocmo
Copy link
Contributor Author

pocmo commented Sep 4, 2018

Dokka has a classpath parameter:

    // Manual adding files to classpath
    // This property not overrides classpath collected from kotlinTasks but appends to it
    classpath = [new File("$buildDir/other.jar")]

I assume that setting this to the "classpath" needed to compile the modules would resolve the issue of unknown classes. However I was unable to build this classpath dynamically.

Another thing I tried was adding GeckoView as a dependency to dokkapath but this didn't help resolving the classes.
pocmo@f2df8f2#diff-c197962302397baf3a4cc36463dce5eaR93

@csadilek csadilek self-assigned this Sep 6, 2018
csadilek added a commit to csadilek/android-components that referenced this issue Sep 6, 2018
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
csadilek added a commit to csadilek/android-components that referenced this issue Sep 6, 2018
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
@csadilek
Copy link
Contributor

csadilek commented Sep 6, 2018

Major: Know about dependencies. For example the GeckoRuntime parameter in GeckoEngine is labelled as: runtime:

I managed to solve this by dynamically constructing the classpath. The main piece of the puzzle was evaluationDependsOnChildren which makes sure the subprojects are evaluated before the dokka task runs. I have not been able to make this work in any other way. Now references to GV and Android SDK types are resolved properly. Sent #723 containing the changes.

@csadilek
Copy link
Contributor

csadilek commented Sep 6, 2018

Here's an example site for GeckoEngine:
screen shot 2018-09-06 at 17 54 34

@pocmo
Copy link
Contributor Author

pocmo commented Sep 7, 2018

@csadilek Awesome. Well done :)

csadilek added a commit to csadilek/android-components that referenced this issue Sep 7, 2018
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
csadilek added a commit to csadilek/android-components that referenced this issue Sep 7, 2018
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
csadilek added a commit to csadilek/android-components that referenced this issue Sep 7, 2018
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
csadilek added a commit to csadilek/android-components that referenced this issue Sep 7, 2018
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
@pocmo pocmo closed this as completed in 85bd539 Sep 7, 2018
vladikoff pushed a commit to vladikoff/android-components that referenced this issue Sep 17, 2018
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
📖 documentation Writing code documentation, wiki articles, ..
Projects
None yet
Development

No branches or pull requests

2 participants