How to clone an MCUXpresso project

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to clone an MCUXpresso project

Jump to solution
5,081 Views
jeffthompson
Contributor V

I'm using MCUXpresso 11.1.0 and would like to clone one of my projects to use as the starting point for a related project, preferably in the same workspace. How con I do this?

Labels (1)
Tags (1)
0 Kudos
1 Solution
4,690 Views
converse
Senior Contributor V
0 Kudos
17 Replies
4,690 Views
jeffthompson
Contributor V

I tried that earlier but nothing happened and the context menu showed Paste as unavailable. But just now it worked. The difference was that I had the project closed before, but open now.

0 Kudos
4,690 Views
ErichStyger
Senior Contributor V

Just in case: the following article goes into the details of cloning a project: Tutorial: Rename, Copy or Clone Eclipse Projects with MCUXpresso | MCU on Eclipse 

0 Kudos
4,690 Views
jeffthompson
Contributor V

The problem I had today was that I had added a folder, with source and header files, under 'sources' in the original project When I tried to build the clone, it failed because it couldn't find a new header file that is located in the new folder. At first, I thought this was because I hadn't updated the clone project to include the new folder's path. However, after doing so (I used the 'workspace' relative path, just as the other include paths did), I still could not build for the same reason.

Interestingly, if I right click on the header filename, in the clone source file that includes it, and select 'Open Declaration', it opens the new header file. But building gives the error "no such file or directory". I've cleaned the project and deleted the contents of the output folder. Somehow, the compiler just can't find the header.

So, adding a folder and files to the original project appears to  require some other step for the cloned project to build, even though the project explorer show the new folder and files in both projects.

I'm using MCUXpresso 11.2.0.

0 Kudos
4,690 Views
converse
Senior Contributor V

I do this fairly regularly and there are no additional steps required. I'm guessing that you have a misconfiguration in your include paths. (Properties->C/C++ Build->Settings->MCU C Compiler->Includes)

0 Kudos
4,690 Views
jeffthompson
Contributor V

I believe I did update the include paths correctly, using the builtin browser, but see what you think. I'll call the original project 'Original' and the cloned project 'Clone'. In Original, the new folder is under 'source' and I'll call it 'new_folder'. The include path in Original is ../source/new_folder. In Clone, it's "${workspace_loc:/Original/source/new_folder}".

In desperation, I tried setting the Clone include path to ../source/new_folder and even "${workspace_loc:/${ProjName}/source/root_certificates}". Non of these resulted in a build.

0 Kudos
4,690 Views
converse
Senior Contributor V

You said:

The include path in Original is ../source/new_folder. In Clone, it's "${workspace_loc:/Original/source/new_folder}".

Why do you reference "Original" in Clone?

The only way I can get to the bottom of this is if you provide a failing example.

0 Kudos
4,690 Views
jeffthompson
Contributor V

The other include paths were all done the same way, and the code built before I added the new folder.

I don't see a way to upload my project file; does a new question need to be created in order to do that? In the meantime, I can create a new workspace with a new project, clone the project, build both, add a source and header file in a new folder to the original project, build it, and then try to build the clone. If that fails, I could upload the entire workspace.

0 Kudos
4,690 Views
converse
Senior Contributor V

To upload a file, switch to the advanced editor (top right, when you 'Reply') and then at the bottom is an 'Attach file' button.

0 Kudos
4,690 Views
jeffthompson
Contributor V

Okay, I'll get it there as soon as I can, later today. But what I have is not a copied and pasted project, but a new project where the files are links to the original, so that changes in the original are automatically reflected in the clone.

0 Kudos
4,690 Views
jeffthompson
Contributor V

Here are the .project files for the two projects. I f that doesn't provide enough meaningful information, I have a Dropbox account with the entire workspace in it.

I'm still trying to reproduce the issue with a minimal set of files.

0 Kudos
4,690 Views
converse
Senior Contributor V

That is not at all helpful.

Did you do what I said, and try to copy the project again? 

Sorry, I am going to bail out of any further help. It works correctly for me, and I have my own work to do.

0 Kudos
4,690 Views
jeffthompson
Contributor V

After struggling for a day trying to reproduce the problem in a new workspace, I finally gave up and decided to re-clone the project in the same workspace as the original. So, I did a copy-and-paste of the original project, deleted from the copy all but the ProjectSettings and Includes folders, and then imported from the original project all the source folders and their files as virtual folders and links. The only problem I had, which I had seen before, fortunately, is that the original project must be opened in order to build the clone.

0 Kudos
4,689 Views
danielribeiro
Contributor II

Hi, Jefferson!
Perhaps the following picture may help.Clone_Project.jpg

0 Kudos
4,690 Views
jeffthompson
Contributor V

Thanks, Daniel, I did look at that early on and the new files were not excluded from the build. Since I re-cloned the project, it has been building with no problem, so I'm thinking something related to links and virtual folders didn't work right, or somehow got corrupted.

0 Kudos
4,690 Views
jeffthompson
Contributor V

As I started down this path, I realized that my cloned project was created and then all the files from the original project were added as links. So, File Explorer shows no source or header files in the cloned project, but the Project Explorer does. Maybe this has bearing on my issue?

0 Kudos
4,690 Views
converse
Senior Contributor V

I'd suggest starting again. When I select a (open) project, Ctrl-C and Ctrl-V, I get a dialog displayed that says "Copy Project". I press the Copy button and I end up with a duplicate project with all of the files copied too. I don't know how you got into the state that you have. I am using 11.1.1 on Windows 10.

0 Kudos
4,691 Views
converse
Senior Contributor V

Ctrl-c 

Ctrl-v

0 Kudos