我需要在构建ARM时跳过所有以“.UnitTests”结尾的项目,但如果我为x86构建,则需要构建它,但排除其他项目?
是否可以通过某种规则从构建过程中跳过某些项目?
是否可以通过某种规则从构建过程中跳过某些项目?
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Condition="'$(Platform)' == 'ARM'">
<ARMProjects Include="abc\*.csproj" Exclude="**\*.UnitTests.csproj"/>
<ARMProjects Include="def\*.csproj" Exclude="**\*.UnitTests.csproj"/>
</ItemGroup>
<ItemGroup Condition="'$(Platform)' == 'x86'">
<!-- Create a group named X86Projects and select the projects as you need to -->
</ItemGroup>
<Target Name="Build">
<MSBuild Project="@(ARMProjects)" Targets="Build" Condition="'$(Platform)' == 'ARM'"/>
<MSBuild Project="@(X86Projects)" Targets="Build" Condition="'$(Platform)' == 'x86'"/>
</Target>
</Project>
msbuild /p:Configuration=Debug /p:Platform=x86
。如果您想要更多自定义逻辑来选择要构建的项目,则需要一个自定义的 msbuild 文件来实现。我会更新答案以包括这一点。 - radical.sln
文件并根据在 .sln
文件中找到的 config+platform 映射生成一个 msbuild 项目文件。 您可以从命令行中选择要构建的 config+platform。 - radical