Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-dev] Joint Compillation Java / Groovy at the Groovy Eclipse Plug-in

Michael,

No you're not off track at all.

"But how can we make those files (ideally not real files on the file 
system) visible to the Eclipse Java compiler?"

Compilation participants usually generate source files by creating normal 
resource files within eclipse in their own generated source folder (so 
generated files do not collide with user created files). The generated 
source folder is on the classpath but is empty until the participant 
generates whatever files are necessary.

Why not make them real files in the file system AND inside eclipse ?

.k




Michael Klenk <mklenk@xxxxxx> 
Sent by: jdt-dev-bounces@xxxxxxxxxxx
02/25/2009 11:10 AM
Please respond to
"Eclipse JDT general developers list." <jdt-dev@xxxxxxxxxxx>


To
"Eclipse JDT general developers list." <jdt-dev@xxxxxxxxxxx>
cc

Subject
[jdt-dev] Joint Compillation Java / Groovy at the Groovy Eclipse Plug-in






Hi all,

We from the Groovy Eclipse plug-in Team have a question where we need
some help from you eclipse people.
http://groovy.codehaus.org/Eclipse+Plugin

Our problem:
In Groovy it is possible to mix up Groovy and Java classes. Imagine the
following setting.

Class A    in Java A.java
Class B extends A in Groovy B.groovy
Class C extends C in Java C.java

The standalone Groovy Compiler solves such a problem like this:
1. It generates stub classes (like Interfaces for this class) to enable
the Java compiler to run.
2. The Java compiler runs and generates the .class files for all Java 
files.
3. The Groovy compiler now cam compile the real .class files for the
Groovy sources.

http://blackdragsview.blogspot.com/2007/07/joint-compilation-in-groovy.html


This solution works well in a standalone compilation. We are now trying
to enable this functionality in the Groovy Eclipse plug-in where we
would like to use the eclipse Java compiler which is enabled in normal
Java projects in Eclipse.

I had the following idea to solve this.

The Eclipse Java compiler compiles the Java classes. Using the extension
point org.eclipse.jdt.core.compilationParticipant I attach a Class which
can generate the stubs of the groovy classes for the Java compiler
before compiling.
But how can we make those files (ideally not real files on the file
system) visible to the Eclipse Java compiler?

Can anyone of you give us some tips how to realize such a solution, or 
give
us some hints if we are completely off the track.

Thanks

Cheers Mike

-- 
Michael Klenk
Institut für Software - http://ifs.hsr.ch - +41 55 222 4625
HSR Hochschule für Technik Rapperswil
Oberseestr 10, Postfach 1475, CH-8640 Rapperswil

_______________________________________________
jdt-dev mailing list
jdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jdt-dev




Back to the top