2013-01-23 25 views
0

是否有可能通過MSBuild的一些命令行屬性:MSBuild的迭代性質

msbuild.exe /p:Configuration=Release;labDeploy=false;prodDeploy=true 

然後以某種方式通過經由屬性精氨酸傳入的鍵/值對迭代。

如果是這樣,怎麼樣?

回答

0

你不會說你想使用它們,但是如果你想用它們來執行控制,請看MSBuild Conditions。例如,我公司現在完全實施的「產品」包含傳統的客戶端 - 服務器應用程序,基於Web的報告應用程序以及某些客戶端 - 服務器應用程序的較新Silverlight實現。

在我的主MSBuild項目文件中,我爲每個應用程序都有單獨的目標,它們是否運行由幾個命令行參數的條件檢查控制。

<!-- run the builds for the selected build types --> 
    <Target Name="RunBuild" DependsOnTargets="ValidateBuildSelected"> 
    <CallTarget Targets="BuildWindowsClientApp" Condition="'$(BuildWindowsClientApp)'=='TRUE'" /> 
    <CallTarget Targets="BuildWebReportingApp" Condition="'$(BuildWebReportingApp)'=='TRUE'" /> 
    <CallTarget Targets="BuildWebClientApp" Condition="'$(BuildWebClientApp)'=='TRUE'" /> 
    </Target> 

我可以運行一個或所有的選項,根據我如何設置參數字符串了。