【问题标题】:TFS build agent "Delete Files" task clean up output folder before publishingTFS 构建代理“删除文件”任务在发布前清理输出文件夹
【发布时间】:2019-08-07 23:40:10
【问题描述】:

如何从 TFS 的输出文件夹中删除文件?

在“构建解决方案”任务之后,我添加了一个“删除文件”任务

Source Folder
$(Build.BinariesDirectory)

Contents
**/*beer*test*.dll
**/*beer*test*.pdb
**/*beer*secret*.dll
**/*beer*secret*.pdb

假设

mybeer.is.secret.dll

将从输出文件夹中删除,因此也不会在最终的“发布工件”步骤中发布。

但似乎什么都没有被删除。

另外,如果可能的话,我想从输出文件夹中删除特定的,我不确定 Build.BinariesDirectory 是否是一个不错的选择。

由于构建生成的文件夹层次结构相对于(大概)BinariesDirectory(在我的情况下为 SolutionName\bin\Debug),我使用的 ** 需要从 Debug 文件夹中删除。

【问题讨论】:

    标签: msbuild build-agent


    【解决方案1】:

    我想主要是源文件夹是错误的。我还更新了 Contents 部分,使其更加具体(在“将文件复制到:$(build.artifactstagingdirectory)”步骤中还指定了文件夹

    $(Build.Repository.LocalPath)
    

    **\bin\$(BuildConfiguration)\**/*beer*test*.dll
    **\bin\$(BuildConfiguration)\**/*beer*test*.pdb
    **\bin\$(BuildConfiguration)\**/*beer*secret*.dll
    **\bin\$(BuildConfiguration)\**/*beer*secret*.pdb
    

    现在似乎可以工作了。

    【讨论】:

    • 感谢您的友好分享。您可以将您的回复标记为答案,这也将有助于社区中的其他人。
    猜你喜欢
    • 2015-08-22
    • 1970-01-01
    • 2015-05-27
    • 2018-05-18
    • 1970-01-01
    • 1970-01-01
    • 2019-07-09
    • 2020-12-23
    • 2013-11-14
    相关资源
    最近更新 更多