diff options
author | Marcin Aman <marcin.aman@gmail.com> | 2021-04-14 13:20:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-14 13:20:02 +0200 |
commit | f27be3dfd3fa264f946161611638ad260a0ff392 (patch) | |
tree | 74301f87584b27e17af83118947a98397e9612fc /runners/gradle-plugin/src/test/kotlin | |
parent | 09d030e1da5ddf687e2ba6927973898e19c99390 (diff) | |
download | dokka-f27be3dfd3fa264f946161611638ad260a0ff392.tar.gz dokka-f27be3dfd3fa264f946161611638ad260a0ff392.tar.bz2 dokka-f27be3dfd3fa264f946161611638ad260a0ff392.zip |
Add ability to document generated files (#1832)
Diffstat (limited to 'runners/gradle-plugin/src/test/kotlin')
-rw-r--r-- | runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilderTest.kt | 28 |
1 files changed, 28 insertions, 0 deletions
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 68642054..6216b5d7 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 @@ -425,6 +425,34 @@ class GradleDokkaSourceSetBuilderTest { } @Test + fun suppressedFilesByDefault() { + val sourceSet = GradleDokkaSourceSetBuilder("", project) + assertTrue(sourceSet.build().suppressedFiles.isEmpty(), "Expected no suppressed files by default") + + val file = project.buildDir.resolve("generated").also { it.mkdirs() } + file.resolve("suppressed.kt").writeText("class A") + + sourceSet.sourceRoots.from(project.buildDir.resolve("generated")) + + val suppressedConfiguration = sourceSet.build() + sourceSet.suppressGeneratedFiles.set(false) + val unsuppressedConfiguration = sourceSet.build() + + assertEquals( + setOf( + project.buildDir.resolve("generated"), + project.buildDir.resolve("generated").resolve("suppressed.kt") + ), suppressedConfiguration.suppressedFiles, + "Expected all suppressed files to be present after build" + ) + + assertTrue( + unsuppressedConfiguration.suppressedFiles.isEmpty(), + "Expected no files to be suppressed by default" + ) + } + + @Test fun platform() { val sourceSet = GradleDokkaSourceSetBuilder("", project) assertEquals(Platform.DEFAULT, sourceSet.build().analysisPlatform, "Expected default platform if not specified") |