5
我正在實現一個MSBuild框架,以推動組織爲層次結構的許多項目的構建和部署。如何在不執行構建的情況下檢索@(TargetOutputs)
<Target Name="_CoreBuild">
<MSBuild Projects="@(Project)" Targets="Build" Properties="Configuration=$(Configuration)">
<Output TaskParameter="TargetOutputs" ItemName="CompiledAssemblies" />
</MSBuild>
</Target>
爲了實施適當的清潔/痛打邏輯,我想如果檢索構建以當前執行的選項將被編譯的文件列表。
<Target Name="_CoreClobber" DependsOnTargets="_CoreClean">
<!-- How to retrieve @(CompiledAssemblies) as if we were
building @(Project) and retrieving the @(TargetOutputs) item group.
-->
</Target>
我已經試過各種方法,包括創建一個自定義任務,我在其中建立一個進口原項目,我想要從屬性/項目定製項目文件。但那並不能給我可靠的價值。
有沒有辦法在沒有實際執行構建的情況下檢索MSBuild項目的TargetOutputs項目組?