Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Feedback on "Multiple Tool Inputs and Outputs design"

> Well, I have a question on this multiple input/output.

>

> Does this also include the idea of switching a project type over to

> another

> type? I mean, say you configured your project as "Shared Lib (GNU) on

> Windows), but now you realize, you'd rather taken the "Static Lib..." or

> "Executable..." or vice versa, would this be possible, or do you have to

> abandon the project and create a new one, importing all of the files

> again?

 

 

What you ask for is covered in the proposal...  see below

 

___________________________________________

 

Chris Recoskie

Software Designer

IDE Frameworks Group

Texas Instruments, Toronto

 

 

New MBS Extension Points

org.eclipse.cdt.managedbuilder.core.converter

This extension point allows a tool integrator to contribute a project-type/tool-chain/tool/builder converter to MBS.  Converters can be used to upgrade to newer versions, change the project-type, or to perform conversions between different tool chains.

A Converter specifies in its extension definition:

  • The class that implements the IConvertManagedBuildDefinitions interface
  • The MBS version the converter was written for
  • The “from” tool-chain/tool id(s) – a regular _expression_
  • The “to” tool-chain/tool id(s) – a regular _expression_
  • A priority value in case MBS finds more than one match for a conversion

A converter cannot be invoked unless both the “from” and “to” tool-chain/tool definitions are installed into CDT.  Old tool-chain/tool/builder definitions, that are to be used in conversions only, are marked by the tool integrator with the convertToId attribute set to the id of the new tool-chain/tool/builder definition.

MBS invokes a converter:

  • During MBS version upgrading when the tool-chain/tool is found to require conversion.
  • When MBS loads a project file and determines that a referenced tool-chain/tool has the convertToId attribute set.  At the discretion of the converter, the user may be asked to confirm the conversion.  If the user does not confirm, the project is loaded in a read-only mode, and any changes made to the MBS information will be discarded when Eclipse exits.
  • If conversion is invoked explicitly from the UI.  When conversions are possible for a selected project, the project context menu should display a “Convert To  >” menu item with a submenu listing the possible conversion targets.

Converters use the MBS model public interfaces (IManagedProject, IConfiguration, …) to modify the project definition “in-place”, and so could be affected by MBS model changes.

This is the definition of the IConvertManagedBuildDefinitions interface.

 

public interface IConvertManagedBuildDefintions {

   public toolChainPreConvert(IToolChain toolChain, String fromId,

String toId, boolean userHasConfirmed);

   public toolConvert(ITool, String fromId, String toId,

boolean userHasConfirmed);

   public tooChainPostConvert(IToolChain, String fromId, String toId,

boolean userHasConfirmed);

}

 

The conversion process performs the following steps per tool-chain:

  1. Calls toolChainPreConvert if the tool-chain versions are different
  2. Calls toolConvert for all tools, and the builder, in the tool-chain where the versions are different
  3. Calls toolChainPostConvert if the tool-chain versions are different

 

When a tool integrator conversion is invoked while an MBS conversion is also taking place, MBS will invoke the converter with the appropriate object model based upon the MBS version that the converter was written for.  If the converter was written for the old MBS version, the converter is called with the old version of the MBS object model.  If the converter was written for the new MBS version, the converter is called with the new MBS model.

 


Back to the top