Skip to content

Commit

Permalink
Fix maven plugin configuration overriding the default value
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnatBeresnev committed Dec 23, 2021
1 parent ec29694 commit aaca2b4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions runners/maven-plugin/src/main/kotlin/DokkaMojo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc

@Parameter(property = "visibility")
var documentedVisibilities: Set<DokkaConfiguration.Visibility> = DokkaDefaults.documentedVisibilities
// hack to set the default value for lists, didn't find any other safe way
// maven seems to overwrite Kotlin's default initialization value, so it doesn't matter what you put there
get() = field.ifEmpty { DokkaDefaults.documentedVisibilities }

@Parameter
var failOnWarning: Boolean = DokkaDefaults.failOnWarning
Expand Down Expand Up @@ -204,7 +207,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc
samples = samples.map(::File).toSet(),
includes = includes.map(::File).toSet(),
includeNonPublic = includeNonPublic,
documentedVisibilities = documentedVisibilities,
documentedVisibilities = documentedVisibilities.also { println("DOCUMENTED VISIBILITIES (is empty: ${it.isEmpty()}): $it") },
reportUndocumented = reportUndocumented,
skipEmptyPackages = skipEmptyPackages,
skipDeprecated = skipDeprecated,
Expand All @@ -214,7 +217,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc
PackageOptionsImpl(
matchingRegex = it.matchingRegex,
includeNonPublic = it.includeNonPublic,
documentedVisibilities = it.documentedVisibilities,
documentedVisibilities = it.documentedVisibilities.also { println("DOCUMENTED package VISIBILITIES (is empty: ${it.isEmpty()}): $it") },
reportUndocumented = it.reportUndocumented,
skipDeprecated = it.skipDeprecated,
suppress = it.suppress
Expand Down

0 comments on commit aaca2b4

Please sign in to comment.