【问题标题】:How to differentiate between build configurations in Eclipse (C) project template to setup build cfg sepcific settings?如何区分 Eclipse (C) 项目模板中的构建配置以设置构建 cfg 特定设置?
【发布时间】:2017-07-21 07:59:56
【问题描述】:

我正在尝试使用 Eclipse (C) 项目模板。我从@Jonah Graham 找到了这个关于如何work with Eclipse project template 的非常描述性的答案,并通过Eclipse documentation - How to add project templates to CDT

我可以通过“SetMBSStringOptionValue”创建项目模板并设置一些设置

<!--  Set TMP setting by adding textual build settings -->
<process
    type="org.eclipse.cdt.managedbuilder.core.SetMBSStringOptionValue">
    <simple name="projectName" value="$(projectName)" />
    <complex-array name="resourcePaths">
        <element>
            <simple name="id" value=".*compiler\.option\.misc\.other*" />
            <simple name="value" value="TMP_SETTING_RELEASE" />
            <simple name="path" value="" />
        </element>
    </complex-array>
</process>

我的问题是如何区分构建配置?例如。我想为“调试”和“发布”构建配置设置不同的设置。我该怎么做?

【问题讨论】:

    标签: eclipse eclipse-cdt eclipse-pde


    【解决方案1】:

    AFAIK 没有人提供允许在设置选项时指定配置的“流程运行器”。

    您可以添加自己的 org.eclipse.cdt.core.templateengine.process.ProcessRunner 子类,基于 org.eclipse.cdt.managedbuilder.core.SetMBSStringOptionValue 额外允许您指定要应用的配置它到。您需要的 Eclipse 扩展点是org.eclipse.cdt.core.templateProcessTypes

    请记住,当您执行此操作时,用户可以执行新项目向导,他们可以选择是否具有调试/发布配置,如此屏幕截图所示:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-26
      • 1970-01-01
      • 2016-02-18
      • 2018-04-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多