gradle-node-plugin
gradle-node-plugin copied to clipboard
YarnInstallTask should not declare yarn.lock as output if run with --frozen-lockfile
In #93 method getYarnLockFileAsOutput() was introduced to YarnInstallTask.kt which is annotated with @OutputFile.
The consequence is that the automatically generated task cleanYarn wants to remove that file.
In our workflow, this file is committed to git, so we get a dirty workspace when executing the 'clean' task for that project (which in turn executed the 'cleanYarn' task).
We do run the yarn task with the option --frozen-lockfile by default, and only turn it on with a gradle project option (i.e. we inverted the default behavior of yarn install)
I think the best solution would be to only declare yarn.lock as output if --frozen-lockfile is not set.