I would like to create a command line tool to generate some java source code...e.g., a controller class, service class, and a DTO class. I've been trying to find the scripts for CreateController.groovy (from grails), but I've had no luck finding that script. Any help would be much appreciated. I think it might be done with Gant?
-
What version of Grails? That would be helpful information to include in your question. – Joshua Moore Oct 16 '19 at 16:50
-
really any version of grails. I just wanted to see an example of how they were generating java source – Ron Stevenson Oct 16 '19 at 17:46
-
Well here are a couple for 3.x https://github.com/orubel/Beapi-API-Framework/tree/master/grails-app/commands/net/nosegrind/apiframework – Orubel Oct 18 '19 at 03:41
1 Answers
I've been trying to find the scripts for CreateController.groovy (from grails), but I've had no luck finding that script.
You haven't indicated what version of Grails you want to use and that may be relevant. For recent versions of Grails there is not a CreateController.groovy
but the create-controller
command is defined at https://github.com/grails/grails-profile-repository/blob/master/profiles/web/commands/create-controller.yml.
I think it might be done with Gant?
Not since Grails 2. If you are using Grails 1 or 2, then a Gant script might be what you are looking for. For Grails 2.5.6, the command is defined at https://github.com/grails/grails-core/blob/bd7cc10e17d34f20cedce979724f0e3bacd4cdb4/grails-scripts/src/main/scripts/CreateController.groovy.

- 26,804
- 2
- 30
- 47