[ https://issues.apache.org/jira/browse/GROOVY-11161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17886492#comment-17886492 ]
Eric Milles commented on GROOVY-11161: -------------------------------------- So for Eclipse, we specifically need to screen off the local project's {{META-INF/groovy}} resources so they do not get seen by the extension module scanner. There have been attempts to allow extensions declared by "main" sources to be used in "test" sources of the same project. I forget ATM if this was implemented or just experimented with. > Support extension methods inside the same compilation unit > ---------------------------------------------------------- > > Key: GROOVY-11161 > URL: https://issues.apache.org/jira/browse/GROOVY-11161 > Project: Groovy > Issue Type: Wish > Components: Static compilation, Static Type Checker > Affects Versions: 4.0.14 > Reporter: Christopher Smith > Priority: Major > > Currently, the Groovy compiler supports extension methods only if they are > previously compiled and provided to the current compilation run on the > classpath. I have several projects where using extension methods to make > project-specific micro-DSLs would substantially improve > readability/maintainability, but because the extension methods need to refer > to business objects, I would have to slice up the project into a pile of > micro-projects. > It would be very useful to be able to have a "bootstrap" mechanism to declare > extension methods within the same project they're applied to, in the same way > that annotations can be declared inside the same project. Either having an > annotation {{@ProvidesExtensionMethods}} or providing a {{META-INF}} file > (maybe being able to employ the usual mechanism for "forward extension > declarations"?) would accomplish what I think I'm looking for. -- This message was sent by Atlassian Jira (v8.20.10#820010)