[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [cdt-dev] get artifact name and getProjet return null
|
> The main problem is however question 1, I will describe the plug-in some
> more and maybe someone can give me some hints.
>
> This part of the plug-in will run the program several times with different
> environments variables and report back execution time and output data from
> the program. Today I am using a hard coded shell script that is started from
> within eclipse and then parse the result and report it nicely.
>
> The problem is that this is far from a general solution since I need a new
> shell script for each project, I would like to either create a dynamic shell
> script depending on the artifact name and the program arguments or start the
> program directly from within eclipse. The nice thing with a shell script is
> that I can very easily add the timing command and set different environment
> variables, this solution will be specific for the operating system (Kubuntu,
> 7.04), but that is not a problem for now.
>
> I can however not find any functions in the API that will return artifact
> name and/or program arguments, any hints where I can find this information?
Not sure if you already have a reference to the launch configuration,
or if you are creating your own launch config, if not you could cycle
to all existing launch configurations using
DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations()
then look for one defined for the active project using
ILaunchConfiguration config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null);
once found you can use the same getAttribute() method to retreive some
other info like command line parameters:
config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String)null);
See ICDTLaunchConfigurationConstants for other attributes.
-- Wieant