@@ -84,8 +84,6 @@ import java.nio.charset.StandardCharsets
84
84
import java.nio.file.Files
85
85
86
86
import static org.elasticsearch.gradle.tool.Boilerplate.maybeConfigure
87
- import static org.elasticsearch.gradle.tool.DockerUtils.assertDockerIsAvailable
88
- import static org.elasticsearch.gradle.tool.DockerUtils.getDockerPath
89
87
90
88
/**
91
89
* Encapsulates build configuration for elasticsearch projects.
@@ -208,51 +206,6 @@ class BuildPlugin implements Plugin<Project> {
208
206
}
209
207
}
210
208
211
- static void requireDocker (final Task task ) {
212
- final Project rootProject = task. project. rootProject
213
- ExtraPropertiesExtension ext = rootProject. extensions. getByType(ExtraPropertiesExtension )
214
-
215
- if (rootProject. hasProperty(' requiresDocker' ) == false ) {
216
- /*
217
- * This is our first time encountering a task that requires Docker. We will add an extension that will let us track the tasks
218
- * that register as requiring Docker. We will add a delayed execution that when the task graph is ready if any such tasks are
219
- * in the task graph, then we check two things:
220
- * - the Docker binary is available
221
- * - we can execute a Docker command that requires privileges
222
- *
223
- * If either of these fail, we fail the build.
224
- */
225
-
226
- // check if the Docker binary exists and record its path
227
- final String dockerBinary = getDockerPath(). orElse(null )
228
-
229
- final boolean buildDocker
230
- final String buildDockerProperty = System . getProperty(" build.docker" )
231
- if (buildDockerProperty == null ) {
232
- buildDocker = dockerBinary != null
233
- } else if (buildDockerProperty == " true" ) {
234
- buildDocker = true
235
- } else if (buildDockerProperty == " false" ) {
236
- buildDocker = false
237
- } else {
238
- throw new IllegalArgumentException (
239
- " expected build.docker to be unset or one of \" true\" or \" false\" but was [" + buildDockerProperty + " ]" )
240
- }
241
-
242
- ext. set(' buildDocker' , buildDocker)
243
- ext. set(' requiresDocker' , [])
244
- rootProject. gradle. taskGraph. whenReady { TaskExecutionGraph taskGraph ->
245
- final List<String > tasks = taskGraph. allTasks. intersect(ext. get(' requiresDocker' ) as List<Task > ). collect { " ${ it.path} " . toString()}
246
-
247
- if (tasks. isEmpty() == false ) {
248
- assertDockerIsAvailable(task. project, tasks)
249
- }
250
- }
251
- }
252
-
253
- (ext. get(' requiresDocker' ) as List<Task > ). add(task)
254
- }
255
-
256
209
/* * Add a check before gradle execution phase which ensures java home for the given java version is set. */
257
210
static void requireJavaHome (Task task , int version ) {
258
211
// use root project for global accounting
0 commit comments