有条件的MSBuild Exec的? [英] MSBuild conditional Exec?
问题描述
我建立使用各种项目的<项目的MSBuild =...标记我然后执行一些命令行工具,项目建成后,
I am building various projects using the <MSBuild Projects="... markup. I am then executing some command line tools after the project is built.
例如
<Target Name="Name">
<MSBuild Projects="" />
<Exec Command="" />
</Target>
我注意到,按要求项目仅建成并运行构建脚本时,得到如下输出:跳过目标CoreCompile,因为所有输出文件都是最新的。这是伟大的,但如何让我的&LT; Exec的...命令都使用相同的条件,使他们只有在运行必要的,也是
I notice that the project is only built as required and get the following output when the build script is run: "Skipping target "CoreCompile" because all output files are up-to-date". This is great but how do I make my <Exec... commands use the same condition so that they are only run when necessary as well?
更新:我实现gregmac的建议,但它仍然在执行命令不管。这是我现在得到:
Update: I've implemented gregmac's suggestion but its still executing the command regardless. This is what I've got now:
<Target Name="Name">
<MSBuild Projects="">
<Output TaskParameter="TargetOutputs" ItemName="AssembliesBuiltByChildProjects" />
</MSBuild>
<Exec Command="" Condition="'@(AssembliesBuiltByChildProjects)'!=''" />
任何进一步的帮助是非常AP preciated。这是一个有点棘手的问题对我来说。
Any further help is much appreciated. This is a bit of a sticking point for me.
感谢您的任何提示。
阿伦
推荐答案
我还是设法找到一个解决方案适合我的需要,虽然它可能不是最佳的解决方案。
I did manage to find a solution to fit my needs although it may not be the optimal solution.
请参阅我的回答对我在这里的其他问题:的MSBuild生成后
See my answer to my other question here: MSBuild Post-Build
谢谢,
阿伦
这篇关于有条件的MSBuild Exec的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!