将源文件列表导入到Eclipse项目中

时间:2023-01-18 21:57:14

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 a specific project. I used SlickEdit before, and there I could just import a list of sources and headers. Is it possible to achieve something similar in Eclipse?

我们有一个topdirectory,包含许多不同项目的代码。我希望创建一个Eclipse CDT-project,该项目只包含用于处理和编译特定项目所需的源代码。我以前使用过SlickEdit,在那里我可以导入一个源代码和标题列表。是否有可能在Eclipse中实现类似的东西?

4 个解决方案

#1


1  

In Eclipse Helios (3.6)

在Eclipse Helios(3.6)

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

在eclipse项目中,右击“New…”>“文件夹”。

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"

搜索“虚拟文件夹”

#2


1  

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

在Eclipse中,您可以有选择地导入项目中包含的某些目录。

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)

您可以在您的驱动器的其他地方创建一个eclipse项目,然后只创建您想要在原始位置的文件夹的链接(在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:

您还可以为整个项目使用链接资源策略(我指的是Eclipse项目,而不是*项目)。例如,如果您的文件夹层次结构如下:

/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.

您可以在location /my-workspace中创建一个eclipse工作区,创建一个名为subProjectA的项目,并将其链接到/顶层/projectA/subProjectA。您可以对projectB执行相同的操作,它们将出现在您的Eclipse工作区中,就像它们在一个平面层次结构中并排显示一样。

#3


0  

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.

据我所知,你不能那样做。您可以做的是将这些源文件导入到另一个项目中,这意味着这些文件将被复制到创建的项目中。

#4


0  

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.

传统上,Eclipse假定.project文件位于项目源代码的*目录,并且项目中包含了它下面的所有源代码。但是,我认为您应该能够使用链接文件夹,这样您就有了一个Eclipse项目目录,它基本上是空的,但是对于.project文件和指向源树的链接文件夹。但是,我认为您不能显式地列出项目中要包含的文件。

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

编辑:如果你找到解决方法,请告诉我。

#1


1  

In Eclipse Helios (3.6)

在Eclipse Helios(3.6)

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

在eclipse项目中,右击“New…”>“文件夹”。

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"

搜索“虚拟文件夹”

#2


1  

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

在Eclipse中,您可以有选择地导入项目中包含的某些目录。

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)

您可以在您的驱动器的其他地方创建一个eclipse项目,然后只创建您想要在原始位置的文件夹的链接(在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:

您还可以为整个项目使用链接资源策略(我指的是Eclipse项目,而不是*项目)。例如,如果您的文件夹层次结构如下:

/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.

您可以在location /my-workspace中创建一个eclipse工作区,创建一个名为subProjectA的项目,并将其链接到/顶层/projectA/subProjectA。您可以对projectB执行相同的操作,它们将出现在您的Eclipse工作区中,就像它们在一个平面层次结构中并排显示一样。

#3


0  

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.

据我所知,你不能那样做。您可以做的是将这些源文件导入到另一个项目中,这意味着这些文件将被复制到创建的项目中。

#4


0  

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.

传统上,Eclipse假定.project文件位于项目源代码的*目录,并且项目中包含了它下面的所有源代码。但是,我认为您应该能够使用链接文件夹,这样您就有了一个Eclipse项目目录,它基本上是空的,但是对于.project文件和指向源树的链接文件夹。但是,我认为您不能显式地列出项目中要包含的文件。

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

编辑:如果你找到解决方法,请告诉我。