简体   繁体   English

如何有效地管理 Eclipse CDT 中构建的文件排除?

[英]How to efficiently manage file exclusion from build in Eclipse CDT?

I have an embedded C project comprised of dozens of source module and headers, in a directory hierarchy.我有一个嵌入式 C 项目,该项目由目录层次结构中的数十个源模块和标头组成。 The project is defined for a few targets (managed using build configurations) and many of the modules are included in the build for only a subset of configurations.该项目是为几个目标定义的(使用构建配置进行管理),并且许多模块都包含在构建中,仅用于配置的子集。

The project is a makefile project, built from command line, and I am using the Eclipse IDE mostly for its static code analysis capabilities. The project is a makefile project, built from command line, and I am using the Eclipse IDE mostly for its static code analysis capabilities. For example, when searching for a definition of an object, it knows what header file to open, based on the inclusion of that module in the build configuration.例如,当搜索 object 的定义时,它知道要打开哪个 header 文件,基于构建配置中包含该模块。

In the past I used the Export/Import feature to bulk-edit the include paths and macro definitions for the various configurations.过去,我使用导出/导入功能批量编辑各种配置的包含路径和宏定义。

But I am looking for a way to do that for module inclusion/exclusion.但我正在寻找一种方法来实现模块包含/排除。 If I right-click on a directory in the code tree, I see the Exclude from build... menu entry, that opens a dialog with the list of configurations, where I can conveniently select in which configs to exclude that directory.如果我右键单击代码树中的一个目录,我会看到Exclude from build...菜单条目,它会打开一个包含配置列表的对话框,我可以方便地在其中 select 在其中排除该目录的配置。

But, this dialog is missing from the context menu of a specific module.但是,特定模块的上下文菜单中缺少此对话框。 Thus, I need to open the Properties dialog and scroll through all configs exclude the from the required ones one-by-one.因此,我需要打开“属性”对话框并滚动浏览所有配置,一一排除所需配置。

Is there a dialog similar to the directory one for a single module?是否有类似于单个模块的目录的对话框?

Is there a way to export these settings (other than include paths and macros) to an XML file for easy editing?有没有办法将这些设置(包括路径和宏除外)导出到 XML 文件以便于编辑? Where does Eclipse save this information? Eclipse 将这些信息保存在哪里?

I am using ARM's DS-5 Eclipse platform version Mars.2 (4.5.2)我正在使用ARM的DS-5 Eclipse平台版本Mars.2(4.5.2)

I see Exclude from build... in the Resource Configurations submenu for both directories and individual files.我在目录和单个文件的Resource Configurations子菜单中看到Exclude from build...

As for where Eclipse stores this information: in the .cproject file, in entries that look something like this:至于 Eclipse 存储此信息的位置:在.cproject文件中,在看起来像这样的条目中:

<cproject ...>
  <storageModule ...>
    <cconfiguration ...>
      ...
      <storageModule ...>
        <configuration ...>
          ...
          <sourceEntries>
            <entry excluding="<path-to-excluded-resource>" ...>
            ...
          </sourceEntries> 
          ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM