Reputation: 29477
Grails 2.4.5 here. Currently I use several Grails plugins with my Grails app, and doing a "full" local build requires me to run several Grails commands in a row:
// 1.
grails clean
grails refresh-dependencies
// 2. Codenarc
grails codenarc
// 3. Run unit tests
grails test-app -unit
// 4. If all pass, then build with lightweight deployer plugin
grails lightweight --artifactName=myapp
I would like to know if there's a way to (perhaps in BuildConfig
) federate all of these separate invocations into a single buildAll
command, and fail the build if any one of them throws BuildExceptions
along the way (all of them do if there are problems).
Ideally it would be great if I could just do:
grails buildAll
And accomplish all of the 4 steps above each time.
Note: If you're all like "Dude, you shouldn't have to refresh-dependencies
each time, brah" then I'm all like "Dude, there's some major bugs in 1+ of the plugins that I'm using, so yes I do, brah".
Upvotes: 0
Views: 132
Reputation: 2354
Open your grails installation folder (GRAILS_HOME/grails/scripts). Within the scripts folder you will find many scripts which internally are using each other. Something like below.
includeTargets << grailsScript("_GrailsInit")
includeTargets << grailsScript("_GrailsClasspath")
includeTargets << grailsScript("_GrailsRun")
You could also execute the scripts in similar way from your script.
For running tests look at some code snippet here.
This SO link here should also help.
Upvotes: 1