groovyshell

How can I convince GroovyShell to maintain state over eval() calls?

I'm trying to use Groovy to create an interactive scripting / macro mode for my application. The application is OSGi and much of the information the scripts may need is not know up front. I figured I could use GroovyShell and call eval() multiple times continually appending to the namespace as OSGi bundles are loaded. GroovyShell maintai...

ANSI color support using Groovy on Windows XP

Trying out the examples found on pleac.sf.net, I'm not able to get an example of ANSI colors to work on my WinXP box (Works fine on MacOS). What I've found is that on my WinXP machine, in both cygwin & DOS prompts, groovysh --color (and 'groovysh --terminal=unix') shows escape codes rather than the expected colored prompt. grep --color w...

groovysh and groovy classes visibility and annotation parsing

Hello Everyone, I started using groovy intensely to prototype everything. This is amazing. But I faced the problem with groovy shell. Next code I run with groovy filename.groovy and everything works as expected. But within groovysh command load filename.groovy Doesn't work: it can't find class Book. The code: import org.hibern...

Running a script from Groovy

In order to get my setup a bit closer to "one click deployment", I would like to use groovy scripts to start/stop other processes controlled by bat scripts, running in different parts of the filesystem and even on different machines. How to execute these scripts and how to do it from their respective working directory? I know Java's ...

What are the pros and cons of using GroovyClassLoader vs. GroovyShell

I need to run some external code from my Java application that will be updated frequently and orthogonally to the rest of the application. As I do not to re-deploy the entire application for every code change (and for other reasons as well) we chose to use groovy for this code, and store it either on the file system or in the database. ...

Does GroovyShell cache the compiled scripts?

I plan to embed groovy in my application and use GroovyShell programatically - I will run the same script with different parameters several times with different parameters. Does GroovyShell caches the compiled script or does it work only as a stateless interpreter? ...

Grails shell not seeing domain objects

Hi, I'm a grails newbie (and a groovy newbie), and I'm working through some grails tutorials. As a new user, the grails shell is a really useful little tool for me, but I can't figure out how to make it see my classes and objects. Here's what I'm trying: % grails create-app test % cd test % grails create-domain-class com.test.TestObj ...

Are there any other Grash like enhanced Groovy shells ?

Grash seems to be an interesting approach to taking groovy to the next step in terms of connectivity and monitoring of java applications. However it seems to never have taken off and remained a toy. Has any done something similar, how did it work out ? Are there any other libs like Grash that do "more"... ...

How to add imports to groovysh on startup?

I'm working on a project where I'd like users to experiment with Java classes on Groovysh. I'd like to make it convenient for them and want to import certain packages by default, when groovysh starts up so that users would not have to re-type the same imports every time they start the shell. Does anyone know how to accomplish this? Than...