Skip to content

Commit df0052c

Browse files
authored
[9.0] [Gradle] Fix distribution package building after Gradle update (#133294) (#133307)
* [Gradle] Fix distribution package building after Gradle update (#133294) The gradle update silently removed the dependency of assemble on artifacts added to the default configuration. this fixes this by manually declaring the task dependency which is also whats recommended on the gradle update guide * Remove unused file * Delete .claude/settings.local.json
1 parent ffd7c87 commit df0052c

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionDownloadPluginFuncTest.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ class InternalDistributionDownloadPluginFuncTest extends AbstractGradleFuncTest
167167
}
168168
}
169169
}
170+
171+
tasks.named('assemble').configure {
172+
dependsOn buildTar
173+
}
174+
170175
artifacts {
171176
it.add("default", buildTar)
172177
it.add("extracted", buildExpanded)

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionArchiveSetupPlugin.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ private void registerAndConfigureDistributionArchivesExtension(Project project)
7474
project.project(subProjectName, sub -> {
7575
sub.getPlugins().apply(BasePlugin.class);
7676
sub.getArtifacts().add(DEFAULT_CONFIGURATION_NAME, distributionArchive.getArchiveTask());
77+
sub.getTasks().named("assemble").configure(task -> task.dependsOn(distributionArchive.getArchiveTask()));
7778
var extractedConfiguration = sub.getConfigurations().create(EXTRACTED_CONFIGURATION_NAME);
7879
extractedConfiguration.setCanBeResolved(false);
7980
extractedConfiguration.setCanBeConsumed(true);

distribution/packages/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,10 @@ tasks.register('buildDeb', Deb) {
354354
configure(commonDebConfig('x64'))
355355
}
356356

357+
tasks.named('assemble'){
358+
dependsOn 'buildDeb', 'buildAarch64Deb'
359+
}
360+
357361
Closure commonRpmConfig(String architecture) {
358362
return {
359363
configure(commonPackageConfig('rpm', architecture))
@@ -387,6 +391,11 @@ tasks.register('buildRpm', Rpm) {
387391
configure(commonRpmConfig('x64'))
388392
}
389393

394+
tasks.named('assemble'){
395+
dependsOn 'buildRpm', 'buildAarch64Rpm'
396+
}
397+
398+
390399
Closure dpkgExists = { it -> new File('/bin/dpkg-deb').exists() || new File('/usr/bin/dpkg-deb').exists() || new File('/usr/local/bin/dpkg-deb').exists() }
391400
Closure rpmExists = { it -> new File('/bin/rpm').exists() || new File('/usr/bin/rpm').exists() || new File('/usr/local/bin/rpm').exists() }
392401

0 commit comments

Comments
 (0)