@@ -106,10 +106,12 @@ public void apply(Project project) {
106
106
TaskProvider <Copy > copyUpgradeTask = configureCopyUpgradeTask (project , upgradeVersion , upgradeDir );
107
107
TaskProvider <Copy > copyPluginsTask = configureCopyPluginsTask (project , pluginsDir );
108
108
109
+ Map <ElasticsearchDistribution .Type , TaskProvider <?>> lifecyleTasks = lifecyleTasks (project , "distructiveDistroTest" );
109
110
TaskProvider <Task > destructiveDistroTest = project .getTasks ().register ("destructiveDistroTest" );
110
111
for (ElasticsearchDistribution distribution : distributions ) {
111
112
TaskProvider <?> destructiveTask = configureDistroTest (project , distribution , dockerSupport );
112
113
destructiveDistroTest .configure (t -> t .dependsOn (destructiveTask ));
114
+ lifecyleTasks .get (distribution .getType ()).configure (t -> t .dependsOn (destructiveTask ));
113
115
}
114
116
Map <String , TaskProvider <?>> batsTests = new HashMap <>();
115
117
batsTests .put ("bats oss" , configureBatsTest (project , "oss" , distributionsDir , copyDistributionsTask ));
@@ -127,6 +129,7 @@ public void apply(Project project) {
127
129
List <Object > vmDependencies = new ArrayList <>(configureVM (vmProject ));
128
130
vmDependencies .add (project .getConfigurations ().getByName ("testRuntimeClasspath" ));
129
131
132
+ Map <ElasticsearchDistribution .Type , TaskProvider <?>> vmLifecyleTasks = lifecyleTasks (vmProject , "distroTest" );
130
133
TaskProvider <Task > distroTest = vmProject .getTasks ().register ("distroTest" );
131
134
for (ElasticsearchDistribution distribution : distributions ) {
132
135
String destructiveTaskName = destructiveDistroTestTaskName (distribution );
@@ -141,6 +144,7 @@ public void apply(Project project) {
141
144
);
142
145
vmTask .configure (t -> t .dependsOn (distribution ));
143
146
147
+ vmLifecyleTasks .get (distribution .getType ()).configure (t -> t .dependsOn (vmTask ));
144
148
distroTest .configure (t -> {
145
149
// Only VM sub-projects that are specifically opted-in to testing Docker should
146
150
// have the Docker task added as a dependency. Although we control whether Docker
@@ -170,6 +174,17 @@ public void apply(Project project) {
170
174
});
171
175
}
172
176
177
+ private static Map <ElasticsearchDistribution .Type , TaskProvider <?>> lifecyleTasks (Project project , String taskPrefix ) {
178
+ Map <ElasticsearchDistribution .Type , TaskProvider <?>> lifecyleTasks = new HashMap <>();
179
+
180
+ lifecyleTasks .put (Type .DOCKER , project .getTasks ().register (taskPrefix + ".docker" ));
181
+ lifecyleTasks .put (Type .ARCHIVE , project .getTasks ().register (taskPrefix + ".archives" ));
182
+ lifecyleTasks .put (Type .DEB , project .getTasks ().register (taskPrefix + ".packages" ));
183
+ lifecyleTasks .put (Type .RPM , lifecyleTasks .get (Type .DEB ));
184
+
185
+ return lifecyleTasks ;
186
+ }
187
+
173
188
private static Jdk createJdk (
174
189
NamedDomainObjectContainer <Jdk > jdksContainer ,
175
190
String name ,
0 commit comments