且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将项目一个接一个地传递给另一个msbuild任务?

更新时间:2023-02-01 20:13:20

最后,我找到了解决方案.解决方案如下

Finally i found the solution. The solution is like below

我应该使用组件名称创建属性.

I should create property with Component names.

<X>Y:\Build\X.Properties</X>
<Y>Y:\Build\Y.Properties</Y>
<Z>Y:\Build\Z.Properties</Z>

在Msbuild任务中,我应该遵循以下

And in Msbuild task , I should follow as below

<Target Name="BuildAll" >

    <ReadLinesFromFile  File="$(AllComponents)">
      <Output TaskParameter="Lines" ItemName="AllComponents"/>
    </ReadLinesFromFile>

    <MSBuild Projects="$(%(AllComponents.Identity))"

             Targets="BuildComponent" />

</Target>

现在它将构建我通过文本文件传递的组件.

Now it will build the component which i pass through the text file.