我有一個在解決方案中構建所有專案的 Azure 管道,但我想選擇管道構建或忽略哪些專案。我認為使用“ToBuildBool”布林值來標記要構建的專案是要走的路。“ToBuildBool”默認設定為“true”,可以在我不想通過管道構建的專案的csproj檔案中手動設定為“false”,而是要被忽略。我在正確的軌道上嗎?如何在 csproj 檔案中設定布爾標志?
- task: DotNetCoreCLI@2
displayName: 'DotNetCore Build'
inputs:
command: 'custom'
custom: 'build'
projects: 'MySolution.sln'
feedsToUse: config
nugetConfigPath: nuget.config
arguments: '-c Release -p:ToBuildBool=true' # set build flag'
uj5u.com熱心網友回復:
您可以為projects引數指定多個專案。這就是為什么它是復數,而不是單數。DotNetCoreCLI@2有關受支持模式的示例,請參閱任務檔案。
或者,您可以對DotNetCoreCLI@2任務進行多次順序呼叫,每個要構建的專案一次。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/515110.html
