Repository navigation
Keep the SCIP javac plugin attached when builds replace compiler arguments - #1047
Open
christoph-sg wants to merge 3 commits into
Open
christoph-sg wants to merge 3 commits into
christoph-sg wants to merge 3 commits into
Conversation
Builds that replace JavaCompile.options.compilerArgs after the plugin has configured the task silently dropped -Xplugin:scip, so their Java sources were not indexed. Spring Framework's build conventions call setCompilerArgs in afterEvaluate, which runs after the plugin's own afterEvaluate. Pass the argument through compilerArgumentProviders instead, which setCompilerArgs does not touch. The provider still skips the argument when the build already passes -Xplugin:scip itself. Co-authored-by: Amp <[email protected]> Amp-Thread-ID: https://ampcode.com/threads/T-01a178a8-3c2c-75e0-bfa6-7417585d4372
The plugin only added itself to annotationProcessor when that configuration declared dependencies directly. The Error Prone Gradle plugin makes annotationProcessor extend its own errorprone configuration, so Gradle passed -processorpath without the plugin jar and compilation failed with "plug-in not found: scip". Check inherited dependencies too. Co-authored-by: Amp <[email protected]> Amp-Thread-ID: https://ampcode.com/threads/T-01a178a8-3c2c-75e0-bfa6-7417585d4372
-Xplugin:scip is passed to every JavaCompile task, but the plugin jar was only added to the main and test source sets, so tasks of other source sets failed with "plug-in not found: scip". Examples are retrofit's extra source set and Spring Framework's multi-release java21 source set. Spring only got away with it because its conventions replaced the compiler arguments of those tasks too. Add the jar to the compileOnly and, when it has processors, the annotation processor configuration of every source set. Co-authored-by: Amp <[email protected]> Amp-Thread-ID: https://ampcode.com/threads/T-01a178a8-3c2c-75e0-bfa6-7417585d4372
christoph-sg
marked this pull request as ready for review
October 28, 2026 08:10
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Spring Framework's Java sources were silently not indexed: the build and
scip-java indexsucceeded, but produced no Java documents.Builds that replace
compilerArgsdrop the plugin. Spring's build conventions calloptions.setCompilerArgs(...)inafterEvaluate, which runs after the plugin's ownafterEvaluateand replaces the list holding-Xplugin:scip. The argument now comes from aCommandLineArgumentProviderinoptions.compilerArgumentProviders, whichsetCompilerArgsdoesn't touch.With the argument surviving, two existing bugs that Spring's override had hidden made compilation fail with
plug-in not found: scip:annotationProcessorwhen that configuration declared dependencies directly. The Error Prone Gradle plugin, which Spring applies, makes it extenderrorprone. It now checks inherited dependencies too.JavaCompiletask, but the jar only went tocompileOnlyandtestCompileOnly. It now goes to every source set, which covers Spring's multi-releasejava21source set and retrofit'sextrasource set. Retrofit at dce3fe08 failed in:retrofit:compileExtraJavabefore and now indexes 302 of its 307 Java files.