Skip to content

Commit

Permalink
Fix several bugs in configuration examples in gradle user guide (#1831)
Browse files Browse the repository at this point in the history
  • Loading branch information
AzimMuradov committed Apr 15, 2021
1 parent 7bfab09 commit 46b2118
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions docs/src/doc/docs/user_guide/gradle/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ dokkaHtml {

// By default, sourceRoots are taken from Kotlin Plugin and kotlinTasks, following roots will be appended to them
// Repeat for multiple sourceRoots
sourceRoot.from(file("src"))
sourceRoots.from(file("src"))

// Specifies the location of the project source code on the Web.
// If provided, Dokka generates "source" links for each declaration.
Expand Down Expand Up @@ -181,7 +181,7 @@ dokkaHtml {
// Repeat for multiple links
externalDocumentationLink {
// Root URL of the generated documentation to link with. The trailing slash is required!
url = URL("https://example.com/docs/")
url.set(URL("https://example.com/docs/"))

// If package-list file is located in non-standard location
// packageListUrl = URL("file:///home/user/localdocs/package-list")
Expand All @@ -199,7 +199,7 @@ dokkaHtml {
}
// Suppress a package
perPackageOption {
matchingRegex.set(".*\.internal.*") // will match all .internal packages and sub-packages
matchingRegex.set(""".*\.internal.*""") // will match all .internal packages and sub-packages
suppress.set(true)
}
}
Expand All @@ -224,26 +224,26 @@ kotlin { // Kotlin Multiplatform plugin configuration
}

tasks.withType<DokkaTask>().configureEach {
// custom output directory
outputDirectory.set(buildDir.resolve("dokka"))

// path to project documentation to display on all modules page
includes.from(listOf(file("project_description.md")))
// custom output directory
outputDirectory.set(buildDir.resolve("dokka"))

dokkaSourceSets {
named("customNameMain") { // The same name as in Kotlin Multiplatform plugin, so the sources are fetched automatically
includes.from("packages.md", "extra.md")
samples.from("samples/basic.kt", "samples/advanced.kt")
}
// path to project documentation to display on all modules page
includes.from(listOf(file("project_description.md")))

register("differentName") { // Different name, so source roots must be passed explicitly
displayName.set("JVM")
platform.set(org.jetbrains.dokka.Platform.jvm)
sourceRoots.from(kotlin.sourceSets.getByName("jvmMain").kotlin.srcDirs)
sourceRoots.from(kotlin.sourceSets.getByName("commonMain").kotlin.srcDirs)
}
dokkaSourceSets {
named("customNameMain") { // The same name as in Kotlin Multiplatform plugin, so the sources are fetched automatically
includes.from("packages.md", "extra.md")
samples.from("samples/basic.kt", "samples/advanced.kt")
}

register("differentName") { // Different name, so source roots must be passed explicitly
displayName.set("JVM")
platform.set(org.jetbrains.dokka.Platform.jvm)
sourceRoots.from(kotlin.sourceSets.getByName("jvmMain").kotlin.srcDirs)
sourceRoots.from(kotlin.sourceSets.getByName("commonMain").kotlin.srcDirs)
}
}
}
```

!!! note
Expand Down

0 comments on commit 46b2118

Please sign in to comment.