Issue Details (XML | Word | Printable)

Key: GROOVY-1951
Type: Sub-task Sub-task
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jochen Theodorou
Reporter: Jochen Theodorou
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
groovy
GROOVY-1735

build a compiler that can compile mixed groovy and java code on the command line

Created: 24/Jun/07 11:06 AM   Updated: 24/Jun/07 11:09 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1-beta-2

Time Tracking:
Not Specified


 Description  « Hide
by generating stubs for the groovy files it is possible to let the java files compile without using the real groovy files, but java files, that are equal enough to produce compatible bytecode. the Groovy compiler will then compile the .groovy files, which overwrites the .class files generated from the stubs. This way it is not possible to compile groovy files that are not part of the list of files to compile. That means for example if I do "groovyc C.groovy B.java" and B.java depends on a file A.groovy, then this will not compile, because the groovy compiler is not able to reuse the information of the java compiler that a lookup for a A.groovy is needed. Instead. to compile this, "groovyc A.groovy B.java C.groovy" is needed. All files must be known before. This is also the reason that this solution will not compile at runtime, because a discovery mechanism for java files depending on groovy files would be needed and that is not doable by stubs, not wihtout additional information provided by the compiler.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jochen Theodorou added a comment - 24/Jun/07 11:09 AM
thanks to Alex Tkachman for provding an initial solution for this. I committed a modified version of his idea where the ResolveVisitor itself is unchanged and the compilation operations are used instead. The stub generator is the same.