BuildAfterTargetingPack.csproj 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <Project>
  2. <!-- Fake a unit test project unless that would prevent building this project. -->
  3. <PropertyGroup>
  4. <IsUnitTestProject Condition=" '$(SkipTestBuild)' == 'true' ">false</IsUnitTestProject>
  5. <IsUnitTestProject Condition=" '$(SkipTestBuild)' != 'true' ">true</IsUnitTestProject>
  6. <IsTestProject>$(IsUnitTestProject)</IsTestProject>
  7. </PropertyGroup>
  8. <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
  9. <!--
  10. Forward targets to @(RequiresDelayedBuild) projects after App.Ref has built. Intended for projects that
  11. cannot restore without our App.Ref layout and aren't referenced elsewhere in the repo. For projects
  12. referenced elsewhere, use something else e.g. @(TestAssetProjectReference) items and
  13. FunctionalTestWithAssets.targets for test asset projects that need special handling.
  14. -->
  15. <PropertyGroup>
  16. <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
  17. <!-- Nothing from this project ships whether we're faking a unit test project or not. -->
  18. <IsShipping>false</IsShipping>
  19. <!-- Build.props is main thing that references this project. -->
  20. <IsProjectReferenceProvider>false</IsProjectReferenceProvider>
  21. </PropertyGroup>
  22. <ItemGroup>
  23. <!--
  24. When adding new projects to @(RequiresDelayedBuild), temporarily reference the projects here, run
  25. GenerateProjectList.ps1, then undo changes in this file. See comments in Build.props for other options.
  26. -->
  27. <!-- RequiresDelayedBuild Include="..." / -->
  28. <!-- Enforce build order. Need shared Fx before building the important projects. -->
  29. <ProjectReference Include="$(RepoRoot)\src\Framework\App.Ref\src\Microsoft.AspNetCore.App.Ref.csproj"
  30. Private="false"
  31. ReferenceOutputAssembly="false"
  32. SkipGetTargetFrameworkProperties="true" />
  33. </ItemGroup>
  34. <!-- Cannot build in source-build because that does not create an App.Ref layout. -->
  35. <Target Name="BuildDelayedProjects"
  36. BeforeTargets="Build"
  37. Condition=" '$(DotNetBuildFromSource)' != 'true' "
  38. Returns="@(TargetPathWithTargetPlatformMoniker)">
  39. <MSBuild Projects="@(RequiresDelayedBuild)"
  40. BuildInParallel="$(BuildInParallel)"
  41. Properties="MSBuildRestoreSessionId=$([System.Guid]::NewGuid())"
  42. Targets="Restore" />
  43. <MSBuild Projects="@(RequiresDelayedBuild)" BuildInParallel="$(BuildInParallel)" Targets="Build">
  44. <Output TaskParameter="TargetOutputs" ItemName="TargetPathWithTargetPlatformMoniker" />
  45. </MSBuild>
  46. </Target>
  47. <Target Name="CleanDelayedProjects" BeforeTargets="Clean" Condition=" '$(DotNetBuildFromSource)' != 'true' ">
  48. <MSBuild Projects="@(RequiresDelayedBuild)" BuildInParallel="$(BuildInParallel)" Targets="Clean" />
  49. </Target>
  50. <Target Name="CreateHelixPayloadDelayedProjects"
  51. BeforeTargets="CreateHelixPayload"
  52. Condition=" '$(DotNetBuildFromSource)' != 'true' "
  53. Returns="@(HelixWorkItem)">
  54. <MSBuild Projects="@(RequiresDelayedBuild)"
  55. BuildInParallel="$(BuildInParallel)"
  56. SkipNonexistentTargets="true"
  57. Targets="CreateHelixPayload">
  58. <Output TaskParameter="TargetOutputs" ItemName="HelixWorkItem" />
  59. </MSBuild>
  60. </Target>
  61. <Target Name="GetReferencesProvidedDelayedProjects"
  62. BeforeTargets="GetReferencesProvided"
  63. Returns="@(ProvidesReference)">
  64. <MSBuild Projects="@(RequiresDelayedBuild)" BuildInParallel="$(BuildInParallel)" Targets="GetReferencesProvided">
  65. <Output TaskParameter="TargetOutputs" ItemName="ProvidesReference" />
  66. </MSBuild>
  67. </Target>
  68. <Target Name="PackDelayedProjects" BeforeTargets="Pack" Condition=" '$(DotNetBuildFromSource)' != 'true' ">
  69. <MSBuild Projects="@(RequiresDelayedBuild)" BuildInParallel="$(BuildInParallel)" Targets="Pack" />
  70. </Target>
  71. <Target Name="PublishDelayedProjects" BeforeTargets="Publish" Condition=" '$(DotNetBuildFromSource)' != 'true' ">
  72. <MSBuild Projects="@(RequiresDelayedBuild)" BuildInParallel="$(BuildInParallel)" Targets="Publish" />
  73. </Target>
  74. <Target Name="TestDelayedProjects" BeforeTargets="Test" Condition=" '$(DotNetBuildFromSource)' != 'true' ">
  75. <MSBuild Projects="@(RequiresDelayedBuild)" BuildInParallel="$(BuildInParallel)" Targets="Test" />
  76. </Target>
  77. <Target Name="VSTestDelayedProjects" BeforeTargets="VSTest" Condition=" '$(DotNetBuildFromSource)' != 'true' ">
  78. <MSBuild Projects="@(RequiresDelayedBuild)" BuildInParallel="$(BuildInParallel)" Targets="VSTest" />
  79. </Target>
  80. <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
  81. </Project>