Skip to content

Commit e1b30ff

Browse files
conditionally enable dokka plugin based on property.
1 parent 2b0a168 commit e1b30ff

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ The [Dokka](https://github.com/Kotlin/dokka) plugin is present in `build.gradle.
122122
To generate HTML documentation use the following command:
123123

124124
```
125-
./gradlew dokkaHtml
125+
./gradlew -PdokkaEnabled=true dokkaHtml
126126
```
127127

128128
Open `build/dokka/html/index.html` to view generated documentation.

build.gradle.kts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,16 @@ plugins {
2020
id("com.jfrog.artifactory") version "4.26.2"
2121
`maven-publish`
2222
jacoco
23-
// For now commenting the dokka plugin as latest version 1.6.10 depends on vulnerable versions of jackson/jsoup/etc.
24-
// id("org.jetbrains.dokka") version "1.6.10"
23+
id("org.jetbrains.dokka") version "1.6.10" apply false
24+
}
25+
26+
// Conditionally enable dokka only when dokkaEnabled=true property is set.
27+
// Latest version 1.6.10 depends on vulnerable versions of jackson/jsoup/etc.
28+
val dokkaEnabled = (project.properties["dokkaEnabled"]?.toString()?.toBoolean()) ?: false
29+
project.logger.lifecycle("dokkaEnabled = $dokkaEnabled")
30+
31+
if (dokkaEnabled) {
32+
apply(plugin = "org.jetbrains.dokka")
2533
}
2634

2735
apply(plugin = "nebula.release")

0 commit comments

Comments
 (0)