Bug 22223 - Need to be able to run Ant builds in the current thread
Summary: Need to be able to run Ant builds in the current thread
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Ant-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: core
Depends on:
Blocks:
 
Reported: 2002-08-06 17:32 EDT by Jim Amsden CLA
Modified: 2002-11-18 10:23 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Amsden CLA 2002-08-06 17:32:05 EDT
Rational's XDE Modeling Server does not support multi-threading. An Ant task 
that access the modeling server crashes Eclipse on the second running (when 
attempting to use the modeling server in a second thread). This introduces the 
need to be able to specify an Ant argument that executes the build script in 
the current thread, similar to:

    new ProgressMonitorDialog(shell).run(false, true, op);

where op is a WorkspaceModifyOperation that access the XDE model server.
Comment 1 Darin Wright CLA 2002-11-15 12:26:32 EST
I need more information here. What is the "current" thread? How would Eclipse 
know if this is the proper thread? Or do you just need programmatic access?

External tools/Ant has evolved to using launch configurations. A launch 
configuration has API to launch (see ILaunchConfiguration), and this can be 
called programmatically from any thread. Is this sufficient?
Comment 2 Jim Amsden CLA 2002-11-15 12:40:24 EST
As I remember, Ant tasks, like all runable external processes, are run in a 
separate thread with their output going to the console window. This lets the 
task run while keeping the UI updating.

Running internal operations can be done in either the same thread, or a 
different thread as specified by the ProgressMonitorDialog.run method.

We need a similar mechanism for external tools. Most of the time they can run 
in a separate thread. But sometimes it is necessary to run them in the same 
thread as the Eclipse UI. For example, anything that accesses the XDE modeling 
server API. Ant tasks are just Java methods, so they can be run either way.
Comment 3 Darin Wright CLA 2002-11-18 10:23:55 EST
Since we are using launch configs - you can invoke/launch a script in any 
thread you want. The API is simply ILaunchConfiguration#launch(String mode, 
IProgressMonitor monitor). You can call this API from which ever thread you 
like.