我可以在构建前和构建后事件中使用配置名称吗?
在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您正在寻找
$(Config)
。例如,在预构建事件中,您可以添加echo $(Config)
,它将打印类似“Debug”或“Debug Build”的字符串。我已经在 Rad Studio 2010 中测试过它,但没有在 2007 年测试过。不过,我相信它们使用相同的配置变量。如果这不起作用,请在编辑器中打开 cbproj 文件并查找类似以下内容:
无论出现什么单词而不是“Config”,都可能会给您提供线索。
I think what you're looking for
$(Config)
. For example, in a prebuild event, you can addecho $(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:
Whatever word appears instead of 'Config' there may give you a clue.