MSBUILD - 阻止直到文件存在于 ftp 服务器上?
作为构建过程的一部分..我想阻止构建,直到在 ftp 位置远程创建(存在)文件,之后我将继续构建。 (最好有某种超时限制)。
建议?
仅使用标准 msbuild 任务和/或 extensionPack/communitytask 是否可以实现这一点?
As part of a build process .. I would like to block the build until a file gets created (exists) remotely at an ftp location, after which I would continue the build. (Preferably with somekind of time out limit).
Suggestions?
Is this even possible using only the standard msbuild task and/or extensionPack/communitytask?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您最好的选择是构建一个小型自定义 exe(您甚至可以将其编译为构建步骤)来轮询您正在查找的文件。然后,您可以使用 PreBuild 目标或预构建步骤中的自定义目标来验证该文件是否存在。
其他更多面向 MSBuild 的建议是将该 exe 重新制作为自定义任务,甚至是 MSBuild 4.0 中的内联任务。
FWIW,我遇到过一位同行完成的类似解决方案,他不希望版本控制中的集成测试使用大型二进制文件,并且他需要在构建中使用自定义下载程序以从 SMB 共享获取文件。它运作良好。
自定义任务
内联任务
Your best bet is to build a small custom exe (you can even compile it as a build step) that polls for the file you are looking for. Then you use the PreBuild target, or a custom target in a pre-build step to verify that the file exists.
Other more MSBuild oriented suggestions are to remake that exe as a custom task, or even an inline task in MSBuild 4.0.
FWIW, I've encountered a similar solution done by a peer who didn't want large binaries used by integration tests in version control and he required the use of a custom downloader in the build to get the files from a SMB share. It worked well enough.
Custom Tasks
Inline Tasks