-
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
Use Dokka instead of Javadoc #337
Conversation
I would say, it's because "UI/UX of the tool output" is better. |
ec0d66f
to
8d2061f
Compare
8d2061f
to
32f40f2
Compare
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 comments.
val dokkaConfDir = rootDir.resolve("buildSrc/src/main/kotlin/io/spine/internal/gradle/dokka") | ||
|
||
/** | ||
* Dokka Base configuration provides <code>customStyleSheets</code> property to which we can |
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.
This is Kotlin, so instead of <code>
please use the backticks:
... provides `customStyleSheets` property
/** | ||
* In order to modify the styles Dokka uses for the generated documentation we provide | ||
* a configuration to the Dokka Base Plugin. | ||
* @see <a href="https://kotlin.github.io/dokka/1.6.10/user_guide/base-specific/frontend/#prerequisites"> |
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.
Please have an empty line above @see
.
/** | ||
* Dokka Base configuration provides <code>customStyleSheets</code> property to which we can | ||
* pass our css files overriding styles generated by Dokka. | ||
* Also, there is a <code>customAssets</code> property to provide resources. We need to |
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.
Please allow an empty line between the paragraphs.
* Also, there is a <code>customAssets</code> property to provide resources. We need to | ||
* provide an image with the name "logo-icon.svg" to overwrite the default one used by Dokka. | ||
*/ | ||
val dokkaConf = """ |
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.
One thing missing from the configuration is as follows.
In the Javadoc artifact we have at the moment, the types annotated as @Internal
are stripped out. According to our definition of @Internal
, although these types are public
, we don't consider them being a part of the public API.
You should be able to tell it from your own experience by comparing the test output of Dokka for the client
module to the version we have online. A lot of types that Dokka has included, are intentionally excluded in the Javadoc version.
In the build-time codebase, it is performed via the special configuration of Javadoc doclet which excludes all @Internal
-annotated things from it. See ExcludeInternalDoclet
type in the buildSrc
.
With Dokka, an approach to achieve the same result seems to be different — as I can tell by reading the Dokka's manual. We should be able to exclude the types by tweaking the Dokka's configuration.
@@ -35,5 +35,6 @@ package io.spine.internal.gradle.publish | |||
internal enum class ArtifactTaskName { | |||
sourceJar, | |||
testOutputJar, | |||
javadocJar; | |||
javadocJar, |
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.
Another thing here is that today we are going to have one more PR merged to config
. In its scope, this code has been eliminated (probably, for good).
Once that request is merged, I'd like you to perform a back-merge from the master
branch into this feature branch. And adjust your code accordingly. Let's discuss in person any questions you might have.
This PR changes the tool which we use for generating a documentation artifact. Currently, we are using Javadoc. The PR switches it to Dokka. The reason behind this is the better UI/UX of the tool output. Side-by-side comparison of existing UI(Javadoc) vs the new one can be made by visiting the links below:
The list of things that were also done, except changing the generation of Javadoc JAR to Dokka JAR as a publish artifact, is provided below:
Dokka
object inio.spine.internal.dependency
for better readability and following already established code style for Gradle Plugin dependency object;private void demo()
becomesfun demo()
). More information can be found in this link.How created functionality can be used:
This automatically sets the output folder for this tool as "buildDirectory/docs/dokka" and configures dokka for a Java project.
Important details
Dokka loads many classes (especially for large multi-module projects), so it relies heavily on the Metaspace. It leads to the OutOfMemory exception on large projects. As suggested by Dokka developers and dev community you may need to manually increase MaxMetaspaceSize in your
gradle.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 there is still a possibility of the exception. For example,
core-java
did not raise any exceptions when using Dokka for generating documentation artifacts for every subproject as part ofpublish
task. Some things except mentioned above that could be helpful when dealing with the issue:--no-daemon
option when running as a CLI command.This PR is now on hold because Dokka documentation has a few issues which should be resolved first. The list of open issues can be found below: