This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to have IDE show projects from different folders within the workspace

Guru 20045 points

Hello,

I am using CCS5.3.

I would like the IDE to show projects from different folders within the workspace.  To do so, I tried to import a project from a folder within the workspace, but that causes the project to get copied to the workpaces root directory.

My end objective is to have a workspace directory structure as shown below.  Is it possible to do that within the IDE?

Thanks,
Stephen

-Workspace Folder

      -Source Folder (contains source projects)

      -Unit Test Folder (contains multiple unit test projects)

 

  • Hi Stephen, 

    Eclipse projects are layout in flat in the workspace folder. However, you can store the projects outside of the Eclipse workspace anywhere on your hard disk in the folder structure that you have. Now, when you import the projects, make sure you deselect the copy option in the import wizard and leave the project files in the original location. You can create two working sets from the project view (test and source) and place the projects in the corresponding working set. Note that you can create the working set and place the projects in the working set during import.

    Patrick

  • Fantastic! That works.

    Thanks,

    Stephen

  • Hello,

    How do I create two working sets in the project view?

    Stephen

  • Hello Patrick,

    I get  *** No rule to make target  build errors when I try to build the unit test project in its new location: gmake.  The error is a result of the compiler referencing the Unit test folder when it looking for linked. 

    My directory structure was previously as follows:

    Working Folder

        Source Folder

        Unit Test 1 Folder

        Unit Test 2 Folder

        ....

    and then I change the stucture to:

    Working Folder

        Source Folder

        Unit Tests Folder

               Unit Test 1 Folder

               Unit Test 2 Folder

              ....

    Each unit test project was referencing (i.e. add link to file) files in the Source Folder.  The Compiler is now trying to look for the linked file in the Working Folder/Unit Tests Folder/Source Folder/.. Directory.

    The properties of the linked file shows that it located in the Working Folder/Source Folder, so why is the compiler is looking in the Unit Tests/Source Folder/.. Directory.

    Stephen

      

  • Hi Steven,

    Stephen,

    stevenh said:

    How do I create two working sets in the project view?

    I assumed that you have one working set created and have the view set to show the working set. To create a new working set, click on the little triangle in the view and select "Select Working set..." from the menu. There should be a "New..." button in the dialog for creating new working set.

    Regards,
    Patrick 

  • stevenh said:

    I get  *** No rule to make target  build errors when I try to build the unit test project in its new location: gmake.  The error is a result of the compiler referencing the Unit test folder when it looking for linked. 

    Without the project on hand, I am guessing that you need to update the project file references due to shuffling the projects to a different layout.

    Regards,
    Patrick 

  • Ok, so I'm guess there's no way to show two working sets at once.  Is that correct?

  • stevenh said:

    Ok, so I'm guess there's no way to show two working sets at once.  Is that correct?


    Yes, it is possible. Make sure you select the "Top Level Elements | Working Sets" in the view local menu (little triangle).
    And then goto "Select Working Set..." from the view local menu and check all the working sets that you want to see in the view.

    Here is what I have.


    Patrick
  • That's great.

    Currently, I have almost all of my unit test folders in the same working set as the Source folder.  Also, the unit test projects are referencing files in the source project.

    Moving projects to a dfferent working set will require me to relink all the linked files, which is a considerable effort.  Is there an easy way to do it, i.e find and replace something in the project files?

    Stephen 

  • Also,  I'll need to update the include files location, which contain a macros named  workspace_loc.  Where is that macro defined?  Since I'll have two workspaces, how do I refer to one of the workspaces?

    Stephen

  • stevenh said:

    That's great.

    Currently, I have almost all of my unit test folders in the same working set as the Source folder.  Also, the unit test projects are referencing files in the source project.

    Moving projects to a dfferent working set will require me to relink all the linked files, which is a considerable effort.  Is there an easy way to do it, i.e find and replace something in the project files?

    Stephen 


    You can just leave your projects in the current folder structure, and create the working sets. Working set is just a presentation grouping in eclipse, you don't need to move your project around in your hard disk.
    I don't know what is the best way to find and replace project files, perhaps some one else can help. Probably post a new thread will get better respond.
    Patrick
  • stevenh said:

    Also,  I'll need to update the include files location, which contain a macros named  workspace_loc.  Where is that macro defined?  Since I'll have two workspaces, how do I refer to one of the workspaces?

    Stephen


    workspace_loc is an internal eclipse variable, the current workspace that you use. You can define new variable and see existing variables in the preferences dialog. In the preferences dialog, look under "C/C++ | Build | Build Variables".

    Patrick
  • Patrick Chuong said:

    You can just leave your projects in the current folder structure, and create the working sets. Working set is just a presentation grouping in eclipse, you don't need to move your project around in your hard disk.  I don't know what is the best way to find and replace project files, perhaps some one else can help. Probably post a new thread will get better respond.


    I will need to rearrange my directory structure.  I start a new thread.

    Thanks,
    Stephen

  • Patrick Chuong said:

    workspace_loc is an internal eclipse variable, the current workspace that you use. You can define new variable and see existing variables in the preferences dialog. In the preferences dialog, look under "C/C++ | Build | Build Variables".

    Patrick
     
    Ok.  Thanks.
  • Patrick Chuong said:

    Ok, so I'm guess there's no way to show two working sets at once.  Is that correct?


    Yes, it is possible. Make sure you select the "Top Level Elements | Working Sets" in the view local menu (little triangle).
    And then goto "Select Working Set..." from the view local menu and check all the working sets that you want to see in the view.

    Here is what I have.


    Patrick

    [/quote]

     

    I wasn't successful in setting up two workspaces that I can see in the project explorer.  Are src and test workspaces?

     

    I created the directory structure shown below  and then switched workspaces to the Source Folder. I imported the Source project into that workspace.  I repeated the process with a different workspace for the Unit Test folder.

    What am I doing wrong.

    Thanks,
    Stephen

     

    Project Name Folder

          Source Folder

          Unit Test Folder

  • You can only have one active workspace for each running instance of CCS.

    Here is my setup.

    Projects are located here:

    D:/mywork/src/abc
    D:/mywork/test/test_abc

    CCS is in C:/ti/CCS and workspace is in C:/ti/CCS/workspace

    The top two nodes that you see in the project explorer are working sets, one contains the abc project and the other contains the test_abc project.


  • Patrick Chuong said:

    You can only have one active workspace for each running instance of CCS.

    Here is my setup.

    Projects are located here:

    D:/mywork/src/abc
    D:/mywork/test/test_abc

    CCS is in C:/ti/CCS and workspace is in C:/ti/CCS/workspace

    The top two nodes that you see in the project explorer are working sets, one contains the abc project and the other contains the test_abc project.

    working sets??  Ok, that solves the mystery and I just found it in the project explorer drop down box, as opposed to what described in the CCS5.3 help.

    Stephen