codeconsole commented on PR #16224: URL: https://github.com/apache/grails-core/pull/16224#issuecomment-5414016731
Two review findings addressed in c0fba04. **Stale entries** — real, and confirmed before fixing: compiling `GreetingGrailsPlugin`, deleting its class file as an incremental build would, then compiling a renamed `FarewellGrailsPlugin` left `[com.example.FarewellAutoConfiguration, com.example.GreetingAutoConfiguration]`. Spring Boot does not start on an auto-configuration it cannot load. An entry is now kept only while the class it names is still generated into the module's own output — which is what the scanning task this replaces recalculated every time. Anything the current compilation registered is kept regardless, because class generation runs in a later phase than this does; without that, two descriptors rebuilt together would each prune the other, neither class file having been written yet. The set is weakly keyed on the compilation, so it is per-build rather than per-JVM in a reused daemon. Three cases added: a renamed descriptor drops its old entry; a descriptor left untouched by an incremental build keeps its entry; two descriptors recompiling together do not prune one another. Fixing it also exposed that the specification was compiling only to `CLASS_GENERATION`, which writes no class files — so the output directory it asserted against was empty and could not have shown any of this. It now runs through to `OUTPUT`. **Hand-authored file found only at the conventional path** — accurate, and now stated rather than glossed. A source set's resource directories are a build-tool notion and are not among the things a compiler is told, so one fixed location is all this can look in; `FactoriesFileWriter` reads `META-INF/grails.factories` from the same fixed path for the same reason. The javadoc and the guide now say so, and say that handling a relocated one needs the build to supply the location. I have not widened the behaviour, since doing it properly means passing resource directories in from the Gradle plugin — happy to follow up with that if you would like it in scope. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
