Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does CDT rebuild my C-project on Ant build in unrelated project?

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"...)

like image 472
thoni56 Avatar asked Dec 20 '10 13:12

thoni56


2 Answers

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.)

like image 51
thoni56 Avatar answered Oct 23 '22 00:10

thoni56


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 :)

like image 44
James Blackburn Avatar answered Oct 23 '22 00:10

James Blackburn