How to use Groovy Incremental Compiler in my application?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use Groovy Incremental Compiler in my application?

HubertChang
My goal: My application scans the groovy/java files under some paths
to detect the modifications and compile the modified files in runtime
and load the resulted classes to my application with classloader. I
think org.eclipse.jdt.groovy.core can help me achieve it.

Btw, on grails user list, I see someone want to compile .gsp files
runtimely. I think it is the same problem we want to resolved.

Which jar balls should be included?  Should I create one workspace in
my application to support incremental compilation? Could anyone
address one blog post on it? :)


Thanks a lot.

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: How to use Groovy Incremental Compiler in my application?

Andy Clement
Hi,

Not quite sure what you are after here...  It is possible to run the
eclipse compiler in incremental mode outside of eclipse, but we
haven't tried it yet.  We have only run it in non-incremental (batch)
mode outside of eclipse.

The same bootstrapping to run the regular eclipse compiler without an
IDE would then just need to point to our patched org.eclipse.jdt.core
with the org.codehaus.groovy and org.eclipse.jdt.groovy.core bundles
from groovy-eclipse, and that ought to allow incremental compilation
of mixed groovy/java codebases.

My suggestion would be to read up on how to run the eclipse compiler
in incremental mode outside of an IDE - I don't know where that is
written down though...

We may be exploring this approach for usage from grails in a little
while, but not at the moment.

cheers,
Andy

On 2 November 2010 19:25, Hubert Chang <[hidden email]> wrote:

> My goal: My application scans the groovy/java files under some paths
> to detect the modifications and compile the modified files in runtime
> and load the resulted classes to my application with classloader. I
> think org.eclipse.jdt.groovy.core can help me achieve it.
>
> Btw, on grails user list, I see someone want to compile .gsp files
> runtimely. I think it is the same problem we want to resolved.
>
> Which jar balls should be included?  Should I create one workspace in
> my application to support incremental compilation? Could anyone
> address one blog post on it? :)
>
>
> Thanks a lot.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: How to use Groovy Incremental Compiler in my application?

Andrew Eisenberg
In reply to this post by HubertChang
A short while ago, I bundled the compiler and related jars for use in
batch mode  This was specifically for using the compiler with ant and
maven, but there is a link to download the batch compiler separately.

http://contraptionsforprogramming.blogspot.com/2010/09/where-are-all-my-stubs.html


And in this next link, you can have a peek at the code for the maven
compiler plugin that uses the compiler.  It shows the api you can call
to directly invoke the compiler:

http://contraptionsforprogramming.blogspot.com/2010/10/more-on-groovy-eclipse-and-maven.html

This doesn't directly answer your question, but perhaps this takes you
a little bit closer.


On Tue, Nov 2, 2010 at 7:25 PM, Hubert Chang <[hidden email]> wrote:

> My goal: My application scans the groovy/java files under some paths
> to detect the modifications and compile the modified files in runtime
> and load the resulted classes to my application with classloader. I
> think org.eclipse.jdt.groovy.core can help me achieve it.
>
> Btw, on grails user list, I see someone want to compile .gsp files
> runtimely. I think it is the same problem we want to resolved.
>
> Which jar balls should be included?  Should I create one workspace in
> my application to support incremental compilation? Could anyone
> address one blog post on it? :)
>
>
> Thanks a lot.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: How to use Groovy Incremental Compiler in my application?

HubertChang
I've read your great articles many times before I posted here:).

Thanks your clarify.