From 5eeb2bbeb8c71ae813808ee0e8d09293c4abe1c1 Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Thu, 19 Jan 2023 04:10:57 +0100 Subject: Revise README documentation for examples and plugins (#2736) --- .../parentProject/build.gradle.kts | 35 +++++++++++++++------- .../parentProject/childProjectA/Module.md | 5 ---- .../parentProject/childProjectA/ModuleA.md | 5 ++++ .../parentProject/childProjectA/build.gradle.kts | 4 ++- .../parentProject/childProjectB/Module.md | 5 ---- .../parentProject/childProjectB/ModuleB.md | 5 ++++ .../parentProject/childProjectB/build.gradle.kts | 4 ++- 7 files changed, 40 insertions(+), 23 deletions(-) delete mode 100644 examples/gradle/dokka-multimodule-example/parentProject/childProjectA/Module.md create mode 100644 examples/gradle/dokka-multimodule-example/parentProject/childProjectA/ModuleA.md delete mode 100644 examples/gradle/dokka-multimodule-example/parentProject/childProjectB/Module.md create mode 100644 examples/gradle/dokka-multimodule-example/parentProject/childProjectB/ModuleB.md (limited to 'examples/gradle/dokka-multimodule-example/parentProject') diff --git a/examples/gradle/dokka-multimodule-example/parentProject/build.gradle.kts b/examples/gradle/dokka-multimodule-example/parentProject/build.gradle.kts index 397ad22f..66b32b18 100644 --- a/examples/gradle/dokka-multimodule-example/parentProject/build.gradle.kts +++ b/examples/gradle/dokka-multimodule-example/parentProject/build.gradle.kts @@ -1,19 +1,32 @@ +import org.jetbrains.dokka.DokkaConfiguration.Visibility +import org.jetbrains.dokka.gradle.DokkaTaskPartial + plugins { - /** - * Kotlin plugin necessary because of potential Gradle bug! - * This is not necessary if the kotlin gradle plugin is added as buildscript - * dependency like - * - * buildscript { - * dependencies { - * classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") - * } - * } - */ kotlin("jvm") id("org.jetbrains.dokka") } +// You can apply and configure Dokka in each subproject +// individially or configure all subprojects at once +subprojects { + apply(plugin = "org.jetbrains.dokka") + + tasks.withType().configureEach { + dokkaSourceSets.configureEach { + documentedVisibilities.set(setOf( + Visibility.PUBLIC, + Visibility.PROTECTED + )) + } + } +} + +// Configures only the parent MultiModule task, +// this will not affect subprojects +tasks.dokkaHtmlMultiModule { + moduleName.set("Dokka MultiModule Example") +} + dependencies { implementation(kotlin("stdlib")) } diff --git a/examples/gradle/dokka-multimodule-example/parentProject/childProjectA/Module.md b/examples/gradle/dokka-multimodule-example/parentProject/childProjectA/Module.md deleted file mode 100644 index e6cf0e04..00000000 --- a/examples/gradle/dokka-multimodule-example/parentProject/childProjectA/Module.md +++ /dev/null @@ -1,5 +0,0 @@ -# Module childProjectA -This is the child module a - -# Package demo -This package contains a few examples of Dokka usage. diff --git a/examples/gradle/dokka-multimodule-example/parentProject/childProjectA/ModuleA.md b/examples/gradle/dokka-multimodule-example/parentProject/childProjectA/ModuleA.md new file mode 100644 index 00000000..12712d97 --- /dev/null +++ b/examples/gradle/dokka-multimodule-example/parentProject/childProjectA/ModuleA.md @@ -0,0 +1,5 @@ +# Module childProjectA +This is the child module A + +# Package demo +This package contains a few examples of Dokka usage. diff --git a/examples/gradle/dokka-multimodule-example/parentProject/childProjectA/build.gradle.kts b/examples/gradle/dokka-multimodule-example/parentProject/childProjectA/build.gradle.kts index b3c42aba..e13819a1 100644 --- a/examples/gradle/dokka-multimodule-example/parentProject/childProjectA/build.gradle.kts +++ b/examples/gradle/dokka-multimodule-example/parentProject/childProjectA/build.gradle.kts @@ -9,10 +9,12 @@ dependencies { implementation(kotlin("stdlib")) } +// configuration specific to this subproject. +// notice the use of Partial task tasks.withType().configureEach { dokkaSourceSets { configureEach { - includes.from("Module.md") + includes.from("ModuleA.md") } } } diff --git a/examples/gradle/dokka-multimodule-example/parentProject/childProjectB/Module.md b/examples/gradle/dokka-multimodule-example/parentProject/childProjectB/Module.md deleted file mode 100644 index 27031edf..00000000 --- a/examples/gradle/dokka-multimodule-example/parentProject/childProjectB/Module.md +++ /dev/null @@ -1,5 +0,0 @@ -# Module childProjectB -This is the child module b - -# Package demo -This package contains a few examples of Dokka usage. diff --git a/examples/gradle/dokka-multimodule-example/parentProject/childProjectB/ModuleB.md b/examples/gradle/dokka-multimodule-example/parentProject/childProjectB/ModuleB.md new file mode 100644 index 00000000..18a92a33 --- /dev/null +++ b/examples/gradle/dokka-multimodule-example/parentProject/childProjectB/ModuleB.md @@ -0,0 +1,5 @@ +# Module childProjectB +This is the child module B + +# Package demo +This package contains a few examples of Dokka usage. diff --git a/examples/gradle/dokka-multimodule-example/parentProject/childProjectB/build.gradle.kts b/examples/gradle/dokka-multimodule-example/parentProject/childProjectB/build.gradle.kts index b3c42aba..089813a8 100644 --- a/examples/gradle/dokka-multimodule-example/parentProject/childProjectB/build.gradle.kts +++ b/examples/gradle/dokka-multimodule-example/parentProject/childProjectB/build.gradle.kts @@ -9,10 +9,12 @@ dependencies { implementation(kotlin("stdlib")) } +// configuration specific to this subproject. +// notice the use of Partial task tasks.withType().configureEach { dokkaSourceSets { configureEach { - includes.from("Module.md") + includes.from("ModuleB.md") } } } -- cgit