5

I have an Eclipse workspace where a CDT project lives together with other unrelated projects. However, when I run "build as Ant build" in one of those projects, CDT insists on rebuilding its projects too.

Anyone have any ideas where to look to disconnect this "hidden" dependency? (And no, it's not in the "Linked Resources" or the "Project References"...)

thoni56
  • 3,145
  • 3
  • 31
  • 49
  • (Sorry if my question is trivial, I'm more familiar with CDT and less with Ant) How do you run "build as Ant build"? All I could found was "run as Ant build" when right-clicking the Ant buildfile. – Itamar Katz Dec 22 '10 at 08:03
  • Sorry, my mistake. That's what I meant. Since it's not important to the question I didn't check, sorry for that. – thoni56 Dec 22 '10 at 08:44

3 Answers3

3

The workspace wide build was actually caused by me failing to find the option for the build in "External Tools Configurations". There you can specify to build the whole workspace, the containing project, or some specific resource.

There is also an Eclipse bug for setting the default to something different than to build the whole workspace. (One could think that "Run as Ant build" would default to not build anything except running the specified Ant target.)

thoni56
  • 3,145
  • 3
  • 31
  • 49
2

Project builders are run at the request of some build trigger. This might be resource changes (when you have build automatically enabled) or it could be the build action you're using: "build as Ant build". The build action may be inadvertently requesting a build of the whole workspace.

Put the following in a text file:

# Eclipse build
org.eclipse.core.resources/debug=true
org.eclipse.core.resources/build/interrupt=true
org.eclipse.core.resources/build/invoking=true
org.eclipse.core.resources/build/needbuild=true
#Managedbuild
org.eclipse.cdt.managedbuilder.core/debug/builder=true
org.eclipse.cdt.managedbuilder.core/debug=true
org.eclipse.cdt.managedbuilder.core/debug/pathEntryInit=false
org.eclipse.cdt.managedbuilder.core/debug/pathEntry=false

And run Eclipse with the additional switches:

-debug <trace_options>.file

This will echo trace prints to the shell in which you started Eclipse. You can use this to better target the bug report you'll no doubt file :)

James Blackburn
  • 4,492
  • 2
  • 27
  • 24
  • Ok, so this did not work unless I put the options file in .../Eclipse.app/Contents/MacOS (being in MacOSX). But then the trace out contained the following for each of my projects: – thoni56 Dec 22 '10 at 09:16
  • But then the trace out contained something like the following for each of my projects: "Invoking (FULL_BUILD) on builder: CommonBuilder(AlanIDE)" – thoni56 Dec 22 '10 at 09:48
0

Try to uncheck the Build Automatically checkbox, under Project menu.

Itamar Katz
  • 9,544
  • 5
  • 42
  • 74
  • Do you mean for the CDT-project(s)? Even if that would work, it doesn't seem like the correct solution. Because if I want my CDT projects to build automatically on resource save, I need to flick this on and off as I switch project. – thoni56 Dec 21 '10 at 23:55
  • You are probably right. Since that checkbox seems to be 'global' (associated with all projects), then I didn't think it would be possible to control the auto-build individually for each project. (My answer was probably influenced by my habits...) – Itamar Katz Dec 22 '10 at 07:30