Leda external builder events missing

I'm listening to class file changes with implementation proposed here: http://confluence.jetbrains.net/display/IDEADEV/IntelliJ+IDEA+Virtual+File+System
Unfortunately the build events of the new external builder are often missing. I can see .java file change, .class file timestamp does change, but the event will never reach the listener. The log shows that builder was indeed executed "BUILDER_PROCESS [stdout]: Build process started. Classpath:... ". I tried outputing all events, and the class file change just won't appear.
Is there a workaround? I understand that the Virtual File System isn't exactly equal to the actual file system, but I don't know the origin of this problem. The thing that worries me most, is that sometimes it does work and the events do appear, so it's kind of a random.

6 comments
Comment actions Permalink

VFS events are sent only for files that have been loaded into VFS. So if a class file was never accessed via VFS IDEA won't fire event when its
contents is changed. Previously all files from output directories were loaded into VFS during compilation so IDEA fires events for changed *.class files.

If you need to listen changes of files generated during the compilation process you can register a implementation of CompilationStatusListener and
implement its fileGenerated method.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Hello Joonas,
What is the problem you're trying to solve?
VFS events are sent only for the part of the filesystem which was loaded into the VFS. When the external make is used, the directories containing output class files are not loaded into the VFS, and therefore no events are sent for them. (And it's really better to keep it that way from the perfromance point of view.)

0
Comment actions Permalink

Hi,
Thanks for the quick response. The plugin I'm developing requires information about changed files in the project folder (Files changed during compilation is minimum it should detect).
Nikolay, I'll look into that listener. Thank you very much!

0
Comment actions Permalink

I implemented the CompilationStatusListener and added it to
CompilerManager.getInstance(project).addCompilationStatusListener(listener);
However the fileGenerated() method is never called. The compilationFinished() method is called every time I compile. What am I missing?
(Using IDEA 11 for development)

0
Comment actions Permalink

So, anyone has a clue, what I am doing wrong, or why isn't the method ever called on compilation?

0
Comment actions Permalink

fileGenerated() event is fired by the external build only so please make sure that the corresponding option is enabled. Also note that this event is
fired only for *.class files which were really changed during compilation.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Please sign in to leave a comment.