Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ plugins {
dokkatoo {
// Important! Ensure that each project has a distinct module path.
// See the example README for more information.
modulePath = rootProject.name + project.path.replace(":", "/")
modulePath.set(rootProject.name + project.path.replace(":", "/"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ dependencies {
}

dokkatoo {
moduleName = "Dokkatoo Composite Builds Example"
moduleName.set("Dokkatoo Composite Builds Example")
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ group = "foo.example"
version = "1.2.3"

dokkatoo {
moduleName = "Kakapo Module"
modulePath = "kakakpo"
moduleName.set("Kakapo Module")
modulePath.set("kakakpo")
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ group = "foo.example"
version = "4.5.6"

dokkatoo {
moduleName = "Kea Module"
modulePath = "kea"
moduleName.set("Kea Module")
modulePath.set("kea")
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ plugins {

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion.set(JavaLanguageVersion.of(17))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ dokkatoo {
}

application {
mainClass = "demo.MyJavaApplication"
mainClass.set("demo.MyJavaApplication")
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ dokkatoo {
}

dokkatooSourceSets.javaMain {
displayName = "Java"
displayName.set("Java")
}

// non-main source sets are suppressed by default
dokkatooSourceSets.javaMongodbSupport {
suppress = false
displayName = "MongoDB"
suppress.set(false)
displayName.set("MongoDB")
}
}
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ kotest-datatest = { module = "io.kotest:kotest-framework-datatest" }
kotest-junit5Runner = { module = "io.kotest:kotest-runner-junit5" }
kotest-assertionsCore = { module = "io.kotest:kotest-assertions-core" }
kotest-assertionsJson = { module = "io.kotest:kotest-assertions-json" }
kotest-property = { module = "io.kotest:kotest-property" }

### Gradle plugins ###

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package dev.adamko.dokkatoo.tests.examples
import dev.adamko.dokkatoo.utils.*
import dev.adamko.dokkatoo.utils.GradleProjectTest.Companion.exampleProjectDataPath
import dev.adamko.dokkatoo.utils.GradleProjectTest.Companion.projectTestTempDir
import io.kotest.assertions.asClue
import io.kotest.assertions.withClue
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
import io.kotest.matchers.string.shouldContain
import io.kotest.matchers.string.shouldNotContain
import java.io.File
import kotlin.io.path.walk

Expand Down Expand Up @@ -57,7 +57,7 @@ class CompositeBuildExampleTest : FunSpec({


context("Gradle caching") {
test("expect Dokkatoo is compatible with Gradle Build Cache") {
test("expect Dokkatoo is compatible with Build Cache") {
dokkatooProject.runner
.addArguments(
"clean",
Expand All @@ -82,13 +82,17 @@ class CompositeBuildExampleTest : FunSpec({
"> Task :module-kea:dokkatooGenerateModuleHtml UP-TO-DATE",
"> Task :docs:dokkatooGeneratePublicationHtml UP-TO-DATE",
"BUILD SUCCESSFUL",
// expect "1 executed" because :checkKotlinGradlePluginConfigurationErrors always runs (fixed KGP in 2.0?)
"14 actionable tasks: 1 executed, 13 up-to-date",
)

output shouldContain when {
// expect "1 executed" because :checkKotlinGradlePluginConfigurationErrors always runs
dokkatooProject.versions.kgp < "2.0.0" -> "14 actionable tasks: 1 executed, 13 up-to-date"
else -> "14 actionable tasks: 14 up-to-date"
}
}
}

context("expect Dokkatoo is compatible with Gradle Configuration Cache") {
context("expect Dokkatoo is compatible with Configuration Cache") {
dokkatooProject
.findFiles {
val isCCDir = it.invariantSeparatorsPath.endsWith(".gradle/configuration-cache")
Expand All @@ -110,8 +114,11 @@ class CompositeBuildExampleTest : FunSpec({
test("first build should store the configuration cache") {
configCacheRunner.build {
output shouldContain "BUILD SUCCESSFUL"
output shouldContain "Configuration cache entry stored"
output shouldNotContain "problems were found storing the configuration cache"

configurationCacheReport().asClue { report ->
report.cacheAction shouldBe "storing"
report.totalProblemCount shouldBe 0
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package dev.adamko.dokkatoo.tests.examples

import dev.adamko.dokkatoo.internal.DokkatooConstants.DOKKA_VERSION
import dev.adamko.dokkatoo.utils.*
import io.kotest.assertions.asClue
import io.kotest.assertions.withClue
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.file.shouldBeAFile
Expand Down Expand Up @@ -81,7 +82,7 @@ class CustomFormatExampleTest : FunSpec({


context("Gradle caching") {
test("expect Dokkatoo is compatible with Gradle Build Cache") {
test("expect Dokkatoo is compatible with Build Cache") {
dokkatooProject.runner
.addArguments(
"clean",
Expand Down Expand Up @@ -121,7 +122,7 @@ class CustomFormatExampleTest : FunSpec({
}
}

context("expect Dokkatoo is compatible with Gradle Configuration Cache") {
context("expect Dokkatoo is compatible with Configuration Cache") {
dokkatooProject.file(".gradle/configuration-cache").toFile().deleteRecursively()
dokkatooProject.file("build/reports/configuration-cache").toFile().deleteRecursively()

Expand All @@ -139,15 +140,23 @@ class CustomFormatExampleTest : FunSpec({
test("first build should store the configuration cache") {
configCacheRunner.build {
output shouldContain "BUILD SUCCESSFUL"
output shouldContain "Configuration cache entry stored"
output shouldNotContain "problems were found storing the configuration cache"

configurationCacheReport().asClue { report ->
report.cacheAction shouldBe "storing"
report.totalProblemCount shouldBe 0
}
}
}

test("second build should reuse the configuration cache") {
configCacheRunner.build {
output shouldContain "BUILD SUCCESSFUL"
output shouldContain "Configuration cache entry reused"

// configurationCacheReport().asClue { report ->
// report.cacheAction shouldBe "reused"
// report.totalProblemCount shouldBe 0
// }
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dev.adamko.dokkatoo.tests.examples
import dev.adamko.dokkatoo.internal.DokkatooConstants.DOKKA_VERSION
import dev.adamko.dokkatoo.utils.*
import dev.adamko.dokkatoo.utils.GradleProjectTest.Companion.projectTestTempDir
import io.kotest.assertions.asClue
import io.kotest.assertions.withClue
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.file.shouldBeAFile
Expand Down Expand Up @@ -82,7 +83,7 @@ class GradleExampleTest : FunSpec({


context("Gradle caching") {
test("expect Dokkatoo is compatible with Gradle Build Cache") {
test("expect Dokkatoo is compatible with Build Cache") {
dokkatooProject.runner
.addArguments(
"clean",
Expand Down Expand Up @@ -123,7 +124,7 @@ class GradleExampleTest : FunSpec({
}
}

context("expect Dokkatoo is compatible with Gradle Configuration Cache") {
context("expect Dokkatoo is compatible with Configuration Cache") {
dokkatooProject.file(".gradle/configuration-cache").toFile().deleteRecursively()
dokkatooProject.file("build/reports/configuration-cache").toFile().deleteRecursively()

Expand All @@ -141,15 +142,22 @@ class GradleExampleTest : FunSpec({
test("first build should store the configuration cache") {
configCacheRunner.build {
output shouldContain "BUILD SUCCESSFUL"
output shouldContain "Configuration cache entry stored"
output shouldNotContain "problems were found storing the configuration cache"

configurationCacheReport().asClue { report ->
report.cacheAction shouldBe "storing"
report.totalProblemCount shouldBe 0
}
}
}

test("second build should reuse the configuration cache") {
configCacheRunner.build {
output shouldContain "BUILD SUCCESSFUL"
output shouldContain "Configuration cache entry reused"
// configurationCacheReport().asClue { report ->
// report.cacheAction shouldBe "reused"
// report.totalProblemCount shouldBe 0
// }
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package dev.adamko.dokkatoo.tests.examples
import dev.adamko.dokkatoo.utils.*
import dev.adamko.dokkatoo.utils.GradleProjectTest.Companion.exampleProjectDataPath
import dev.adamko.dokkatoo.utils.GradleProjectTest.Companion.projectTestTempDir
import io.kotest.assertions.asClue
import io.kotest.assertions.withClue
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
import io.kotest.matchers.string.shouldContain
import io.kotest.matchers.string.shouldNotContain
import java.io.File
import kotlin.io.path.walk

Expand Down Expand Up @@ -57,7 +57,7 @@ class JavaExampleTest : FunSpec({


context("Gradle caching") {
test("expect Dokkatoo is compatible with Gradle Build Cache") {
test("expect Dokkatoo is compatible with Build Cache") {
dokkatooProject.runner
.addArguments(
"clean",
Expand All @@ -83,13 +83,16 @@ class JavaExampleTest : FunSpec({
"> Task :my-java-library:dokkatooGenerateModuleHtml UP-TO-DATE",
"> Task :dokkatooGeneratePublicationHtml UP-TO-DATE",
"BUILD SUCCESSFUL",
// expect "1 executed" because :checkKotlinGradlePluginConfigurationErrors always runs (fixed KGP in 2.0?)
"18 actionable tasks: 1 executed, 17 up-to-date",
)
output shouldContain when {
// expect "1 executed" because :checkKotlinGradlePluginConfigurationErrors always runs
dokkatooProject.versions.gradle < "8.0" -> "20 actionable tasks: 20 up-to-date"
else -> "18 actionable tasks: 18 up-to-date"
}
}
}

context("expect Dokkatoo is compatible with Gradle Configuration Cache") {
context("expect Dokkatoo is compatible with Configuration Cache") {
dokkatooProject
.findFiles {
val isCCDir = it.invariantSeparatorsPath.endsWith(".gradle/configuration-cache")
Expand All @@ -111,8 +114,10 @@ class JavaExampleTest : FunSpec({
test("first build should store the configuration cache") {
configCacheRunner.build {
output shouldContain "BUILD SUCCESSFUL"
output shouldContain "Configuration cache entry stored"
output shouldNotContain "problems were found storing the configuration cache"
configurationCacheReport().asClue { report ->
report.cacheAction shouldBe "storing"
report.totalProblemCount shouldBe 0
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package dev.adamko.dokkatoo.tests.examples

import dev.adamko.dokkatoo.utils.*
import dev.adamko.dokkatoo.utils.GradleProjectTest.Companion.projectTestTempDir
import io.kotest.assertions.asClue
import io.kotest.assertions.withClue
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.file.shouldBeAFile
Expand Down Expand Up @@ -88,7 +89,7 @@ class KotlinMultiplatformExampleTest : FunSpec({

context("Gradle caching") {

context("expect Dokkatoo is compatible with Gradle Build Cache") {
context("expect Dokkatoo is compatible with Build Cache") {
dokkatooProject.runner
.addArguments(
"clean",
Expand Down Expand Up @@ -137,7 +138,7 @@ class KotlinMultiplatformExampleTest : FunSpec({
}
}

context("expect Dokkatoo is compatible with Gradle Configuration Cache") {
context("expect Dokkatoo is compatible with Configuration Cache") {
dokkatooProject.file(".gradle/configuration-cache").toFile().deleteRecursively()
dokkatooProject.file("build/reports/configuration-cache").toFile().deleteRecursively()

Expand All @@ -155,8 +156,11 @@ class KotlinMultiplatformExampleTest : FunSpec({
test("first build should store the configuration cache") {
configCacheRunner.build {
output shouldContain "BUILD SUCCESSFUL"
output shouldContain "Configuration cache entry stored"
output shouldNotContain "problems were found storing the configuration cache"

configurationCacheReport().asClue { report ->
report.cacheAction shouldBe "storing"
report.totalProblemCount shouldBe 0
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dev.adamko.dokkatoo.tests.examples
import dev.adamko.dokkatoo.internal.DokkatooConstants.DOKKA_VERSION
import dev.adamko.dokkatoo.utils.*
import dev.adamko.dokkatoo.utils.GradleProjectTest.Companion.projectTestTempDir
import io.kotest.assertions.asClue
import io.kotest.core.spec.style.FunSpec
import io.kotest.inspectors.shouldForAll
import io.kotest.matchers.collections.shouldHaveSize
Expand Down Expand Up @@ -91,7 +92,7 @@ class MultimoduleExampleTest : FunSpec({

context("Gradle caching") {

context("expect Dokkatoo is compatible with Gradle Build Cache") {
context("expect Dokkatoo is compatible with Build Cache") {
dokkatooProject.runner
.addArguments(
"clean",
Expand Down Expand Up @@ -147,7 +148,7 @@ class MultimoduleExampleTest : FunSpec({
}


context("expect Dokkatoo is compatible with Gradle Configuration Cache") {
context("expect Dokkatoo is compatible with Configuration Cache") {
dokkatooProject.file(".gradle/configuration-cache").toFile().deleteRecursively()
dokkatooProject.file("build/reports/configuration-cache").toFile().deleteRecursively()

Expand All @@ -165,8 +166,11 @@ class MultimoduleExampleTest : FunSpec({
test("first build should store the configuration cache") {
configCacheRunner.build {
output shouldContain "BUILD SUCCESSFUL"
output shouldContain "Configuration cache entry stored"
output shouldNotContain "problems were found storing the configuration cache"

configurationCacheReport().asClue { report ->
report.cacheAction shouldBe "storing"
report.totalProblemCount shouldBe 0
}
}
}

Expand Down
Loading