Grails

run script within Grails context

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.3.6, 1.4-M1
  • Component/s: None
  • Labels:
    None

Description

See great post by Ted Naleid regarding: Executing a script within the Grails context. This should be part of the Grails distribution.

http://naleid.com/blog/2008/03/31/using-gant-to-execute-a-groovy-script-within-the-grails-context-updated/

...which implements the ability to do something like this (from command line):

grails run-script [path-to-script-1] [path-to-script-2]...[path-to-script-n]

Activity

Hide
Neil Yalowitz added a comment -

Passing arguments seems to have been addressed:

http://jira.codehaus.org/browse/GRAILS-2663

However, being able to easily run a specific class from the command line with the Grails context loaded is very valuable, so I hope some attention could be given to implementing the above script.

Show
Neil Yalowitz added a comment - Passing arguments seems to have been addressed: http://jira.codehaus.org/browse/GRAILS-2663 However, being able to easily run a specific class from the command line with the Grails context loaded is very valuable, so I hope some attention could be given to implementing the above script.
Hide
Vladimir Grichina added a comment -

Ted's script doesn't work in Grails 1.3.1.

I've made updated version which works and posted on blog:
http://www.componentix.com/blog/15

Show
Vladimir Grichina added a comment - Ted's script doesn't work in Grails 1.3.1. I've made updated version which works and posted on blog: http://www.componentix.com/blog/15
Hide
Akil Franklin added a comment -

This would be a fantastic enhancement to the platform. I have a lot of "quick and dirty" grails apps that have grown to be mission-critical over time. Making classes accessible from a regular groovy script would allow me to reuse all of that code without the pain of a major refactor.

If there is already another way to do this, I'd love to hear about it. If not, I'd love to see this feature implemented.

Show
Akil Franklin added a comment - This would be a fantastic enhancement to the platform. I have a lot of "quick and dirty" grails apps that have grown to be mission-critical over time. Making classes accessible from a regular groovy script would allow me to reuse all of that code without the pain of a major refactor. If there is already another way to do this, I'd love to hear about it. If not, I'd love to see this feature implemented.
Hide
Vladimir Grichina added a comment -

> If there is already another way to do this, I'd love to hear about it. If not, I'd love to see this feature implemented.

Akil, I am not sure what do you mean if there is already another way to do this. Current way is just using custom build script (described in the blog post) which can be added either to particular project or to the Grails installation.

Show
Vladimir Grichina added a comment - > If there is already another way to do this, I'd love to hear about it. If not, I'd love to see this feature implemented. Akil, I am not sure what do you mean if there is already another way to do this. Current way is just using custom build script (described in the blog post) which can be added either to particular project or to the Grails installation.
Hide
Ted Naleid added a comment -

Just updated the script to work with grails 1.3.5. If there's interest in this, grails core is welcome to incorporate it.

Show
Ted Naleid added a comment - Just updated the script to work with grails 1.3.5. If there's interest in this, grails core is welcome to incorporate it.
Hide
Neil Yalowitz added a comment -

In my opinion, this is a must-have feature for Grails core.

Show
Neil Yalowitz added a comment - In my opinion, this is a must-have feature for Grails core.
Hide
Corey added a comment -

Could we please have this integrated into 1.3.6? Please?

Show
Corey added a comment - Could we please have this integrated into 1.3.6? Please?

People

Vote (9)
Watch (11)

Dates

  • Created:
    Updated:
    Resolved: