codeconsole commented on PR #16224: URL: https://github.com/apache/grails-core/pull/16224#issuecomment-5414648954
Valid, and fixed in f197fa4. Reproduced first: compile `GreetingGrailsPlugin`, delete its class file as an incremental build does, then recompile a module with nothing that generates a sibling — `[com.example.GreetingAutoConfiguration]` survived. You were right that the rename case only passed because the class replacing it did the writing. Reconciling is now something the compilation does rather than something generating a class does. The global Grails transform runs for every source unit of a project and already writes generated metadata to the same directory, so it drops entries whose classes are no longer generated there — which happens whether or not anything was generated. Names registered by the compilation in hand are kept regardless, their class files being written in a later phase than any of this runs in. The file is now deleted rather than left empty when the last entry goes; an imports file with nothing in it is a resource that says nothing. Verified end to end on a real module rather than only in the specification: deleting `FarewellGrailsPlugin.groovy` from the `beans-dsl-plugin` example and rebuilding takes `beandsl.example.plugin.FarewellAutoConfiguration` out of the file and leaves `GreetingAutoConfiguration` in it. Four cases added: a deleted descriptor with nothing to replace it takes its entry with it; reconciling leaves an entry whose class is still generated; reconciling creates no file for a module that generates nothing; reconciling leaves a hand-authored file alone. One case this still does not reach, which seems right to leave: a module whose only source was the descriptor now has no sources at all, so nothing compiles and nothing runs. There is no plugin left at that point either. -- 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]
