Skip to content

Commit

Permalink
update Java example project to demonstrate feature variants (#217)
Browse files Browse the repository at this point in the history
- add new subproject to the java-example project, to demonstrate how to enable feature-variant source sets
- test the java-example project
  • Loading branch information
aSemy authored Apr 8, 2024
1 parent 4e0f7a7 commit b9af4a8
Show file tree
Hide file tree
Showing 71 changed files with 4,941 additions and 5 deletions.
9 changes: 9 additions & 0 deletions examples/java-example/dokkatoo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
This project demonstrates how Dokkatoo can be applied to a pure Java project
to generate documentation.

This project has multiple modules.

* [my-java-application](./my-java-application) is a Java Application
* [my-java-application](./my-java-features) is a Java Library, demonstrating
[feature variants](https://docs.gradle.org/current/userguide/feature_variants.html).
* [my-java-application](./my-java-library) is a Java Library

### Demonstration

To generate HTML documentation, run
Expand All @@ -11,6 +18,8 @@ To generate HTML documentation, run
gradle :dokkatooGeneratePublicationHtml
```

The HTML documentation will be generated into [build/dokka/html](./build/dokka/html/).

### Implementation details

Note that the `org.jetbrains.dokka:kotlin-as-java-plugin` Dokka Plugin
Expand Down
1 change: 1 addition & 0 deletions examples/java-example/dokkatoo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {

dependencies {
dokkatoo(project(":my-java-application"))
dokkatoo(project(":my-java-features"))
dokkatoo(project(":my-java-library"))

dokkatooPluginHtml("org.jetbrains.dokka:templating-plugin")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,5 @@ dokkatoo {
}

dependencies {
dokkatooPluginHtml("org.jetbrains.dokka:kotlin-as-java-plugin")
dokkatooPluginJavadoc("org.jetbrains.dokka:kotlin-as-java-plugin")
dokkatooPluginJekyll("org.jetbrains.dokka:kotlin-as-java-plugin")
dokkatooPluginGfm("org.jetbrains.dokka:kotlin-as-java-plugin")
dokkatooPlugin("org.jetbrains.dokka:kotlin-as-java-plugin")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
plugins {
`java-library`
}

val mongodbSourceSet = sourceSets.create("mongodbSupport") {
java {
srcDir("src/mongodb/java")
}
}

java {
registerFeature("mongodbSupport") {
usingSourceSet(mongodbSourceSet)
}
}
11 changes: 11 additions & 0 deletions examples/java-example/dokkatoo/my-java-features/Module.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Module My Java Features

This is the API reference for My Java Features.

# Package demo.feature

This package contains common feature classes.

# Package demo.mongodb

This package contains MongoDB feature classes.
20 changes: 20 additions & 0 deletions examples/java-example/dokkatoo/my-java-features/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
plugins {
`my-java-mongodb-convention`
`dokka-convention`
}

dokkatoo {
dokkatooSourceSets.configureEach {
includes.from("Module.md")
}

dokkatooSourceSets.javaMain {
displayName = "Java"
}

// non-main source sets are suppressed by default
dokkatooSourceSets.javaMongodbSupport {
suppress = false
displayName = "MongoDB"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package demo.feature;

public class MyJavaFeatureUtil {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package demo.mongodb;

public class MyMongoDbUtil {
}
3 changes: 2 additions & 1 deletion examples/java-example/dokkatoo/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = "dokkatoo-multimodule-example"
rootProject.name = "dokkatoo-java-example"

pluginManagement {
repositories {
Expand Down Expand Up @@ -43,4 +43,5 @@ dependencyResolutionManagement {
}

include(":my-java-application")
include(":my-java-features")
include(":my-java-library")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b9af4a8

Please sign in to comment.