Skip to content
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

JGivenPlugin breaks gradle cache #449

Closed
jsalinaspolo opened this issue Jan 27, 2020 · 0 comments
Closed

JGivenPlugin breaks gradle cache #449

jsalinaspolo opened this issue Jan 27, 2020 · 0 comments

Comments

@jsalinaspolo
Copy link
Contributor

jsalinaspolo commented Jan 27, 2020

Tasks using JGiven will not be cacheable because lambdas are not supported

Non cacheable task action: Additional implementation type was implemented by 
the Java lambda 'com.tngtech.jgiven.gradle.JGivenPlugin$$Lambda$206/1491774273'. 
Using Java lambdas is not supported, use an (anonymous) inner class instead.

https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:how_does_it_work

For tracking the implementation of tasks, task actions and nested inputs, Gradle uses the class name and an identifier for the classpath which contains the implementation. There are some situations when Gradle is not able to track the implementation precisely:

Unknown classloader
When the classloader which loaded the implementation has not been created by Gradle, the classpath cannot be determined.

Java lambda
Java lambda classes are created at runtime with a non-deterministic classname. Therefore, the class name does not identify the implementation of the lambda and changes between different Gradle runs.

When the implementation of a task, task action or a nested input cannot be tracked precisely, Gradle disables any caching for the task. That means that the task will never be up-to-date or loaded from the build cache.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant