-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support using Gradle Build Cache with Yarn tasks #205
Conversation
There's actually no need to track the yarn working directory as an input. The only thing this affects is how we calculate the output directory. Since we track the output directory explicitly this is unneeded. Removing this also removes an absolute path from the task inputs, allowing the Gradle build cache to work across different machines.
We should ignore absolute paths on task inputs unless absolutely necessary in order to allow caching of tasks with the Gradle build cache across machines.
Hi. Thanks for the pull. But I noticed the build's are failing. Possible to fix that? |
This effectively disabled the validation done by using input annotations. The result is the same behavior as using `TaskInputs.files` which is to not validate that the input files are present and exist. While not preferable this at least limits breaking existing users which might have a unique configuration.
Sorry about that. The issue is that converting to using the input annotations enforced validation checks that the inputs API does not perform. Specifically, ensuring that input files exist. My guess is that this is only breaking the tests but I expect someone out in the wild might have a similar configuration (not using yarn.lock). I've relaxed the validations to emulate with the old behavior was, which is just ignoring that input if the file doesn't exist. I'd suggest doing something more robust in the future but this should at least keep existing plugin users working. |
@mark-vieira I noticed this when updating the version of gradle-node-plugin - cool change. Just wondering, since this doesn't add @CacheableTask
class CacheableYarnInstallTask extends YarnInstallTask {
}
project.tasks.create('cacheableYarn', CacheableYarnInstallTask.class); |
Adding
|
@mark-vieira Ah, didn't realize |
This pull request enables the ability for users of Yarn install and setup tasks to enable Gradle Build Cache support. This relies on relaxing incremental build checking to use only relative path checking so that task outputs creating on one machine (or workspace directory) can be reused somewhere else. Older versions of Gradle will behave the same and ignore
@PathSensitive
annotations.This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)