diff options
author | Martin Bonnin <martin@mbonnin.net> | 2020-11-18 12:48:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-18 12:48:03 +0100 |
commit | 1959b914c0838be814d45f617517ac73fa33cd47 (patch) | |
tree | 899805a421b45625ceffd599520a3f3e3d237e5a /runners/gradle-plugin | |
parent | d6c798e44381fd436a264229f94f19528382c136 (diff) | |
download | dokka-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')
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, |