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

The -Astubs parameter can't contain a relative path which impacts Gradle task cacheability

Open jprinet opened this issue 1 year ago • 0 comments

Issue

The Gradle JavaCompile task is leveraging the worker API and as such has ~/.gradle/workers as working directory. It means that in the task context a relative path can't be used to retrieve resources like stubs for instance.

It is obviously possible to fallback to an absolute path location using ${project.rootdir}/stubs-example-folder but this has a negative impact on build caching as the task inputs can't be relocated. This means that you would only get a build cache hit when the project is built from the same location.

see this section of the Gradle documentation to get more details.

Potential fix:

Add the project directory as an internal input and use it as a prefix in the path if relative

jprinet avatar Jul 05 '23 09:07 jprinet