如何在TFS Build中递归删除通配符文件?
我想递归删除与特定模式匹配的文件,作为 TFS Build 中构建后清理例程的一部分。我已经尝试过了......
<Delete Files="T:\DeploymentDir\**\A*" />
构建中没有错误,但它不起作用。
I want to recursively delete files that match a certain pattern as part of my post-build cleanup routines in TFS Build. I've tried this...
<Delete Files="T:\DeploymentDir\**\A*" />
No errors in the build, but it doesn't work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
修改 TFSBuild.proj 文件并在最后添加以下行(就在关闭之前):
Modify your TFSBuild.proj file and add the following lines at the very end (just before closing ):
我不认为删除任务会自动扩展通配符。您需要首先指定一个项目组,然后将其传递到删除任务中:
从 MSBuild 3.5 开始,您可以将项目组包含在与删除任务相同的目标中。
I don't think the Delete task will automatically expand the wildcard. You'll need to specify an itemgroup first, then pass that into the Delete task:
With MSBuild 3.5 onwards you can include the ItemGroup in the same target as the Delete task.