Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)' != ''" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intentioanl that the build step is the only one that is executed for each, rather than for signing, AfterSolutionBuild.proj, etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AfterSolutionBuild.proj, Sign.proj and Publish.proj run only once and not per ProjectToBuild item. So they don't need any batching. Restore is the only target that takes ProjectToBuild as an input but it's an anti-pattern to invoke the Restore target on every project which is why I intentionally don't support BuildStep there.


<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">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this invoke the build target in parallel on the build step?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MSBuild doesn't support target level parallelism, only project level.

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

</Project>
Loading