Skip to content

Commit

Permalink
Allow build targets to be invoked in specific batches.
Browse files Browse the repository at this point in the history
Enables building the aspnetcore repo with a single eng\build.cmd invocation (when using desktop msbuild).

Unblocks dotnet/sdk#44828 & dotnet/aspnetcore#58987
  • Loading branch information
ViktorHofer authored Nov 25, 2024
1 parent 7d955f9 commit 391a83f
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

<ItemDefinitionGroup>
<ProjectToBuild>
<BuildStep>1</BuildStep>
<RestoreInParallel>true</RestoreInParallel>
<BuildInParallel>true</BuildInParallel>
<DotNetBuildPass>1</DotNetBuildPass>
Expand Down Expand Up @@ -277,15 +278,7 @@
BuildInParallel="%(_ProjectToRestore.RestoreInParallel)"
Condition="'$(Restore)' == 'true'"/>

<!--
Build solution.
-->
<MSBuild Projects="@(ProjectToBuild)"
Properties="@(_SolutionBuildProps);__BuildPhase=SolutionBuild;_NETCORE_ENGINEERING_TELEMETRY=Build"
RemoveProperties="$(_RemoveProps)"
Targets="@(_SolutionBuildTargets)"
BuildInParallel="%(ProjectToBuild.BuildInParallel)"
Condition="'@(_SolutionBuildTargets)' != ''" />
<CallTarget Targets="ExecuteBuildTargets" Condition="'@(_SolutionBuildTargets)' != ''" />

<MSBuild Projects="AfterSolutionBuild.proj"
Properties="@(_CommonProps);_NETCORE_ENGINEERING_TELEMETRY=Build"
Expand Down Expand Up @@ -340,4 +333,12 @@
Condition="'$(Publish)' == 'true' and '$(_ShouldRunPublish)' == 'true'"/>
</Target>

<Target Name="ExecuteBuildTargets" Inputs="%(ProjectToBuild.BuildStep)" Outputs="unused">
<MSBuild Projects="@(ProjectToBuild)"
Properties="@(_SolutionBuildProps);__BuildPhase=SolutionBuild;_NETCORE_ENGINEERING_TELEMETRY=Build"
RemoveProperties="$(_RemoveProps)"
Targets="@(_SolutionBuildTargets)"
BuildInParallel="%(ProjectToBuild.BuildInParallel)" />
</Target>

</Project>

0 comments on commit 391a83f

Please sign in to comment.