YarnSetupTask: Remove a too coarse "onlyIf" in the "init" block

"installationDir" is the non-version specific top-level Yarn
installation directory simply called "yarn". Checking for its existence
is not sufficient to be able to skip the task, as another version than
the requested one could be installed below the "yarn" directory.

Instead of taking the version into account in this check, simply remove
it as the version-specific installation directory at "env.home" is
already marked as an "OutputDirectory", so Gradle itself already takes
care of skipping task execution if the output files were created before.
This commit is contained in:
Sebastian Schuberth
2019-09-04 21:45:04 +02:00
committed by Ilya Goncharov
parent 85ff979bd4
commit cc40387788
@@ -28,10 +28,6 @@ open class YarnSetupTask : DefaultTask() {
init {
group = NodeJsRootPlugin.TASKS_GROUP_NAME
description = "Download and install a local yarn version"
onlyIf {
!settings.installationDir.exists()
}
}
@TaskAction