Bug 430586 - Unable to copy Path Variables from one project to another
Summary: Unable to copy Path Variables from one project to another
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 8.3.0   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-18 05:34 EDT by Anitha Y CLA
Modified: 2020-09-04 15:23 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anitha Y CLA 2014-03-18 05:34:30 EDT
I have a few projects in older format which I am now trying to migrate to the newer format. As part of this migration I need to also move the project files. In some of the projects, the files are actually linked resources which make use of the Path variables. So to resolve the links to the files I need to migrate the Path Variables also to the new project. However this is not happening. Below is code which I used to migrate the Path Variables. 

project is the object of IProject.

IProjectDescription newDesc = project.getDescription();
((ProjectDescription) newDesc).setVariableDescriptions(oldDesc.getVariables());
project.setDescription(newDesc, null);


I also tried the following:
IProjectDescription newDesc = project.getDescription();
HashMap<String, VariableDescription> variables = oldDesc.getVariables();
for (String varName : variables.keySet()){
((ProjectDescription) newDesc).setVariableDescription(varName, variables.get(varName));
}
project.setDescription(newDesc, null);

In both the cases, the Path Variables is not reflecting in the new project. Is this a bug or am I doing something differently?

Thanks.
Comment 1 Nathan Ridge CLA 2014-08-25 02:26:30 EDT
I don't think cdt-source-nav is the right component for this bug. Source navigation has to do with features like Open Declaration, Find References, Type Hierarchy, etc.

I would suggest cdt-core or cdt-build instead.