How to avoid compiled classes cleanup in the Idea Project Runner?

Hi!

In idea i used to work with compiled classes cache and can't imagine how it will be if i need to recompile all classes every time. But idea project runner doesn't follow this approach, i see in logs:

[16:32:29]: in directory: C:\usr\JetBrains\TeamCity\buildAgent\work\7b4e9a47f8ecfe8b
[16:32:36]: default:
[16:32:38]: Cleaning output folders for 21 modules


and all compile output from the previous builds removed. For my project, compilation from the scratch takes more than 30 min, so i can't provide fast feed back on changes. take into account the time required to checkout changes for my big projects and say ggodbye to the fast feedback. Also, this annecessary loads our server box + build agents.


How do i configure runner to reuse classes compiled in previous builds?


Teamcity 6.5



Best regards, Alex


Message was edited by: Alexander Ashitkin

4 comments
Comment actions Permalink

This is not supported at the moment, moreover, incremental compilation is not that easy. It's not like, compile missed classes only, the task is much more complex. You have to analyze which classes depend on which, and so on.
For example, take a look at this post: http://stackoverflow.com/questions/3524150/is-it-possible-to-disable-javacs-inlining-of-static-final-variables
Javac can inline some constants directly in the classes, this means, that if class with constants changes you have to recompile all of the classes using these constants.

So far, we do not have feature of incremental compilation in IDEA project runner, but we want to add one.

0
Comment actions Permalink

Hi Pavel.
I considered it's as easy as reuse some api provided by embedded idea. Take into account, i have an options to achieve incremental compilation, which are not required any implementation efforts from Jetbrains:
1) to compile classes manually with ant, etc.
2) configure project with eclipse compiler with incremental compilation out of the box.

The very simple and sufficient step is just provide an option for dirty  compilation of changed classes, ignoring dependent classes - i can schedule daily build with full recompilation to avoid accumulated code gaps in compiled classes cache and ignore infrequent failures.

So probably as the first step it will be sufficient to provide an simple option to avoid cleanup anf compile only changed classes. One more simple step is to recompile only dependent modules, for example i have 21 modules and it will be significantly faster, if i recompile only 3 or 10 or 15. And if changed only xml configs, recompilation isn't required at all.

Thank you.
best regards, Alex

0
Comment actions Permalink

Well, example with xml and other resources is not that simple too. Quite ofthen tests depend on various .properties, .xml and so on. And compiler should detect changes in these files and copy them under classes directory. I understand your point, but I doubt that considering all of the consequences and troubles you may get, you'll be able to live with it even in a simple project. Just take into account time you'll spend debugging a test and finally find out that some class was not recompiled or resource was not copied to a proper place.

We are working in this direction, so chances are you'll see some results in our EAP builds for TeamCity 7.0.

0
Comment actions Permalink

Pavel, i assumed any changed file should be placed on classpath, but i don't need recompilation for updated resources. And of course, i understand all consequences of such setup. This will be dirty and unreliable build, but much more faster. decision should be up to the user.

Thank you and will wait for 7.0 eap.

regards, Alex

Message was edited by: Alexander Ashitkin

0

Please sign in to leave a comment.