Saturday, January 22, 2011

Grails with Aptana Studio 3 on Mac OSX

Setting JAVA_HOME: (http://www.oreillynet.com/mac/blog/2001/04/mac_os_x_java_wheres_my_java_h.html )
setenv JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Home

Setup Grails (http://www.grails.org/Installation)
git clone git://github.com/grails/grails-core.git
Set the GRAILS_HOME environment variable to CHECKOUT_LOCATION/grails-core
Add the $GRAILS_HOME\bin directory to your PATH environment variable
Go to the GRAILS_HOME directory and run: ./gradlew libs

In Aptana Studio Workspace
grails create-app grails-demo
New Project 'grails-demo'

Then in the grails-demo project
> grails run-app

Note that grails commands feel much slower than the equivalent ruby commands, and initial application startup is significantly slower. I actually was beginning to wonder if everything was working as the browser spun.. patience paid off and I was rewarded with the initial welcome page.

Also attempted to add some sort of groovy support, but without any real success. Java editor helps with syntax highlighting of terms in the groovy files, but is cluttered reporting other syntax and compile errors 'cause doesn't understand groovy.

Note that 'natures' do report several groovy natures, but these do not appear to be associated with any file types.

2 comments:

  1. Somewhat disappointing, grails create-app produces quite a few empty directories. Git of course doesn't track any empty directories. So until you get a few files developed, you have to be careful if you try to force a rollback to an earlier state. It won't delete new files.

    You can follow advice to add .gitignore files to all the empty directories, or just be careful to manually delete files. untill you've developed enough app to trust git.

    ReplyDelete
  2. Make sure you have a recent version of the Groovy Eclipse plugin installed:

    http://dist.springsource.org/release/GRECLIPSE/e3.5/

    or

    http://dist.springsource.org/release/GRECLIPSE/e3.6/

    depending on the underlying Eclipse version.

    Application startup time should be much improved for Grails 1.4, 1st half of 2011.

    ReplyDelete