History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GROOVY-2808
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Danno Ferrin
Reporter: Peter Niederwieser
Votes: 0
Watchers: 1
Operations

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

Global transforms should only be executed once in IntelliJ IDEA

Created: 04/May/08 11:51 AM   Updated: 04/May/08 05:56 PM
Component/s: None
Affects Version/s: 1.6-beta-1
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Java Archive File transformtest.jar (2 kb)

Environment:
Mac OS 10.5.2
JDK 1.5.0_13
IDEA 7.0.3
JetGroovy 1.5.16023


 Description  « Hide
In IntelliJ IDEA, when I build a Groovy project that has a dependency containing a global transform, for some reason the transform is executed twice. When I compile with groovyc or run FileSystemCompiler in IDEA, the transform is only executed once (as expected). I've studied the transform implementation (specifically ASTTransformationVisitor) but haven't found the cause of the problem. All I know is that the transform is invoked twice on the same ModuleNode instance. SourceUnit reports phase "conversion" instead of "semantic analysis", but I guess that's because SourceUnit.phase is no longer incremented after phase conversion.

To reproduce the problem, I've attached a jar containing a transform that will create a file transformlog.txt in your user home and append "transform invoked\n" every time the transform is invoked. (What's the preferred way to produce debug/info output in a transform, and will this output also be shown in IDEA?)
In IDEA, add the jar as a dependency to any Groovy project and rebuild. To build with groovyc, type "groovyc -cp ./transformtest.jar:<your_path>/groovy-all-1.6-beta-2-SNAPSHOT.jar <any_groovy_file>". Don't forget to delete transformlog.txt between compiler invocations.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.