Skip to content

Commit ed4bf10

Browse files
committed
Disable instead of only if
1 parent 859a87f commit ed4bf10

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

+3-3
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ class BuildPlugin implements Plugin<Project> {
263263
dockerBinary = '/usr/bin/docker'
264264
} else if (new File('/usr/local/bin/docker').exists()) {
265265
dockerBinary = '/usr/local/bin/docker'
266+
} else {
267+
dockerBinary = null
266268
}
267269
final int exitCode
268270
final String dockerErrorOutput
@@ -313,9 +315,7 @@ class BuildPlugin implements Plugin<Project> {
313315
if (rootProject.buildDocker) {
314316
rootProject.requiresDocker.add(task)
315317
} else {
316-
// do not overwrite an existing onlyIf closure
317-
final Closure onlyIf = task.onlyIf
318-
task.onlyIf { onlyIf && false }
318+
task.enabled = false
319319
}
320320
}
321321

0 commit comments

Comments
 (0)