aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin
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/gradle-plugin
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/gradle-plugin')
-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
2 files changed, 8 insertions, 8 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,