Closed crizzis closed 2 years ago
I believe this is an issue in Groovy's stub generator. I don't think the stub generator looks handles the @BaseScript
annotation.
If you don't mind my asking, why do you need it in the stubs? This feature is typically used in Groovy scripts, which wouldn't be compiled (or shared with Java). But if this is something you need, we can open a Jira.
I'm trying to create a custom groovy dsl, with (among other things) the class declaration stripped off. I reference the generated classes directly in my code (I'm calling Script.run() programmatically), so I do compile the files written using the dsl. I also need a base script class to provide the root methods exposed by the dsl. I found a workaround, though: I disabled stub generation for those particular scripts, then used the addStubSources
goal to reference stubs from another location (which I created by hand). So this feature is now a nice-to-have for me.
Opened a JIRA here: https://issues.apache.org/jira/browse/GROOVY-10584?filter=-2
Closing this ticket. Thanks for your help!
Thanks for reporting this!
Base script class:
@BaseScript
- annotated Groovy script:Generated stub:
Tried both the annotated variable and annotated package syntax, same result