-
Notifications
You must be signed in to change notification settings - Fork 3
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
Extend Dokka support #352
Extend Dokka support #352
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tripolkaandrey please see my comment.
* | ||
* The resulting artifact is available under "dokka" classifier. | ||
*/ | ||
var includeDokkaJar = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this expression syntactically similar to protoJar
(see above).
Also, the naming is important. We drop "include" prefix in order to make the whole thing shorter. Imagine if we don't:
spinePublishing {
// ...
includeTestJar { ... }
includeProtoJar { ... }
includeDokkaJar ...
}
Notice how much space this "include" takes? And the person who reads this needs to traverse down to the meaningful part, skipping "include" every time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Preface
This PR extends Dokka support for our projects. It should give an option of a smooth migration from Javadoc to Dokka documentation generation. The reason behind this is the better UI/UX of the tool output. A side-by-side comparison of the existing UI(Javadoc) vs the new one can be made by visiting the links below:
What's new?
Dokka documentation as a publish artifact
A new option was added to include
dokkaJar
as an artifact. By default, this option is set tofalse
. The artifact can be included using the following setup:Use Dokka in Java projects
A new script plugin was created to ease adding Dokka to a Java project.
Firstly, The plugin configures Dokka for a Java project. As Dokka is initially developed for Kotlin projects, without the proper setup, it "sees Java code as Kotlin one"(for example, the documentation for method
void demo()
becomesfun demo()
). More information can be found here.Secondly, it keeps sure that things annotated with
@Internal
are not present in the resulting documentation. This is done by using the custom Dokka plugin fromdokka-extensions
.Lastly, things this plugin also takes care of:
How created functionality can be used:
Important details
Dokka loads many classes (especially for large multi-module projects), relying heavily on the Metaspace. It leads to the
OutOfMemory
exception on large projects. As suggested by Dokka developers and community you may need to manually set MaxMetaspaceSize in yourgradle.properties
. This could be done by adding the following line:The 1.6.10 version of Dokka deals with Metaspace much better than previous versions, but the exception is still possible. For example,
core-java
did not raise any exceptions when using Dokka for generating documentation artifacts for every subproject as part of thepublish
task. Some things that could also be helpful when dealing with the issue:--no-daemon
option when running as a CLI command.