Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

grails-app/utils dir

Tags:

grails

I've just noticed the existence of the grails-app/utils dir. I've never seen it referred to in any documentation (or used in a project). It's created by default when you run create-app, any idea what you're supposed to put in there?

"Utility" code is an obvious guess, but it seems like that should go under the src dir.

Thanks, Don

like image 717
Dónal Avatar asked Feb 05 '10 20:02

Dónal


1 Answers

the grails-app/utils/ directory is where items like Codecs go.

I'm not sure what else goes there, but you can include other classes there and they will be included within the Application

EDIT: The grails-app/utils/ directory is meant for "Grails specific utilities" (Artefacts, GrailsClasses, etc.)

Jeff Brown(Core member of the Grails development team) responded to a question on the mailing list that confirms this. He said:

You can put just about anything you like in the utils directory but it is really for Grails specific utilities. At the moment I think the only thing really targeted at this directory are custom codecs. Your application classes that are not Grails artifacts should go under src/groovy/

You can find an example of a new Grails Artefact in the Constriants plugin. The Author of this plugin recommends that users put their Constraint classes in the grails-app/utils/ directory.

like image 154
Colin Harrington Avatar answered Oct 04 '22 04:10

Colin Harrington