Build.props 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <Project>
  2. <Import Project="Common.props" />
  3. <!-- These projects are always excluded, even when -projects is specified on command line. -->
  4. <ItemGroup>
  5. <!-- Explicitly excluded projects -->
  6. <ProjectToExclude Include="$(ProjectToExclude)" />
  7. <!-- These projects use 'legacy' csproj, which is not supported by dotnet-msbuild. -->
  8. <ProjectToExclude Include="
  9. $(RepoRoot)src\Servers\HttpSys\samples\TestClient\TestClient.csproj;
  10. $(RepoRoot)src\Middleware\WebSockets\samples\TestServer\WebSockets.TestServer.csproj;
  11. "
  12. Condition=" '$(MSBuildRuntimeType)' == 'Core' " />
  13. <!-- Exclude the websockets samples for now because they use classic .csproj, which is not yet supported in our build. -->
  14. <ProjectToExclude Include="$(RepoRoot)src\Middleware\WebSockets\samples\**\*.csproj" />
  15. <!-- These projects are meant to be executed by tests. -->
  16. <ProjectToExclude Include="
  17. $(RepoRoot)src\Tools\dotnet-watch\test\TestProjects\**\*.csproj;
  18. $(RepoRoot)src\Tools\Tests.Common\TestProjects\**\*.csproj;
  19. $(RepoRoot)src\Razor\Razor.Design\test\testassets\**\*.*proj;
  20. $(RepoRoot)src\Razor\test\testassets\**\*.*proj;
  21. $(RepoRoot)src\Components\Web.JS\node_modules\**\*.*proj;
  22. $(RepoRoot)src\Components\WebAssembly\Sdk\testassets\**\*.csproj;
  23. " />
  24. <!-- These projects are not meant to be built in this repo. In the Installers case, must explicitly opt in. -->
  25. <ProjectToExclude Include="
  26. $(RepoRoot)src\submodules\**\*.*proj;
  27. $(RepoRoot)src\Installers\**\*.*proj;
  28. $(RepoRoot)src\SignalR\clients\ts\**\node_modules\**\*.*proj;
  29. $(RepoRoot)src\ProjectTemplates\Web.ProjectTemplates\content\**\*.*proj;
  30. $(RepoRoot)src\ProjectTemplates\Web.Spa.ProjectTemplates\content\**\*.csproj;
  31. " />
  32. <!-- Exclude the benchmarks because they use <PackageReference>. -->
  33. <ProjectToExclude Include="
  34. $(RepoRoot)src\Components\benchmarkapps\BlazingPizza.Server\**\*.csproj;
  35. $(RepoRoot)src\Mvc\perf\**\*.csproj;
  36. $(RepoRoot)src\Servers\Kestrel\perf\PlatformBenchmarks\**\*.csproj;
  37. $(RepoRoot)src\SignalR\perf\benchmarkapps\**\*.csproj;
  38. " />
  39. <!-- Skipping due to build unreliability with current SDK et cetera. -->
  40. <ProjectToExclude Include="
  41. $(RepoRoot)src/Components/test/E2ETestMigration/Microsoft.AspNetCore.Components.Migration.E2ETests.csproj" />
  42. </ItemGroup>
  43. <Choose>
  44. <!-- Project selection can be overridden on the command line by passing in -projects. -->
  45. <When Condition="'$(ProjectToBuild)' != ''">
  46. <ItemGroup>
  47. <ProjectToBuild Include="$(ProjectToBuild)" Exclude="@(ProjectToExclude);$(RepoRoot)**\bin\**\*;$(RepoRoot)**\obj\**\*">
  48. <RestoreInParallel Condition="'%(Extension)' == '.npmproj'">false</RestoreInParallel>
  49. </ProjectToBuild>
  50. </ItemGroup>
  51. </When>
  52. <Otherwise>
  53. <ItemGroup Condition=" '$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64') ">
  54. <!-- Build the ANCM custom action -->
  55. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=x64" />
  56. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=Win32" />
  57. <!-- Build the ANCM msis -->
  58. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj" AdditionalProperties="Platform=x64" />
  59. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj" AdditionalProperties="Platform=x86" />
  60. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMV2\ANCMV2.wixproj" AdditionalProperties="Platform=x64" />
  61. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMV2\ANCMV2.wixproj" AdditionalProperties="Platform=x86" />
  62. <!-- Build the targeting pack installers -->
  63. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=x64" />
  64. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=x86" />
  65. <!-- This really shouldn't be here, but instead of harvesting from the intermediate/output directories, the targetting pack installer logic
  66. harvests from a zip of the reference assemblies. Producing it in each leg ends up with multiple targeting packs
  67. getting produced and the BAR will reject the build. Centralize building the targeting pack in the x86/x64 leg. -->
  68. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=arm64" />
  69. <!-- Build the SharedFramework installers -->
  70. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" AdditionalProperties="Platform=x64" />
  71. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" AdditionalProperties="Platform=x86" />
  72. <!-- Build the SharedFramework wixlib -->
  73. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=x64" />
  74. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=x86" />
  75. <!-- Windows hosting bundled -->
  76. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\WindowsHostingBundle\WindowsHostingBundle.wixproj" AdditionalProperties="Platform=x86" />
  77. </ItemGroup>
  78. <ItemGroup Condition=" '$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' == 'arm64' ">
  79. <!-- We don't build the targeting pack installer here because it's built in the x86/x64 leg.
  80. Instead we only provide the ARM64 SharedFramework MSI-->
  81. <!-- Build the SharedFramework wixlib -->
  82. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=arm64" />
  83. </ItemGroup>
  84. <ItemGroup Condition="'$(BuildInstallers)' == 'true' AND '$(TargetRuntimeIdentifier)' == 'linux-x64'">
  85. <ProjectToBuild Condition=" '$(LinuxInstallerType)' == 'deb' "
  86. Include="$(RepoRoot)src\Installers\Debian\**\*.*proj" />
  87. <ProjectToBuild Condition=" '$(LinuxInstallerType)' == 'rpm' "
  88. Include="$(RepoRoot)src\Installers\Rpm\**\*.*proj" />
  89. </ItemGroup>
  90. <ItemGroup Condition=" '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64') ">
  91. <NativeProjects Include="$(RepoRoot)src\**\*.vcxproj" Exclude="@(ProjectToExclude)" AdditionalProperties="Platform=x64" />
  92. <NativeProjects Include="$(RepoRoot)src\**\*.vcxproj" Exclude="@(ProjectToExclude)" AdditionalProperties="Platform=Win32" />
  93. </ItemGroup>
  94. <ItemGroup>
  95. <ProjectToBuild Condition=" $(BuildNative) " Include="@(NativeProjects)" Exclude="@(ProjectToExclude)" />
  96. <ProjectToExclude Condition=" !$(BuildNative) " Include="@(NativeProjects)" />
  97. <NodeJsProjects Include="
  98. $(RepoRoot)src\Components\Web.JS\Microsoft.AspNetCore.Components.Web.JS.npmproj;
  99. $(RepoRoot)src\SignalR\**\*.npmproj;
  100. $(RepoRoot)src\Middleware\**\*.npmproj;
  101. $(RepoRoot)src\JSInterop\**\*.npmproj;
  102. "
  103. RestoreInParallel="false"
  104. Exclude="@(ProjectToExclude)" />
  105. <ProjectToBuild Condition=" '$(BuildNodeJS)' == 'true'" Include="@(NodeJsProjects)" Exclude="@(ProjectToExclude)" />
  106. <ProjectToExclude Condition=" '$(BuildNodeJS)' != 'true'" Include="@(NodeJsProjects)" />
  107. <YarnMSBuildProjects Include="
  108. $(RepoRoot)src\Components\test\E2ETest\Microsoft.AspNetCore.Components.E2ETests.csproj;
  109. $(RepoRoot)src\Components\WebAssembly\Authentication.Msal\src\Microsoft.Authentication.WebAssembly.Msal.csproj;
  110. $(RepoRoot)src\Components\WebAssembly\WebAssembly.Authentication\src\Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj;
  111. "
  112. Exclude="@(ProjectToExclude)" />
  113. <ProjectToExclude Condition=" '$(DotNetBuildFromSource)' == 'true'" Include="@(YarnMSBuildProjects)" />
  114. <JavaProjects Include="$(RepoRoot)src\SignalR\**\*.javaproj"
  115. Exclude="@(ProjectToExclude)" />
  116. <ProjectToBuild Condition=" '$(BuildJava)' == 'true'" Include="@(JavaProjects)" Exclude="@(ProjectToExclude)" />
  117. <ProjectToExclude Condition=" '$(BuildJava)' != 'true'" Include="@(JavaProjects)" />
  118. <!-- These interop test projects can only be restored and built after the shared framework is built -->
  119. <InteropProjects Include="$(RepoRoot)src\Grpc\**\*.csproj"
  120. Exclude="@(ProjectToExclude)" />
  121. <ProjectToBuild Condition=" '$(BuildInteropProjects)' == 'true'" Include="@(InteropProjects)" Exclude="@(ProjectToExclude)" />
  122. <ProjectToExclude Condition=" '$(BuildInteropProjects)' != 'true'" Include="@(InteropProjects)" />
  123. <!--
  124. Use caution to avoid deep recursion. If the globbing pattern picks up something which exceeds MAX_PATH,
  125. the entire pattern will silently fail to evaluate correctly.
  126. -->
  127. <DotNetProjects Include="
  128. $(RepoRoot)src\Framework\App.Ref\src\Microsoft.AspNetCore.App.Ref.csproj;
  129. $(RepoRoot)src\Framework\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj;
  130. $(RepoRoot)src\Framework\App.Ref.Internal\src\Microsoft.AspNetCore.App.Ref.Internal.csproj;
  131. $(RepoRoot)src\Framework\test\Microsoft.AspNetCore.App.UnitTests.csproj;
  132. $(RepoRoot)src\Caching\**\*.*proj;
  133. $(RepoRoot)src\DefaultBuilder\**\*.*proj;
  134. $(RepoRoot)src\Features\JsonPatch\**\*.*proj;
  135. $(RepoRoot)src\DataProtection\**\*.*proj;
  136. $(RepoRoot)src\Antiforgery\**\*.*proj;
  137. $(RepoRoot)src\Hosting\**\*.*proj;
  138. $(RepoRoot)src\Http\**\*.*proj;
  139. $(RepoRoot)src\HttpClientFactory\**\*.*proj;
  140. $(RepoRoot)src\Html.Abstractions\*.*proj;
  141. $(RepoRoot)src\Identity\**\*.*proj;
  142. $(RepoRoot)src\Servers\**\*.csproj;
  143. $(RepoRoot)src\Security\**\*.*proj;
  144. $(RepoRoot)src\SiteExtensions\Microsoft.Web.Xdt.Extensions\**\*.csproj;
  145. $(RepoRoot)src\SiteExtensions\LoggingAggregate\test\**\*.csproj;
  146. $(RepoRoot)src\Shared\**\*.*proj;
  147. $(RepoRoot)src\Tools\**\*.*proj;
  148. $(RepoRoot)src\Logging.AzureAppServices\**\src\*.csproj;
  149. $(RepoRoot)src\Middleware\**\*.csproj;
  150. $(RepoRoot)src\Razor\**\*.*proj;
  151. $(RepoRoot)src\Mvc\**\*.*proj;
  152. $(RepoRoot)src\Azure\**\*.*proj;
  153. $(RepoRoot)src\SignalR\**\*.csproj;
  154. $(RepoRoot)src\Components\**\*.csproj;
  155. $(RepoRoot)src\Analyzers\**\*.csproj;
  156. $(RepoRoot)src\FileProviders\**\*.csproj;
  157. $(RepoRoot)src\Configuration.KeyPerFile\**\*.csproj;
  158. $(RepoRoot)src\Localization\**\*.csproj;
  159. $(RepoRoot)src\ObjectPool\**\*.csproj;
  160. $(RepoRoot)src\JSInterop\**\*.csproj;
  161. $(RepoRoot)src\WebEncoders\**\*.csproj;
  162. $(RepoRoot)src\HealthChecks\**\*.csproj;
  163. $(RepoRoot)src\Testing\**\*.csproj;
  164. $(RepoRoot)src\ProjectTemplates\*\*.csproj;
  165. $(RepoRoot)src\ProjectTemplates\testassets\*\*.csproj;
  166. "
  167. Exclude="
  168. @(ProjectToBuild);
  169. @(ProjectToExclude);
  170. $(RepoRoot)**\node_modules\**\*;
  171. $(RepoRoot)**\bin\**\*;
  172. $(RepoRoot)**\obj\**\*;"
  173. Condition=" '$(BuildMainlyReferenceProviders)' != 'true' " />
  174. <DotNetProjects Include="
  175. $(RepoRoot)src\Caching\**\src\*.csproj;
  176. $(RepoRoot)src\DefaultBuilder\**\src\*.csproj;
  177. $(RepoRoot)src\Features\JsonPatch\**\src\*.csproj;
  178. $(RepoRoot)src\DataProtection\**\src\*.csproj;
  179. $(RepoRoot)src\Antiforgery\**\src\*.csproj;
  180. $(RepoRoot)src\Hosting\**\src\*.csproj;
  181. $(RepoRoot)src\Http\**\src\*.csproj;
  182. $(RepoRoot)src\HttpClientFactory\**\src\*.csproj;
  183. $(RepoRoot)src\Html.Abstractions\src\*.csproj;
  184. $(RepoRoot)src\Identity\**\src\*.csproj;
  185. $(RepoRoot)src\Servers\**\src\*.csproj;
  186. $(RepoRoot)src\Security\**\src\*.csproj;
  187. $(RepoRoot)src\SiteExtensions\**\src\*.csproj;
  188. $(RepoRoot)src\Tools\**\src\*.csproj;
  189. $(RepoRoot)src\Logging.AzureAppServices\**\src\*.csproj;
  190. $(RepoRoot)src\Middleware\**\src\*.csproj;
  191. $(RepoRoot)src\Razor\**\src\*.csproj;
  192. $(RepoRoot)src\Mvc\**\src\*.csproj;
  193. $(RepoRoot)src\Azure\**\src\*.csproj;
  194. $(RepoRoot)src\SignalR\**\src\*.csproj;
  195. $(RepoRoot)src\Components\**\src\*.csproj;
  196. $(RepoRoot)src\FileProviders\**\src\*.csproj;
  197. $(RepoRoot)src\Configuration.KeyPerFile\**\src\*.csproj;
  198. $(RepoRoot)src\Localization\**\src\*.csproj;
  199. $(RepoRoot)src\ObjectPool\**\src\*.csproj;
  200. $(RepoRoot)src\JSInterop\**\src\*.csproj;
  201. $(RepoRoot)src\WebEncoders\**\src\*.csproj;
  202. $(RepoRoot)src\HealthChecks\**\src\*.csproj;
  203. $(RepoRoot)src\Testing\**\src\*.csproj;
  204. "
  205. Exclude="
  206. @(ProjectToBuild);
  207. @(ProjectToExclude);
  208. $(RepoRoot)**\node_modules\**\*;
  209. $(RepoRoot)**\bin\**\*;
  210. $(RepoRoot)**\obj\**\*;"
  211. Condition=" '$(BuildMainlyReferenceProviders)' == 'true' " />
  212. <ProjectToBuild Condition=" '$(BuildManaged)' == 'true'" Include="@(DotNetProjects)" Exclude="@(ProjectToExclude)" />
  213. <ProjectToExclude Condition=" '$(BuildManaged)' != 'true'" Include="@(DotNetProjects)" />
  214. </ItemGroup>
  215. </Otherwise>
  216. </Choose>
  217. </Project>