Msbuild 从文件夹生成项目列表以进行批生成
我想为不同的客户批量构建一个项目,每个客户在项目中都有自己的子文件夹Msbuild 从文件夹生成项目列表以进行批生成,msbuild,batch-processing,Msbuild,Batch Processing,我想为不同的客户批量构建一个项目,每个客户在项目中都有自己的子文件夹 root customers customer1 customer2 是否有方法在msbuild中生成列表,以批生成具有a/p:customer=customer文件夹名称的项目? 因此,在项目文件中,我可以包含来自%customer的某些文件。首先列出目录1,然后获取目录2的最后部分,然后在目录3上循环: <Target Name="Batch"> <ItemGroup>
root
customers
customer1
customer2
是否有方法在msbuild中生成列表,以批生成具有a/p:customer=customer文件夹名称的项目?
因此,在项目文件中,我可以包含来自%customer的某些文件。首先列出目录1,然后获取目录2的最后部分,然后在目录3上循环:
<Target Name="Batch">
<ItemGroup>
<!-- (1) don't forget to replace rootdir with your dir -->
<CustomerDirs Include="$([System.IO.Directory]::GetDirectories(rootdir, *, SearchOption.AllDirectories))" />
<!-- (2) -->
<Customers Include="@(CustomerDirs->'%(FileName)')"/>
</ItemGroup>
<!-- (3) -->
<Message Text="customer=%(Customers.Identity)"/>
</Target>