Skip to content

Commit

Permalink
[Gradle] Make DistroTestPlugin configuration cache compatible (#119497)…
Browse files Browse the repository at this point in the history
… (#119521)
  • Loading branch information
breskeby authored Jan 3, 2025
1 parent 9e46ac3 commit c49d615
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.dsl.DependencyHandler;
import org.gradle.api.artifacts.type.ArtifactTypeDefinition;
import org.gradle.api.file.FileCollection;
import org.gradle.api.plugins.JavaPluginExtension;
import org.gradle.api.provider.Provider;
import org.gradle.api.specs.Specs;
Expand Down Expand Up @@ -89,8 +90,8 @@ public void apply(Project project) {
Map<String, TaskProvider<?>> versionTasks = versionTasks(project, "destructiveDistroUpgradeTest", buildParams.getBwcVersions());
TaskProvider<Task> destructiveDistroTest = project.getTasks().register("destructiveDistroTest");

Configuration examplePlugin = configureExamplePlugin(project);

Configuration examplePluginConfiguration = configureExamplePlugin(project);
FileCollection examplePluginFileCollection = examplePluginConfiguration;
List<TaskProvider<Test>> windowsTestTasks = new ArrayList<>();
Map<ElasticsearchDistributionType, List<TaskProvider<Test>>> linuxTestTasks = new HashMap<>();

Expand All @@ -103,9 +104,9 @@ public void apply(Project project) {
t2 -> distribution.isDocker() == false || dockerSupport.get().getDockerAvailability().isAvailable()
);
addDistributionSysprop(t, DISTRIBUTION_SYSPROP, distribution::getFilepath);
addDistributionSysprop(t, EXAMPLE_PLUGIN_SYSPROP, () -> examplePlugin.getSingleFile().toString());
addDistributionSysprop(t, EXAMPLE_PLUGIN_SYSPROP, () -> examplePluginFileCollection.getSingleFile().toString());
t.exclude("**/PackageUpgradeTests.class");
}, distribution, examplePlugin.getDependencies());
}, distribution, examplePluginConfiguration.getDependencies());

if (distribution.getPlatform() == Platform.WINDOWS) {
windowsTestTasks.add(destructiveTask);
Expand Down

0 comments on commit c49d615

Please sign in to comment.