diff --git a/dropshots-gradle-plugin/build.gradle.kts b/dropshots-gradle-plugin/build.gradle.kts index faf4fd5..5848768 100644 --- a/dropshots-gradle-plugin/build.gradle.kts +++ b/dropshots-gradle-plugin/build.gradle.kts @@ -8,12 +8,20 @@ plugins { alias(libs.plugins.dokka) alias(libs.plugins.binaryCompatibilityValidator) } - +// This module is included in two projects: +// - In the root project where it's released as one of our artifacts +// - In build-logic project where we can use it for the runtime and samples. +// +// We only want to publish when it's being built in the root project. if (rootProject.name == "dropshots-root") { apply(plugin = libs.plugins.mavenPublish.get().pluginId) extensions.configure { configure(GradlePlugin(Dokka("dokkaJavadoc"))) } +} else { + // Move the build directory when included in build-support so as to not poison the real build. + // If we don't the configuration cache is broken and all tasks are considered not up-to-date. + layout.buildDirectory = File(rootDir, "build/dropshots-gradle-plugin") } val generateVersionTask = tasks.register("generateVersion") { diff --git a/model/build.gradle.kts b/model/build.gradle.kts index f172bfe..df67e1c 100644 --- a/model/build.gradle.kts +++ b/model/build.gradle.kts @@ -5,8 +5,17 @@ plugins { alias(libs.plugins.binaryCompatibilityValidator) } +// This module is included in two projects: +// - In the root project where it's released as one of our artifacts +// - In build-logic project where we can use it for the runtime and samples. +// +// We only want to publish when it's being built in the root project. if (rootProject.name == "dropshots-root") { apply(plugin = libs.plugins.mavenPublish.get().pluginId) +} else { + // Move the build directory when included in build-support so as to not poison the real build. + // If we don't the configuration cache is broken and all tasks are considered not up-to-date. + layout.buildDirectory = File(rootDir, "build/model") } kotlin {