-
Grails 1.1 does not allow the classname Category
Posted on April 18th, 2009 4 commentsThere are tutorials around for older versions of Grails that use Category as a class name. However since v 1.1 this name collides with the Groovy-class groovy.lang.Category. If you use it you get the error “ERROR plugins.DefaultGrailsPlugin - Cannot generate controller logic for scaffolded class interface groovy.lang.Category. It is not a domain class!” It took me two hours to find out about that. Even googling was not very successful. As you can imagine it drove me mad. So don’t use Category, even if you want to create a category class! Use something else…
-
Howto enable syntax-highlighting for Groovy/Grails in Smultron
Posted on April 18th, 2009 4 commentsI recently started playing around with Groovy and Grails. As I usually prefer simple & lightweight text-editors for coding rather than complex IDEs like eclipse (doing all the ruff stuff like compiling at the command line) I wanted to use it with my favourite text-editor on the Mac: Smultron. Unfortunately the current version of Smultron (3.5.1) does not support Groovy syntax. Googling around I found out that I’m not the only person that wants to use Smultron for Groovy/Grails, there is even a feature request for it. Peter Borg, the developer said that he will add groovy-syntax-highlighting if someone sends him a syntax definition. Thats fine, but I don’t want to wait for the next version… I want to use it NOOOOW ;)!!!
So again it seems that a woman is needed to do a mans work. I looked around a little bit and found this description on adding custom syntax highlighting for smultron. Basically its very easy to add a new syntax definition. If you installed the Apple developer tools on your Mac its super-easy as you can use the Property List Editor which can be found at Macintosh HD/Developer/Applications/Utilities/Property List Editor.app. If you don’t have the Developer tools installed it is still possible to create the syntax definition, but you need some XML-knowledge. I will only show the first way so I strongly recommend that install the Property List Editor (as a Developer you should have installed the Mac Development Tools anyway ;)).


