gradle-node-plugin icon indicating copy to clipboard operation
gradle-node-plugin copied to clipboard

Caching usage in documentation

Open sergey-morenets opened this issue 3 years ago • 1 comments

Hi

Caching is one the most exciting features in Gradle so I would mention it in the plugin documentation. So that new developers will be easier to use it. For example:

task buildAngular(type:YarnTask, dependsOn: 'yarn_install') {
   ///
   outputs.cacheIf { true }
   ///
}

sergey-morenets avatar Apr 28 '21 16:04 sergey-morenets

Just a note that generally this is probably not how you should use Gradle's caching since NPM/Yarn have a better understanding of their domains and therefore can provide better solutions to caching.

https://docs.gradle.org/7.3/userguide/more_about_tasks.html#sec:untracked_external_tool

Sometimes you want to integrate an external tool like Git or Npm, both of which do their own up-to-date checking. In that case it doesn’t make much sense for Gradle to also do up-to-date checks.

Related to #157. Also, specifically for Yarn > v1, they have the "Plug'n'Play" thing which doesn't leave much to be cached - https://yarnpkg.com/features/pnp.

nickcaballero avatar Dec 02 '21 22:12 nickcaballero