Eclipse: how to avoid blocking user input of frequent saves with build on save enabled? - eclipse

I have activated an option "Build on resource save". My typing habits is to save the code every few seconds and whenever previous build is not complete before I save again, I get a window like this:
Basically Eclipse is forcing me to wait before it will finish the previous build and start a new one. Can I somehow configure it, so that it will start new build automatically once the previous is completed and will not block my input? It is okay if it will incorporate multiple consequent saves of the code.

Essentially, my solution was not to build on save. As scottb mentioned in comments it is too complicated to actually decide when it is save to build and when it is not.

Related

Simulink Real-Time Desktop model: why does it rebuild on every run?

I have a Simulink Real-Time Desktop model that launches from a GUIDE application in External mode. My problem is how to run the model without Matlab rebuilding it every single time.
In the _OpeningFcn I included a 'rtwrebuild' command with the expectation that this would rebuild the code only if the model had been changed since the last run. However, when I start the real-time simulation using set_param(MODEL, 'SimulationCommand', 'start', ...), it invariably rebuilds the code regardless of what 'rtwrebuild' did. How can I keep the start command from causing all these unnecessary builds?
Since I don't have reputation enough for posting a comment request for clarification, I'll ask it here; did you check the rebuild option setting in the configuration set?
From my own experience it take a long time even if set to only rebuild if changes detected because it still opens every single file in the model tree to check that nothing was changed. Also I think some parameter changes counts as cause for rebuild. If you don't want that you need to set "Never" rebuild and control this yourself.

How can I get a notification when build workspace is finished?

How can I write a plugin or program routine that gets notified when "build workspace" finishes in Eclipse?
Is IProgressMonitor useful for this? If so, how do I get ahold of it?
You can wait for the automatic build to finish using:
Platform.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
This will block until the builds have finished (and do nothing if the build is not running).
You would probably also want to wait on the manual builds are well:
Platform.getJobManager().join(ResourcesPlugin.FAMILY_MANUAL_BUILD, null);
If you really want to receive a notification (rather than blocking), try this:
IWorkspace.addResourceChangeListener(myListener, IResourceChangeEvent.POST_BUILD);
The Javadoc of IResourceChangeEvent gives more details on usage and on information found in the event instance.

Eclipse Run History

Does eclipse remember when a program was executed last time? I know there is run configurations, but that doesn't keep track of past executions and their order of execution.
When a program is executed at the shell, then shell keeps tracks of the order of their executions? I want similar utility in eclipse along with the time of execution.
You can see in the debug view or in the console view (click the arrow near screen icon) the program that have run and the start time.
Edit : In Preferences/(Run/Debug)/Launching uncheck the "Remove termined launches when a new launch is created".
This list is reset if you clear hit or if you close Eclipse.
If you want a more permanent information, I think your programs should log that info in files.
you can execute your previous most recent program with ctrl+f11. For detail you can go to run->run history.
If you need the time when your program was executed, make your program output the time by itself. There is nothing in Eclipse that can do exactly what you need.

Can eclipse notify me when a task has finished running?

I am often stuck twiddling my thumbs for a couple minutes while eclipse cleans, builds, or loads my projects. It would be nice if eclipse could notify me with a beep when the last task in the Progress view has finished running, so I can stop reading the internet and get back to work. Is there a setting or plugin that does this?
Edit: I tried adapting the plugin template that nonty provided below, which adds a listener to the JobManager. I tried implementing done() to beep only when the job change event's name contains "Building workspace," as that is the task that usually takes the longest in my setup. Exasperatingly, the task that builds the workspace never sends a done() call, just scheduled() and aboutToRun() calls. Any other ideas?
There are no preference for this - yet.
The JobManager have the needed API to support this functionality...
EDIT: I have constructed and attached a very simple plug-in that will beep for every job that terminates. That turns out to be rather often :-) . You can modify it to filter out all the false positives, e.g. by getPriority() and getName(). Also you can make the listener play a tune, popup a message (don't!) or whatever...
See jobnotifier.zip.
UPDATED the link above again

Disable building workspace process in Eclipse

What is Eclipse doing when building workspace process is running? Can i disable it because it is taking a long time to complete and i dont know if it is necessary. Thank you
Building workspace is about incremental build of any evolution detected in one of the opened projects in the currently used workspace.
You can also disable it through the menu "Project / Build automatically".
But I would recommend first to check:
if a Project Clean all / Build result in the same kind of long wait (after disabling this option)
if you have (this time with building automatically activated) some validation options you could disable to see if they have an influence on the global compilation time (Preferences / Validations, or Preferences / XML / ... if you have WTP installed)
if a fresh eclipse installation referencing the same workspace (see this eclipse.ini for more) results in the same issue (with building automatically activated)
Note that bug 329657 (open in 2011, in progress in 2014) is about interrupting a (too lengthy) build, instead of cancelling it:
There is an important difference between build interrupt and cancel.
When a build is cancelled, it typically handles this by discarding incremental build state and letting the next build be a full rebuild. This can be quite expensive in some projects.
As a user I think I would rather wait for the 5 second incremental build to finish rather than cancel and result in a 30 second rebuild afterwards.
The idea with interrupt is that a builder could more efficiently handle interrupt by saving its intermediate state and resuming on the next invocation.
In practice this is hard to implement so the most common boundary is when we check for interrupt before/after calling each builder in the chain.
You can switch to manual build so can control when this is done. Just make sure that Project > Build Automatically from the main menu is unchecked.
if needed programmatic from a PDE or JDT code:
public static void setWorkspaceAutoBuild(boolean flag) throws CoreException
{
IWorkspace workspace = ResourcesPlugin.getWorkspace();
final IWorkspaceDescription description = workspace.getDescription();
description.setAutoBuilding(flag);
workspace.setDescription(description);
}
For anyone running into a problem where build automatically is unchecked but the project is still building. Make sure your project isn't deployed to the server in the server tab and told to stay synchronous.