Can IDEA perform true minimum compilation with alternative compilers? Follow
A colleague just showed Eclipse functionality where you could run a piece of a junit test, just a method, even when another method in the same unit test class was uncompilable. He also showed where Eclipse could build just the minimum that was absolutely necessary to run the test if you were starting fresh having never compiled the project before - so maybe it compiles the 10 truly necessary classes instead of 1000+.
I see that IDEA allows to switch out the compile with either the Eclipse or Eclipse Embedded compilers. Is there some way to accomplish what he was showing by switching to one of the Eclipse compilers and changing some other settings? I take it one or both of these alternative compilers can accomplish the above - is that part of why they are available?
Please sign in to leave a comment.
To do the same in IDEA:
1. Use the Eclipse compiler
2. Specify "-proceedOnError" as a command line parameter
3. Disable "Make before launch" in your run configuration
-proceedOnError instructs the Eclipse compiler to continue compiling when an error is found. Any code containing an error is stubbed so it will just throw an error at runtime. Make before launch has to be disabled, because a launch will not continue if the compiler reported errors.
Enable "Honor dependencies on 'compile' command" in the compiler settings and use Compile (not Make) to compile your test. Again "Make before launch" has to be disabled.
Bas
why would anyone want to do that?
"oops, forgot to fix that error before i started my 4 week holiday tour because in eclipse i could run it"
It does seem like a strange use case but the Eclipse guy is very excited/proud of this feature and stated it was why he gave up on his tentative first attempt to use IDEA....so I was hoping there might be a way to tempt him back.
FYI - for those not using the web interface, Bas posted an answer visible on the web interface only that tells you how to accomplish the same thing in IDEA. Unfortunately the synching on these forums between the web interface and newsreader interfaces is broken and has remained unreliable for ages despite feedback and complaints.
Bas,
It all works as expected with these settings. Thanks for the info! May be able to get a convert with this.
Jon
I have posted an item on
http://www.intellij.net/forums/forum.jspa?forumID=29&start=0 about
this... just want to make sure this is picked up and sorted - us
forum-hounds using NNTP don't want to miss a thing.
N.
Jon Steelman wrote: