Marking processorOptions as internal (KspAATask) #2474
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses google/ksp#2467.
The issue originates from the
MapProperty
processorOptions
inKspGradleConfig
when usingKspAATask
. This map is populated with command-line argument values, but it is not aware of Gradle’s path sensitivity requirements, which leads to incorrect behavior, causing remote cache misses.As a workaround, this PR marks
processorOptions
as@Internal
and instead relies oncommandLineArgumentProviders
inKspAATask
to correctly track these inputs. To support this, similar to what is done inKspJvmTask
, we inject the KSP extension's command-line argument providers into the task command line argument.Since
processorOptions
is also populated from kspExtension.apOptions, we introduce a new MapProperty namedapOptions
to explicitly track these inputs.Let me know your thoughts!
Tests
Original issue when using ksp2 with room and comparing two builds with different location:

https://ge.solutions-team.gradle.com/c/7miiiuiclpapk/bssjjcajc36gu/task-inputs
Same scenario, but with this PR approach:

https://ge.solutions-team.gradle.com/c/nsld3bkfkwrmg/oqhb3co46yqto/task-inputs?cacheability=cacheable,overlapping-outputs,validation-failure
Now, forcing a change in the room gradle plugin configuration to use a different value to demonstrate that the inputs are tracked:
https://ge.solutions-team.gradle.com/c/d5yqiarcqmvnm/o52lpx2yreajg/task-inputs
And finally, defining a commandLine argument and using it in the ksp extension like:
https://ge.solutions-team.gradle.com/c/o52lpx2yreajg/kwryqqhvnrku6/task-inputs