我可以在构建前和构建后事件中使用配置名称吗?

发布于 2024-09-28 15:28:41 字数 182 浏览 9 评论 0原文

在 Codegear RAD Studio 2007 中,我尝试在预构建和构建后事件期间执行一些文件删除和复制操作,这些事件涉及以当前配置命名的文件夹。在 Visual Studio 中,可以使用 $(ConfigurationName) 宏轻松完成此操作。

RAD Studio 中有类似的东西吗?如果没有,我可以使用解决方法吗?

In Codegear RAD Studio 2007, I'm trying to do some file deletion and copying during the pre-build and post-build events that involve folders named after the current configuration. In Visual Studio, this is easily done with the $(ConfigurationName) macro.

Is there any equivalent to this in RAD Studio? If not, is there a workaround I can use?

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

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

发布评论

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

评论(1

┼── 2024-10-05 15:28:41

我认为您正在寻找$(Config)。例如,在预构建事件中,您可以添加 echo $(Config),它将打印类似“Debug”或“Debug Build”的字符串。我已经在 Rad Studio 2010 中测试过它,但没有在 2007 年测试过。不过,我相信它们使用相同的配置变量。

如果这不起作用,请在编辑器中打开 cbproj 文件并查找类似以下内容:

<Config Condition="'$(Config)'==''">Debug</Config>

无论出现什么单词而不是“Config”,都可能会给您提供线索。

I think what you're looking for $(Config). For example, in a prebuild event, you can add echo $(Config) and it will print a string like "Debug" or "Debug Build". I've tested it in Rad Studio 2010, but not in 2007. I believe they use the same configuration variable, though.

If that doesn't work, open a cbproj file in an editor and look for something like this:

<Config Condition="'$(Config)'==''">Debug</Config>

Whatever word appears instead of 'Config' there may give you a clue.

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