aboutsummaryrefslogtreecommitdiff
path: root/runners
diff options
context:
space:
mode:
authorMartin Bonnin <martin@mbonnin.net>2020-11-18 12:48:03 +0100
committerGitHub <noreply@github.com>2020-11-18 12:48:03 +0100
commit1959b914c0838be814d45f617517ac73fa33cd47 (patch)
tree899805a421b45625ceffd599520a3f3e3d237e5a /runners
parentd6c798e44381fd436a264229f94f19528382c136 (diff)
downloaddokka-1959b914c0838be814d45f617517ac73fa33cd47.tar.gz
dokka-1959b914c0838be814d45f617517ac73fa33cd47.tar.bz2
dokka-1959b914c0838be814d45f617517ac73fa33cd47.zip
Add matchingRegex (#598)
* add matchingRegex as a simpler replacement for `prefix` * remove useless check * added a note about the order of the matchingRegex
Diffstat (limited to 'runners')
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradlePackageOptionsBuilder.kt6
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilderTest.kt10
-rw-r--r--runners/maven-plugin/src/main/kotlin/DokkaMojo.kt4
3 files changed, 10 insertions, 10 deletions
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradlePackageOptionsBuilder.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradlePackageOptionsBuilder.kt
index 6485c8ed..9b6108b8 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradlePackageOptionsBuilder.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradlePackageOptionsBuilder.kt
@@ -15,8 +15,8 @@ class GradlePackageOptionsBuilder(
@Transient @get:Internal internal val project: Project
) : DokkaConfigurationBuilder<PackageOptionsImpl> {
@Input
- val prefix: Property<String> = project.objects.safeProperty<String>()
- .safeConvention("")
+ val matchingRegex: Property<String> = project.objects.safeProperty<String>()
+ .safeConvention(".*")
@Input
val includeNonPublic: Property<Boolean> = project.objects.safeProperty<Boolean>()
@@ -35,7 +35,7 @@ class GradlePackageOptionsBuilder(
.safeConvention(DokkaDefaults.suppress)
override fun build(): PackageOptionsImpl = PackageOptionsImpl(
- prefix = checkNotNull(prefix.getSafe()) { "prefix not specified" },
+ matchingRegex = checkNotNull(matchingRegex.getSafe()) { "prefix not specified" },
includeNonPublic = includeNonPublic.getSafe(),
reportUndocumented = reportUndocumented.getSafe(),
skipDeprecated = skipDeprecated.getSafe(),
diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilderTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilderTest.kt
index 920c48b4..68642054 100644
--- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilderTest.kt
+++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilderTest.kt
@@ -245,21 +245,21 @@ class GradleDokkaSourceSetBuilderTest {
assertEquals(emptyList(), sourceSet.build().perPackageOptions, "Expected no default per package options")
sourceSet.perPackageOptions.add(GradlePackageOptionsBuilder(project).apply {
- this.prefix by "p1"
+ this.matchingRegex by "p1.*"
})
sourceSet.perPackageOption {
- it.prefix by "p2"
+ it.matchingRegex by "p2.*"
}
sourceSet.perPackageOption(project.closureOf<GradlePackageOptionsBuilder> {
- this.prefix by "p3"
+ this.matchingRegex by "p3.*"
})
assertEquals(
- listOf("p1", "p2", "p3").map { prefix ->
+ listOf("p1.*", "p2.*", "p3.*").map { matchingRegex ->
PackageOptionsImpl(
- prefix = prefix,
+ matchingRegex = matchingRegex,
includeNonPublic = DokkaDefaults.includeNonPublic,
reportUndocumented = DokkaDefaults.reportUndocumented,
skipDeprecated = DokkaDefaults.skipDeprecated,
diff --git a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt
index b03d2811..00ace0f9 100644
--- a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt
+++ b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt
@@ -66,7 +66,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc
class PackageOptions : DokkaConfiguration.PackageOptions {
@Parameter
- override var prefix: String = ""
+ override var matchingRegex: String = ".*"
@Parameter
override var includeNonPublic: Boolean = DokkaDefaults.includeNonPublic
@@ -203,7 +203,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List<Dependenc
sourceLinks = sourceLinks.map { SourceLinkDefinitionImpl(it.path, URL(it.url), it.lineSuffix) }.toSet(),
perPackageOptions = perPackageOptions.map {
PackageOptionsImpl(
- prefix = it.prefix,
+ matchingRegex = it.matchingRegex,
includeNonPublic = it.includeNonPublic,
reportUndocumented = it.reportUndocumented,
skipDeprecated = it.skipDeprecated,