Skip to content

Commit

Permalink
Adds alternative build directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
rharter committed Dec 9, 2024
1 parent 8c7e17b commit c129705
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
10 changes: 9 additions & 1 deletion dropshots-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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<MavenPublishBaseExtension> {
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") {
Expand Down
9 changes: 9 additions & 0 deletions model/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c129705

Please sign in to comment.