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

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

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

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

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

Related

How to automatically update Targets for an Ant build via Eclipse with new run configurations

We are creating some JUnit tests as part of QA development. So we are doing this daily and while running individual tests, or part of a package, they do appear under the Run arrow:
they do not appear in the Ant build Targets:
Well.. you can see that the Schedules_Load appears but that's because I have exported the Ant build again.
Note that even if I create Run configurations using the Eclipse menu:
It still doesn't update my Ant Targets list..
Under the menu item Project I do have Build automatically checked but don't think it makes any difference anyway, just thought I would mention it.
So is there any way to automatically update Ant targets with new run configurations without having to export the Ant build again?
Thanks.
try selecting the check-box: "Refresh automatically".
Window->Preferences->General->Workspace->"Refresh automatically"
(source: avajava.com)

Refreshing eclipse-project at the end of a maven build

Is there a possibility to refresh the files and folders of a project within eclipse at the end of a maven build automatically.
Usually I'm building from commandline. After a build e. g. the target folder should be refreshed.
Additional info: the maven build runs in the command line and eclipse should update automatically when it ended.
Use Run as -> Maven build... In the run configuration/build properties go to the refresh tab and select the refresh option you want.
Note that the eclipse build and the maven build may interfere, so make sure that you turn off the Build automatically option in the Project menu before staring the maven build. You may get indeterministic compilation errors otherwise.
Here is an eclipse plugin that implements the external hook for refreshing: https://github.com/andrask/maven-eclipse-control-plugin
I dont think so, there is no option to link the two things.
But eclipse has an option Refresh on access which might be useful for you.
For me, the accepted answer of using Run as -> Maven build... and the Refresh option did not refresh the target folder in Eclipse. I needed to do the following:
Preferences -> General -> Workspace -> Refresh using native hooks or polling
When enabled, any changes made by external editors will be automatically discovered by the Workbench. On some systems there may be a slight delay if polling is used.

Worklight v6 - Build Environment and Project Builders

Migrating from Worklight Studio 5.0.6 to 6.0
We observe a small, but undesirable, difference in behaviour, or maybe a confiuguration chenge is needed somewhere we failed to find.
In v5.0.6 when one selects an environment and requests Build Environment and Deploy, the project's Builders are first executed. In v6.0 this does not appear to be the case, unless there's a option somewhere ...
The use case is that we have some pre-processing carried out by an ant task installed as a project builder. In v6.0 we now need to rememeber to run a Build Project and then build the environment.
Is there an option to control this behaviour?
this is how to run ant task in worklight 5.0.x - 6.x:
create the Ant file (build.xml):
Navigate to project->properties->Builders->new->Ant Builder. press ok
in "Main" tab set the name for the builder and choose your Ant file (build.xml):
in "Targets" tab choose when to run the Ant file (in this exemple in Auto Build):
press OK
press OK
run "Build All and Deploy":
Success:
This is an open defect in Worklight 6.0.0.x and 6.1.0.x.
There is currently no workaround for it.

Eclipse "Waiting for virtual machine to exit"

I'm working on a blackberry project using eclipse and bb-ant tools. I've created a build.xml file to perform the build. Everytime I try to run an Ant build, eclipse pops up the progress dialog and it hangs stating "Waiting for virtual machine to exit."
I downloaded an open source Blackberry project that has an ant build and it is showing the same behavior.
Does anyone have any suggestions?
Edit:
I used the command line to build my xml file and it built fine. However, when I tried from Eclipse it still hangs.
I've tried both the standard eclipse plugin directory and the path I downloaded ant to.
You could check if your ANT_HOME settings are correct (see also this blog post).
"Window > Preference > Ant > Runtime": "Ant Home Entries".
if the jars files are from a plugin directory (beside the default 'org.apache.ant_1.7.1.v20090120-1145' one) and not an independent ant installation, that might explain the problem.
Try clicking the "Ant Home" button on the right side and setting up ant home such as "C:\path\to\apache-ant-1.7.0"
There are similar bugs to this kind of situation (bug 173419, ticket 91).
It is worth checking the JVM used for the project.
It can also occurs when a ant task is poorly implemented.
You had the problem because the java version ant tries to run with is incorrect.
By default, eclipse will try to run the ant build with the java version it uses to compile the java files (Blackberry JRE), which won't work! You need to change the jre version by choosing "Run As... > Ant build". Before clicking run, go to the JRE tab, choose "Separate JRE:" and change "Blackberry JRE " to a standard java JRE. Press the run button and everything should work correctly.
I hit this problem also. Although I never used the same solution, you pointed me in the same direction.
I was using a ant file as a builder in my project, and I disabled the Allocate Console build option. This is when I hit the 'Waiting for virtual machine to exit'.
So I simply enabled the Launch in background option and it worked.

Ant build consoles get clobbered by dependent projects in Eclipse

I have a set of dependent projects in Eclipse, each with its own Ant build script. If I make a change in multiple projects, then select "Build All" (Ctrl+B), each Ant build is invoked in the correct order. But if there is an error in one project, Eclipse still tries to build the other projects also, and in the process clobbers the Ant console so that the build errors are no longer visible. This wouldn't be quite so annoying if I could open up the offending project and select "Build Project", but Eclipse out-smarts me: it won't rebuild until I open some file in the project, edit it, and save (typically I add and remove a space character wherever my cursor happens to be). An answer to any of the following questions would be welcome.
How can I configure Eclipse to (in preference order):
terminate a "Build All" as soon as any project's Ant build fails?
save all console output for "Build All" instead of resetting the console for each project?
spawn a separate console for each new instance of Ant?
allow me to force a "Build Project" even if it doesn't think anything has changed?
[UPDATE] Bonus Question:
How can I configure Eclipse so that fixing any build errors in a depended-on project counts as a "change" for the purposes of "Build Project"?
Have you tried redirecting standard out to file via a run configuration? A few screen shots to help if not... (you may try 'append' this is not in my screen shot :) )
One alternative is to have each Ant build log itself, e.g., using the following in build.xml
<record name="build.log"
loglevel="verbose"
append="false" />
Oddly, Eclipse seems to disable this logging somehow when running an Ant build.
I am not too big on ant, but can't you make the builds dependent on one another?