Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Prevent builds between multiple changes to workspace
Prevent builds between multiple changes to workspace [message #1444540] Tue, 14 October 2014 07:59 Go to next message
Alexander R is currently offline Alexander RFriend
Messages: 211
Registered: July 2013
Senior Member
Hello,

I try to do the following:

1. I want to create some projects in a runtimeworkspace programmatically

2. Than copy some files to the /bin/.. directory of the created project.

But after (1) the eclipse autobuild starts to run and (2) never take effects.

So I google around and fount the following information:

http://wiki.eclipse.org/FAQ_What_are_IWorkspaceRunnable,_IRunnableWithProgress,_and_WorkspaceModifyOperation%3F

http://wiki.eclipse.org/FAQ_How_do_I_prevent_builds_between_multiple_changes_to_the_workspace%3F

After reading this I decided to try a WorkspaceModifyOperation:

WorkspaceModifyOperation operation = new WorkspaceModifyOperation() {
@Override
public void execute(IProgressMonitor monitor) {
try {
monitor.beginTask("Derive Products", IProgressMonitor.UNKNOWN);
monitor.worked(1);
 if(!createProject())
 monitor.done();
return;
copyFilesToBinFolderOfNewProject();
}
finally {
// close the monitor
monitor.done();
				}
};

PlatformUI.getWorkbench().getProgressService().run(false, false, operation );


But the auto-build mechanism interrupt my copy operation somehow. I tried the same logic wrapped in a IWorkspaceRunnable but it didn't change anything.

What am I doing wrong?

PS: When I'm using a WorkspaceJob I am getting some invalid thread access exceptions, because I am using an Inputdialog like this:

InputDialog dlg = new InputDialog(Display.getCurrent().getActiveShell(), "Project name",
				"Please enter the name of the new project!", newProjectNameProposal, null);


What am I doing wrong?

~Alex
Re: Prevent builds between multiple changes to workspace [message #1444613 is a reply to message #1444540] Tue, 14 October 2014 10:07 Go to previous message
Alexander R is currently offline Alexander RFriend
Messages: 211
Registered: July 2013
Senior Member
Hi,

I found the problem. Never copy resources in a /bin directory!
The next auto-build (javabuilder, acceleo, whatever...) will delete all /bin.. direcotries and create new ones...

D'OH!

~Alex
Previous Topic:how to find the main class in existing plugin project?
Next Topic:Default theme looks bad on Windows 8
Goto Forum:
  


Current Time: Thu Jan 23 11:45:24 GMT 2025

Powered by FUDForum. Page generated in 0.02458 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top