Delphi 的 OTA:有没有办法在构建时获取活动配置(D2010)?

发布于 2024-08-28 16:43:14 字数 739 浏览 3 评论 0原文

我可以要求 Delphi 立即构建所有配置 - 通过单击“构建配置”并调用“Make”命令:

构建所有conf
(来源:free.fr

这将依次构建所有配置。

问题是我们有一个 IDE 专家,它必须对编译事件做出反应。我们注册 IOTAIDENotifier80 来挂钩事件。有 BeforeBuild 和 AfterBuild 事件 - 我们对这些事件感兴趣。 IOTAProject被传递到每个事件。

问题是:活动配置永远不会改变。即,如果您选择了“调试”配置(以粗体显示) - 对 BeforeBuild/AfterBuild 事件的所有调用都将返回调试配置文件(即使 IDE 依次编译不同的配置文件)。我在这里指的是 IOTAProject 的属性。

我还尝试使用 IOTAProjectOptionsConfigurations,但其 ActiveConfiguration 属性始终返回相同的“粗体”配置文件,无论当前编译的配置文件如何。

问题是:有没有办法获得“真实”的当前配置文件?

I can ask Delphi to build all configurations at once - by clicking on "Build configurations" and invoking "Make" command:

Build all confs
(source: free.fr)

This will build all configurations, one after another.

The problem is that we have an IDE expert, which must react on compilation events. We register IOTAIDENotifier80 to hook events. There are BeforeBuild and AfterBuild events - we're interested in those. IOTAProject is passed to each event.

The problem is: the active configuration is never changed. I.e. if you have "Debug" configuration selected (maked in bold) - all calls to BeforeBuild/AfterBuild events will return debug configuration profile (even though IDE compiles different profiles one after another). I mean properties of IOTAProject here.

I also tried to use IOTAProjectOptionsConfigurations, but its ActiveConfiguration property always return the same "bolded" profile, regardless of current compiled one.

The question is: is there a way to get the "real" current profile?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暗地喜欢 2024-09-04 16:43:14

这并不完全是问题的答案。这是一个解决方法。

这不是一个很好的选择,但这就是我所做的。我有一个小型命令行实用程序来编辑 XML 文件,我在其中传递 XPath、新值和文件名。我用它来修改 .dproj 文件。这让我可以设置活动配置进行调试、发布等。修改文件后,我可以调用 bds.exe,并切换适当的命令行来编译活动配置。虽然不像右键单击并选择“Make”那么方便,但一旦设置完毕,它就像运行批处理一样简单。

我尚未测试它如何与 IDE Expert 交互,但您可以通过手动修改 .dproj 文件轻松测试该计划是否适合您。一旦您知道它是否适合您,您就可以根据需要创建批处理和 XML 编辑器。

This isn't exactly an answer to the problem. It is a workaround.

It's not a great option, but here is what I do. I've got a small command line utility to edit XML files where I pass an XPath and new value and a filename. I use this to modify the .dproj file. This lets me set the active configuration do debug, release, etc. Once the file has been modified I call bds.exe with the appropriate command line switched to compile the active configuration. While not as convenient as right clicking and picking 'Make', once it is setup it is as simple as running a batch.

I've not tested how this interacts with an IDE Expert, but you can easily test if this plan will work for you by modifying the .dproj file by hand. Once you know if it will work for you, you can create the batch and XML editor if needed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文