Page 1 of 1

how to copy and entire project

Posted: Thu Jun 16, 2022 4:51 am
by zaphod

I have a project with around 300+ source files. I want to duplicate the entire project prior to editing it before making it open source. Is there a nice easy way of making a project copy ?

I can do it the hard way: copy the actual source files into new directories then load them into the new projects virtual folders. But then there all the project settings to be copied -- that gets to be a drag :roll:

Suggestions please...


Re: how to copy and entire project

Posted: Thu Jun 16, 2022 2:30 pm
by DavidGH

Hi,

There's not (afaik) a 'Duplicate Project' command, but it needn't be hard to do by hand. Suppose I have a workspace called FooWsp containing a project RealPrj.
1) Duplicate the actual files: use your file manager/terminal to duplicate/rename the containing directory.
2) Then do one of the following alternatives:

  • a) Similarly, duplicate the workspace's project directory e.g. /path/to/FooWsp/RealPrj/ and call it DupPrj. It should contain a file that's currently called RealPrj.project. Rename it. Open it in a text editor and make the obvious alteration to the line:
    <CodeLite_Project Name="RealPrj" ....>
    There will also be lines similar to:
    <VirtualDirectory Name="foo">
    <File Name="path/to/file1.cpp"/>
    Make any necessary alterations.
    Then, in CodeLite with the original workspace open, Workspace > Add existing project.
    In the Workspace View right-click over DupPrj and select Reconcile Project to check that the files/folders are all present and correct.

  • b) Use Workspace > New project to create DupPrj.
    Add the files/folders: In the Workspace View right-click over DupPrj and select either 'Import files from directory' or, for more complicated projects, Reconcile Project.

Regards,

David


Re: how to copy and entire project

Posted: Mon Jun 20, 2022 10:06 pm
by zaphod

Well, I "think" I went through the appropriate steps you suggested. However, when I try and build the copied project Codelite crashes. I tried the 'reconcile' option but it seemed to simply want me to assign files that are already part of the project. I had hoped it would simply 'reconcile' the project in some way...

Rather obviously, messing with XML configuration file can really mess with things... :cry:

Back to doing things the hard way. Copying and then importing files is easy. I just wish there were more facilities for duplicating compiler and linker settings between projects.


Re: how to copy and entire project

Posted: Mon Jun 20, 2022 10:17 pm
by zaphod

What does "save as template" do ? Might this help me ?


Re: how to copy and entire project

Posted: Tue Jun 21, 2022 12:42 am
by zaphod

I hacked around and I have solved my problem. Thanks for your suggestion.