Skip to content

Commit 68a8c58

Browse files
authored
[8.18] [Gradle] Fix distribution package building after Gradle update (#133294) (#133304)
* [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 * Delete .claude/settings.local.json * Remove unused file
1 parent 24a5e6e commit 68a8c58

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
@@ -355,6 +355,10 @@ tasks.register('buildDeb', Deb) {
355355
configure(commonDebConfig('x64'))
356356
}
357357

358+
tasks.named('assemble'){
359+
dependsOn 'buildDeb', 'buildAarch64Deb'
360+
}
361+
358362
Closure commonRpmConfig(String architecture) {
359363
return {
360364
configure(commonPackageConfig('rpm', architecture))
@@ -388,6 +392,11 @@ tasks.register('buildRpm', Rpm) {
388392
configure(commonRpmConfig('x64'))
389393
}
390394

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

0 commit comments

Comments
 (0)