How to not auto-build another project in the same workspace

Posted by ruan007 on 10-Jul-2011 00:07

Hi,

I have two projects in the same workspace, they are not dependent on each other. When I try to launch a form from one of the project, OEA always builds both projects, if there is a error in another project, it stops launching the form. Is there a way to disable this irritating feature? BTW, I use 10.2B version.

Thanks

All Replies

Posted by Matt Baker on 11-Jul-2011 10:53

A (very) brief explanation of how Eclipse does builds:

Eclipse keeps track of all the resources that are changed whether or not the auto build option is on or off.  Resources generally being files and directories.  Each time one is changed eclipse keeps a note.  A process (wizard or similar) can change a batch of files all at once if it needs to.  Once a resource changes eclipse runs the builder automatically if it is turned on.  Each builder for the project receives a list of the changes and decides how to build them.  In the case of OEA, it generates r-code.  All projects that have changes are compiled.  If the builder isn't turned on Eclipse still tracks which ones changed, and then when the project is built passes the list of changes to each builder.


The important thing to note here is that if a build is cancelled, then the entire list of changed resources is reset and passed to the builder the next time the builder gets run.  This means that to avoid building other projects you need to let the builder complete one full cycle on each project.  After that it will only build the list of changed resources, and not the whole thing which is a lot faster since the builder has less work to do.

The other thing of note here is that the OEA builder (by default) gives up building a project after 100 failed compiles and reports a failed build to Eclipse.  You can change in this in the preferences (set it to 0 or a really big number).  Then it won't give up and it will report to Eclipse it completedly successfully no matter how many programs failed to compile.  The assumption here is that you missed a database connection or propath entry and that if 100 things fail to compile, then everything is highly likely to fail as well so we don't want to waste your time waiting for a build that is not going to work anyway.

Another preference of  note here is the behavior of how Eclipse starts run configs.  There is an entire set of preferences for various things that get done before launching the AVM.  One of these is the "build before launching" option.  You can turn this off and you can run your programs without waiting for the build (the build can still run) it just won't delay the startup of the run config.

So there are several things you can do:

1.  Change the error failure count to something really big so it always completes

2.  Let the build complete one full cycle on all your projects whether they build succesfully or not

3.  Turn off auto building and just control it manually using right-click->openedge->compile from the resources tree view  (you can hot key this if you want).

4.  Run source code instead r-code.  This means a huge performance hit, but for some scenarios this isn't a problem.

5.  Disable the builder on the unrelated project if it isn't important (project->preference->builders).

6.  Turn off the "build before launch" option in the preferences (window->preferences->run/debug->launching->Build (if required) before launching (and probably wait for ongoing build to finish option as well)

7.  Wait for V11 where you can setup a working set and and use that to do builds instead of letting the builder work on everything

fixed note about hot key on wrong line

Posted by Thomas Mercer-Hursh on 11-Jul-2011 11:14

Can't one also just close that project?

Posted by Matt Baker on 11-Jul-2011 11:42

That would just be way too simple

Posted by Peter Judge on 11-Jul-2011 12:21

3. Turn off auto building and just control it manually using right-

click->openedge->compile from the resources tree view

An alternative to this is Project -> Clean , which basically lets you select the projects to build. It can also build the whole workspace if you want it to.

-- peter

Posted by Matt Baker on 11-Jul-2011 12:43

Doing it this way adds to the time because it wipes out all the r-code and error markers before compiling anything.  Doing a forced compile from the context menu leaves the r-code unless it needs to rebuild it based on timestamps.

Posted by ruan007 on 12-Jul-2011 07:10

Hi Matthew,

Thank you for the tips, I turned off the "build before launch" option and OEA could launch my main form. All other methods(except 1 & 7) don't seem to work, if I leave the "build before launch" option on, as soon as I hit the launch button (the round green button with the little white triangle inside on the OEA toolbar) , everything in every project gets compiled. The "clean" option and disabling the builder have no effect at all, that's why I found it so frustrating.

Cheers

Posted by Thomas Mercer-Hursh on 12-Jul-2011 11:06

If there are no dependencies, it is really very easy to close and open projects as needed.

This thread is closed