Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » proper location for user-defined .launch files?
proper location for user-defined .launch files? [message #237385] Fri, 30 April 2004 13:51 Go to next message
Eclipse UserFriend
Originally posted by: progers.classwide.com

Using Eclipse 2.1.1, build 200306271545

Where should my .launch file reside such that Eclipse will know about
it? For testing I cheated and copied my launch file down into
runtime-workspace\.metadata\.plugins\org.eclipse.debug.core\ .launches.
Should I specify something explicitly in my plugin.xml file?
Re: proper location for user-defined .launch files? [message #237404 is a reply to message #237385] Fri, 30 April 2004 14:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

When you create a launch using the UI you have a choice of local or
shared. When in local it puts it under the covers into the directory you
noted below. This is for per-workspace launches.

There is also shared, in that case the launch file is found in a
project, any project. In that case they can be shared when the project
is checked into CVS or exported somewhere else.

Typically you don't explicitly put them in the local area. That is done
automatically when you use the API to get a workingcopy of a launch and
then save the working copy. If the working copy was local, it will put
it in the .metadata itself. It is not a published API that the metadata
location is where they will be, so you rely on that for locals. You can
rely on them being found if they are shared by being in a project.

Pat Rogers wrote:

> Using Eclipse 2.1.1, build 200306271545
>
> Where should my .launch file reside such that Eclipse will know about
> it? For testing I cheated and copied my launch file down into
> runtime-workspace\.metadata\.plugins\org.eclipse.debug.core\ .launches.
> Should I specify something explicitly in my plugin.xml file?
>
>

--
Thanks, Rich Kulp

Re: proper location for user-defined .launch files? [message #237410 is a reply to message #237404] Fri, 30 April 2004 14:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

meant to say "you can't rely on that for locals"

Rich Kulp wrote:

> then save the working copy. If the working copy was local, it will put
> it in the .metadata itself. It is not a published API that the metadata
> location is where they will be, so you rely on that for locals. You can
> rely on them being found if they are shared by being in a project.
>

--
Thanks, Rich Kulp

Re: proper location for user-defined .launch files? [message #237444 is a reply to message #237404] Fri, 30 April 2004 15:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: progers.classwide.com

Thanks for the reply!

Rich Kulp wrote:
> When you create a launch using the UI you have a choice of local or
> shared. When in local it puts it under the covers into the directory
> you noted below. This is for per-workspace launches.

I use the API to find the launch file, but I didn't use the UI to
create the launch file itself. I made the .launch file manually.

Unless I place it manually in the
runtime-workspace\.metadata\.plugins\org.eclipse.debug.core\ .launches
directory it is not found when I use the API to search for it among
the known configurations.

I also have a copy in my plug-in's directory but that doesn't
suffice -- do you mean that it should work?

Thanks,

Pat Rogers
Re: proper location for user-defined .launch files? [message #237461 is a reply to message #237444] Fri, 30 April 2004 16:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

No not in a plugin, in a project in the workspace. It doesn't look in
plugins for launches.


--
Thanks, Rich Kulp

Re: proper location for user-defined .launch files? [message #237471 is a reply to message #237461] Fri, 30 April 2004 16:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: progers.classwide.com

Rich Kulp wrote:
> No not in a plugin, in a project in the workspace. It doesn't look
in
> plugins for launches.

OK, what about the case in which someone now wants to install my
plug-in. They wouldn't have a project for it (it's already
developed), they just want to use it. How will Eclipse find the
..launch file?
Re: proper location for user-defined .launch files? [message #237489 is a reply to message #237385] Fri, 30 April 2004 16:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: smesh.openrules.com

Set 'shared' and choose the location in the 'common' tab for the launch
configuration.

--
Sam Mesh - http://openrules.com
Re: proper location for user-defined .launch files? [message #237495 is a reply to message #237489] Fri, 30 April 2004 17:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: progers.classwide.com

Sam Mesh wrote:
> Set 'shared' and choose the location in the 'common' tab for the
> launch configuration.

I don't understand. I didn't use the UI to create the .launch file.
I wrote it manually.

Let me restate things: I have a plug-in that I want other people to be
able to install, but when my plug-in tries to find the configuration
(using the API) it cannot do so, unless I manually copy the .launch
file to
C:\wpidetar1\workspace\.metadata\.plugins\org.eclipse.debug. core
Clearly I don't want to tell people to do that, so what do I do?

Thanks for the help!
Re: proper location for user-defined .launch files? [message #237507 is a reply to message #237471] Fri, 30 April 2004 17:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: smesh.openrules.com

Pat,

Please describe the lifecycle of your launch configuration more in
details. (Or goto the irc://freenode/#eclipse :)

--
Sam Mesh - http://openrules.com
Re: proper location for user-defined .launch files? [message #237520 is a reply to message #237507] Fri, 30 April 2004 17:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: progers.classwide.com

> Please describe the lifecycle of your launch configuration more in
> details. (Or goto the irc://freenode/#eclipse :)

I've been discussing two scenarios, which has caused some confusion.
One scenario is within my own Eclipse installation when testing my
plug-in (using Run->Run As... Run-time workbench). The other scenario
is when some completely separate user wants to install my plug-in on
their machine, completely independent of me and my installation.

But I suspect they are really related, in that I don't know how to
tell Eclipse where my .launch file is located. The only approach that
has worked so far is to manually copy my .launch file to a predefined
directory that the run-time is aware of, but is not one of my own
directories. Because it is not one of my directories I think this is
just a temporary hack.

So, the details: my plug-in defines an action set which adds a toolbar
entry and menu entry, either of which invoke an external tool. I
manually created a launch file ("foo.launch"), without using the UI.
I just wrote it with an editor. The action class uses the API to
search for this launch configuration ("foo"):

try {
ILaunchManager manager =
DebugPlugin.getDefault().getLaunchManager();
ILaunchConfiguration[] configurations =
manager.getLaunchConfigurations();
for (int k = 0; k < configurations.length; k++) {
ILaunchConfiguration configuration = configurations[k];
if (configuration.getName().equals("foo")) {
config = configurations[k];
} // if
} // loop
} catch (CoreException e) {
System.out.println("Unexpected error getting configurations:"
+ e);
} // try

The launch configuration file "foo" is not found (config is null)
unless I copy the file to a pre-existing subdir not defined by me.
For example, I have another installation of Eclipse starting at
c:\wpidetar1, used in this case to test installation of my plug-in by
some third party. Unless I copy foo.launch to

C:\wpidetar1\workspace\.metadata\.plugins\org.eclipse.debug. core

the configuration "foo" is not found.

Presumably there is some way to tell the eclipse run-time where my
foo.launch file is located, but I don't know how.

Does that help?
Re: proper location for user-defined .launch files? [message #237526 is a reply to message #237520] Fri, 30 April 2004 18:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: smesh.openrules.com

I guess, this can help
news://news.eclipse.org:119/c6ji1r$onn$1@eclipse.org

--
Sam Mesh - http://openrules.com
Re: proper location for user-defined .launch files? [message #237574 is a reply to message #237526] Sat, 01 May 2004 01:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: progers.classwide.com

Sam Mesh wrote:
> I guess, this can help
> news://news.eclipse.org:119/c6ji1r$onn$1@eclipse.org

For some reason my reader cannot open that. Says the server cannot be
found.
Re: proper location for user-defined .launch files? [message #237595 is a reply to message #237574] Sat, 01 May 2004 12:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: smesh.openrules.com

Sorry,
http://www.eclipse.org/newsportal/article.php?id=19314&g roup=eclipse.platform

--
Sam Mesh - http://openrules.com
Re: proper location for user-defined .launch files? [message #237611 is a reply to message #237595] Sat, 01 May 2004 14:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: progers.classwide.com

Sam Mesh wrote:
> Sorry,
>
http://www.eclipse.org/newsportal/article.php?id=19314&g roup=eclipse.platform

Better, but now I am asked for a user name and password.
Re: proper location for user-defined .launch files? [message #237630 is a reply to message #237611] Sat, 01 May 2004 17:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: smesh.openrules.com

Below is modified code snippet from "Launching Java Applications
Programmatically", please read it carefully. :)
http://www.eclipse.org/articles/Article-Java-launch/launchin g-java.html

> import org.eclipse.debug.core.*;
> import org.eclipse.debug.ui.DebugUITools;
> import
org.eclipse.ui.externaltools.internal.model.IExternalToolCon stants;
>
> public class A {
>
> ILaunchConfiguration createLC(
> String program,
> String arguments,
> String launchConfigurationName)
> throws Exception {
>
> ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
> ILaunchConfigurationType type =
> manager.getLaunchConfigurationType(
> IExternalToolConstants.ID_PROGRAM_LAUNCH_CONFIGURATION_TYPE) ;
> ILaunchConfigurationWorkingCopy workingCopy =
> type.newInstance(null, launchConfigurationName);
>
> workingCopy.setAttribute(IExternalToolConstants.ATTR_LOCATIO N,
program);
> workingCopy.setAttribute(
> IExternalToolConstants.ATTR_TOOL_ARGUMENTS,
> arguments);
>
> ILaunchConfiguration configuration = workingCopy.doSave();
> return configuration;
> }
>
> void run(String program, String arguments, String
launchConfigurationName)
> throws Exception {
> ILaunchConfiguration configuration =
> createLC(program, arguments, launchConfigurationName);
>
> DebugUITools.launch(configuration, ILaunchManager.RUN_MODE);
> }
> }

Andréa wrote:
> Other solution for that would be to get output to the Task View. So, I
> would use the Runtime.getRuntime().exec() to execute the process and get
> the result to show in Task View. Could you help me to find
information how
> to do this?

Will it be convenient to see the output as a Task?

PS, Do not hesitate to ask any questions and do not leave advises
without any reply?

--
Sam Mesh - http://openrules.com
Re: proper location for user-defined .launch files? [message #237646 is a reply to message #237630] Sat, 01 May 2004 19:14 Go to previous message
Eclipse UserFriend
Originally posted by: progers.classwide.com

Sam Mesh wrote:
> Below is modified code snippet from "Launching Java Applications
> Programmatically", please read it carefully. :)

Thanks very much, Sam, for your persistence in helping -- I appreciate
the effort!
Previous Topic:Indenting a block of text
Next Topic:[ANN] Mevenide move
Goto Forum:
  


Current Time: Wed Sep 24 03:07:03 EDT 2025

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

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

Back to the top