Skip to content

Commit

Permalink
Merge branch 'master' into KT-64377/maven-dev-publish
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-enko committed Feb 23, 2024
2 parents b29f542 + 936cb3f commit b963d07
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 33 deletions.
12 changes: 6 additions & 6 deletions docs/topics/runners/dokka-gradle.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,11 @@ plugins {
}

tasks.dokkaHtml {
outputDirectory.set(buildDir.resolve("documentation/html"))
outputDirectory.set(layout.buildDirectory.dir("documentation/html"))
}

tasks.dokkaGfm {
outputDirectory.set(buildDir.resolve("documentation/markdown"))
outputDirectory.set(layout.buildDirectory.dir("documentation/markdown"))
}
```

Expand Down Expand Up @@ -543,7 +543,7 @@ subprojects {

// configure only the HTML task
tasks.dokkaHtmlPartial {
outputDirectory.set(buildDir.resolve("docs/partial"))
outputDirectory.set(layout.buildDirectory.dir("docs/partial"))
}

// configure all format tasks at once
Expand Down Expand Up @@ -602,7 +602,7 @@ apply(plugin = "org.jetbrains.dokka")

// configuration for subproject-A only.
tasks.dokkaHtmlPartial {
outputDirectory.set(buildDir.resolve("docs/partial"))
outputDirectory.set(layout.buildDirectory.dir("docs/partial"))
}
```

Expand Down Expand Up @@ -690,7 +690,7 @@ import org.jetbrains.dokka.gradle.DokkaTask
tasks.withType<DokkaTask>().configureEach {
moduleName.set(project.name)
moduleVersion.set(project.version.toString())
outputDirectory.set(buildDir.resolve("dokka/$name"))
outputDirectory.set(layout.buildDirectory.dir("dokka/$name"))
failOnWarning.set(false)
suppressObviousFunctions.set(true)
suppressInheritedMembers.set(false)
Expand Down Expand Up @@ -1400,7 +1400,7 @@ import java.net.URL
tasks.withType<DokkaTask>().configureEach {
moduleName.set(project.name)
moduleVersion.set(project.version.toString())
outputDirectory.set(buildDir.resolve("dokka/$name"))
outputDirectory.set(layout.buildDirectory.dir("dokka/$name"))
failOnWarning.set(false)
suppressObviousFunctions.set(true)
suppressInheritedMembers.set(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private fun GradleDokkaSourceSetBuilder.externalDocumentationLinksWithDefaults()

private fun GradleDokkaSourceSetBuilder.suppressedFilesWithDefaults(): Set<File> {
val suppressedGeneratedFiles = if (suppressGeneratedFiles.get()) {
val generatedRoot = project.buildDir.resolve("generated").absoluteFile
val generatedRoot = project.layout.buildDirectory.dir("generated").get().asFile
sourceRoots
.filter { it.startsWith(generatedRoot) }
.flatMap { it.walk().toList() }
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -453,20 +453,21 @@ class GradleDokkaSourceSetBuilderTest {
val sourceSet = GradleDokkaSourceSetBuilder("", project)
assertTrue(sourceSet.build().suppressedFiles.isEmpty(), "Expected no suppressed files by default")

val file = project.buildDir.resolve("generated").also { it.mkdirs() }
val file = project.layout.buildDirectory.dir("generated").get().asFile.also { it.mkdirs() }
file.resolve("suppressed.kt").writeText("class A")

sourceSet.sourceRoots.from(project.buildDir.resolve("generated"))
sourceSet.sourceRoots.from(project.layout.buildDirectory.dir("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,
project.layout.buildDirectory.dir("generated").get().asFile,
project.layout.buildDirectory.dir("generated/suppressed.kt").get().asFile,
),
suppressedConfiguration.suppressedFiles,
"Expected all suppressed files to be present after build"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class DokkaMultiModuleTaskTest {
multiModuleTask.apply {
moduleVersion.set("1.5.0")
moduleName.set("custom Module Name")
outputDirectory.set(project.buildDir.resolve("customOutputDirectory"))
outputDirectory.set(project.layout.buildDirectory.dir("customOutputDirectory"))
cacheRoot.set(File("customCacheRoot"))
pluginsConfiguration.add(
PluginConfigurationImpl(
Expand All @@ -93,8 +93,8 @@ class DokkaMultiModuleTaskTest {
DokkaConfigurationImpl(
moduleName = "custom Module Name",
moduleVersion = "1.5.0",
outputDir = multiModuleTask.project.buildDir.resolve("customOutputDirectory"),
cacheRoot = multiModuleTask.project.projectDir.resolve("customCacheRoot"),
outputDir = multiModuleTask.project.layout.buildDirectory.dir("customOutputDirectory").get().asFile,
cacheRoot = multiModuleTask.project.layout.projectDirectory.dir("customCacheRoot").asFile,
pluginsConfiguration = mutableListOf(
PluginConfigurationImpl(
"pluginA",
Expand Down Expand Up @@ -236,7 +236,7 @@ class DokkaMultiModuleTaskTest {
})

assertEquals(
listOf(parent.project.buildDir.resolve("child")),
listOf(parent.project.layout.buildDirectory.dir("child").get().asFile),
parentTask.targetChildOutputDirectories.get().map { it.asFile },
"Expected child target output directory being present"
)
Expand Down

0 comments on commit b963d07

Please sign in to comment.