Build: Make assemble a noop in bwc projects
This commit makes the assemble tasks in the bwc projects noops by
setting the dependsOn directly. While we can not remove things from
dependsOn, we can still completely override the dependencies.
closes
@@ -197,13 +197,6 @@ bwcVersions.forPreviousUnreleased { VersionCollection.UnreleasedVersionInfo unre
}
}
- if (gradle.startParameter.taskNames == ["assemble"]) {
- // Gradle needs the `artifacts` declaration, including `builtBy` bellow to make projects dependencies on this
- // project work, but it will also trigger the build of these for the `assemble` task.
- // Since these are only used for testing, we don't want to assemble them if `assemble` is the single command being
- // ran.
- logger.info("Skipping BWC builds since `assemble` is the only task name provided on the command line")
- } else {
artifacts {
for (File artifactFile : artifactFiles) {
String artifactName = artifactFile.name.contains('oss') ? 'elasticsearch-oss' : 'elasticsearch'
@@ -211,7 +204,8 @@ bwcVersions.forPreviousUnreleased { VersionCollection.UnreleasedVersionInfo unre
'default' file: artifactFile, name: artifactName, type: suffix, builtBy: buildBwcVersion
}
}
- }
+ // make sure no dependencies were added to assemble; we want it to be a no-op
+ assemble.dependsOn = []
}}
class IndentingOutputStream extends OutputStream {
