GenerateJavaTask is difficult for gradle to cache
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 217
- Forks
- 116
- PR merge metrics
- No merged PRs in 30d
Description
Hello!
My company is trying to optimize our gradle caching, and it looks like the DGS GenerateJavaTask is causing a bit of trouble. Specifically, the generateSourcesDir input is a String containing an absolute filepath, which seems to foil remote caching attempts (since repos are cloned to different locations on different machines). Gradle can cache paths well if they're annotated with @PathSensitive(PathSensitivity.RELATIVE), but I'm not sure whether that works on string properties.
I think that PR #356 would allow us to work around this; it'd let us assign specific values to the output dirs, so we could set generatedSourcesDir to some stable empty string and it'd stop busting the cache. Is that PR likely to be merged at some point?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with graphql-dgs-codegen-gradle/src/main/kotlin/com/netflix/graphql/dgs/codegen/gradle/GenerateJavaTask.kt, especially the generateSourcesDir input at line 34, and review PR #356 for the proposed direction. Determine how the absolute filepath affects Gradle remote caching and verify that the resulting task inputs and outputs remain cacheable across different checkout paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100