using plugin classes from _Events.groovy.

View: New views
4 Messages — Rating Filter:   Alert me  

using plugin classes from _Events.groovy.

by Luke Daley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In a plugin I am working on, I need to use classes from src/groovy in  
my _Events.groovy.

The problem is that when _Events.groovy is sourced those classes  
aren't compiled and available.

Any options other than resorting to loadClass() ?

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: using plugin classes from _Events.groovy.

by Peter Ledbrook :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> In a plugin I am working on, I need to use classes from src/groovy in my
> _Events.groovy.
>
> The problem is that when _Events.groovy is sourced those classes aren't
> compiled and available.
>
> Any options other than resorting to loadClass() ?

Nope, don't think so. Other than put the classes in a JAR file.

Peter

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: using plugin classes from _Events.groovy.

by Richard Vowles :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I agree, I had to resort to loadClass as well, it was a little nasty, but there wasn't that much code.

On Thu, Oct 22, 2009 at 7:31 AM, Peter Ledbrook <peter@...> wrote:
> In a plugin I am working on, I need to use classes from src/groovy in my
> _Events.groovy.
>
> The problem is that when _Events.groovy is sourced those classes aren't
> compiled and available.
>
> Any options other than resorting to loadClass() ?

Nope, don't think so. Other than put the classes in a JAR file.

--
---
Richard Vowles,
Grails, Groovy, Java
Consistency is the last refuge of the unimaginative - Oscar Wilde
ph: +64275467747, linkedin, skype:rvowles
get 2Gb shared disk space in the cloud - Dropbox, its incredibly useful! - http://tinyurl.com/cmcceh
podcast: http://www.illegalargument.com

Re: using plugin classes from _Events.groovy.

by Luke Daley :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 22/10/2009, at 4:31 AM, Peter Ledbrook wrote:

>> In a plugin I am working on, I need to use classes from src/groovy  
>> in my
>> _Events.groovy.
>>
>> The problem is that when _Events.groovy is sourced those classes  
>> aren't
>> compiled and available.
>>
>> Any options other than resorting to loadClass() ?
>
> Nope, don't think so. Other than put the classes in a JAR file.

I went with that.

I also had to force a compile, but it's invoked only before it's  
actually needed, not on each execution of _Events.

Any objections to that?

It feels a little iffy to me, but I can't find any negative side  
affects or another way.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email