Importing list of source files into an Eclipse project

前端 未结 4 999
终归单人心
终归单人心 2021-02-06 13:06

We have a topdirectory containing code for lots of different projects. I would like to create an Eclipse CDT-project that contains only the source needed to work on and compile

相关标签:
4条回答
  • Traditionally, Eclipse assumes that the .project file is at the top-level directory of your project's sources and all the source code below it is included in the project. However, I think that you should be able to use linked folders so that you have a Eclipse project directory which is basically empty but for a .project file and a linked folder which points to your source tree. I do not think however that you can explicitly list the files to include in the project.

    EDIT: if you do find a solution to this, please let me know.

    0 讨论(0)
  • 2021-02-06 13:38

    In Eclipse, you can selectively import certain directories to be included in the project.

    You can create an eclipse project somewhere else in your drive, and then create links only to the folders that you want in your original location (these are called "linked resources" in Eclipse)

    You can also use the linked resource strategy for an entire project (I mean an Eclipse project, not your top-level project). For example, if your folder hierarchy is as follows:

    /top-level
    /top-level/projectA
    /top-level/projectA/subProjectA
    /top-level/projectB
    

    You can create an eclipse workspace at location /my-workspace, create a project called subProjectA and have it linked to /top-level/projectA/subProjectA. You can do the same for projectB and they will appear in your Eclipse workspace as if they are side-by-side in a flat hierarchy.

    0 讨论(0)
  • 2021-02-06 13:54

    So far as I know, you can not do that. What you can do is import these source files into another project, which means these file will be copied to that created project.

    0 讨论(0)
  • 2021-02-06 13:58

    In Eclipse Helios (3.6)

    In eclipse project, righ-mouse-click "New ..." > "Folder".

    A dialog box appears.

    Click "Advanced" button...

    Click "Link to alternate Location" radio button.

    Click "Browse"

    Select the folder you want to link to.

    For a refinement , see "Help" > "Help Contents" (a new window appears)

    "Workbench User Guide" > "What's New"

    Search for "Virtual folders"

    0 讨论(0)
提交回复
热议问题