Build.props 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <Project>
  2. <Import Project="Common.props" />
  3. <!--
  4. @(RequiresDelayedBuild) projects can be extended many ways but this isn't fully automated because the new
  5. projects likely aren't referenced initially. To add new projects, edit RequiresDelayedBuildProjects.props
  6. manually, update the $(BuildMainlyReferenceProviders)' == 'true' item group near the bottom of this file,
  7. or edit BuildAfterTargetingPack.csproj. Then run GenerateProjectList.ps1 (even for the first option to ensure
  8. the format is correct) and undo any temporary changes. When complete, only BuildAfterTargetingPack.csproj and
  9. other @(RequiresDelayedBuild) projects should mention projects listed in RequiresDelayedBuildProjects.props.
  10. -->
  11. <Import Project="RequiresDelayedBuildProjects.props" />
  12. <!-- These projects are always excluded, even when -projects is specified on command line. -->
  13. <ItemGroup>
  14. <!-- Explicitly excluded projects -->
  15. <ProjectToExclude Include="$(ProjectToExclude)" />
  16. <!-- These projects use 'legacy' csproj, which is not supported by dotnet-msbuild. -->
  17. <ProjectToExclude Include="
  18. $(RepoRoot)src\Servers\HttpSys\samples\TestClient\TestClient.csproj;
  19. $(RepoRoot)src\Middleware\WebSockets\samples\TestServer\WebSockets.TestServer.csproj;
  20. "
  21. Condition=" '$(MSBuildRuntimeType)' == 'Core' " />
  22. <!-- Exclude the websockets samples for now because they use classic .csproj, which is not yet supported in our build. -->
  23. <ProjectToExclude Include="$(RepoRoot)src\Middleware\WebSockets\samples\**\*.csproj" />
  24. <!-- These projects are meant to be referenced only by tests or via BuildAfterTargetingPack.csproj. -->
  25. <ProjectToExclude
  26. Include="$(RepoRoot)src\**\testassets\**\*.*proj;
  27. @(RequiresDelayedBuild);
  28. "
  29. Exclude="$(RepoRoot)src\Components\WebAssembly\testassets\WasmLinkerTest\*.*proj;
  30. $(RepoRoot)src\Components\WebView\Samples\PhotinoPlatform\testassets\PhotinoTestApp\*.*proj;
  31. $(RepoRoot)src\Http\Routing\test\testassets\RoutingSandbox\*.*proj;
  32. $(RepoRoot)src\Security\Authentication\Negotiate\test\testassets\Negotiate.Client\*.*proj;
  33. $(RepoRoot)src\Security\Authentication\Negotiate\test\testassets\Negotiate.Server\*.*proj;
  34. " />
  35. <!-- These projects are not meant to be built in this repo. In the Installers case, must explicitly opt in. -->
  36. <ProjectToExclude Include="
  37. $(RepoRoot)src\submodules\googletest\**\*.*proj;
  38. $(RepoRoot)src\submodules\MessagePack-CSharp\**\*.*proj;
  39. $(RepoRoot)src\Components\Web.JS\node_modules\**\*.*proj;
  40. $(RepoRoot)src\Installers\**\*.*proj;
  41. $(RepoRoot)src\ProjectTemplates\Web.ProjectTemplates\content\**\*.*proj;
  42. $(RepoRoot)src\SignalR\clients\ts\**\node_modules\**\*.*proj;
  43. " />
  44. <!-- Exclude the benchmarks because they use <PackageReference>. -->
  45. <ProjectToExclude Include="
  46. $(RepoRoot)src\Components\benchmarkapps\BlazingPizza.Server\**\*.csproj;
  47. $(RepoRoot)src\Mvc\perf\**\*.csproj;
  48. $(RepoRoot)src\Servers\Kestrel\perf\PlatformBenchmarks\**\*.csproj;
  49. $(RepoRoot)src\SignalR\perf\benchmarkapps\**\*.csproj;
  50. " />
  51. </ItemGroup>
  52. <Choose>
  53. <!-- Project selection can be overridden on the command line by passing in -projects. -->
  54. <When Condition="'$(ProjectToBuild)' != ''">
  55. <ItemGroup>
  56. <ProjectToBuild Include="$(ProjectToBuild)"
  57. Exclude="@(ProjectToExclude);$(RepoRoot)**\bin\**\*;$(RepoRoot)**\obj\**\*">
  58. <BuildInParallel Condition=" '%(Extension)' == '.nodeproj' OR '%(Extension)' == '.vcxproj' ">false</BuildInParallel>
  59. <RestoreInParallel Condition=" '%(Extension)' == '.nodeproj' ">false</RestoreInParallel>
  60. <!-- Also do not build in parallel w/in npm projects. -->
  61. <AdditionalProperties Condition=" '%(Extension)' == '.nodeproj' OR '%(Extension)' == '.vcxproj' ">BuildInParallel=false</AdditionalProperties>
  62. </ProjectToBuild>
  63. </ItemGroup>
  64. </When>
  65. <Otherwise>
  66. <!-- BuildNative -->
  67. <ItemGroup Condition=" '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64' OR '$(TargetArchitecture)' == 'arm64') ">
  68. <NativeProjects Include="$(RepoRoot)src\**\*.vcxproj" Exclude="@(ProjectToExclude)" AdditionalProperties="Platform=x64" />
  69. <NativeProjects Include="$(RepoRoot)src\**\*.vcxproj" Exclude="@(ProjectToExclude)" AdditionalProperties="Platform=Win32" />
  70. <NativeProjects Include="$(RepoRoot)src\**\*.vcxproj" Exclude="@(ProjectToExclude)" AdditionalProperties="Platform=arm64" />
  71. </ItemGroup>
  72. <ItemGroup>
  73. <ProjectToBuild Condition=" $(BuildNative) " Include="@(NativeProjects)" Exclude="@(ProjectToExclude)" BuildStep="native" />
  74. <ProjectToExclude Condition=" !$(BuildNative) " Include="@(NativeProjects)" />
  75. </ItemGroup>
  76. <!-- BuildNode -->
  77. <ItemGroup>
  78. <NodeJsProjects
  79. Include="$(RepoRoot)eng\Npm.Workspace.nodeproj;
  80. $(RepoRoot)eng\Npm.Workspace.FunctionalTests.nodeproj;"
  81. AdditionalProperties="BuildInParallel=false"
  82. BuildInParallel="false"
  83. RestoreInParallel="false"
  84. Exclude="@(ProjectToExclude)" />
  85. <ExplicitRequiresDelay Include="$(RepoRoot)eng\Npm.Workspace.FunctionalTests.nodeproj" />
  86. <ProjectToBuild Condition=" '$(BuildNodeJS)' == 'true'" Include="@(NodeJsProjects)" Exclude="@(ProjectToExclude)" BuildStep="node" />
  87. <ProjectToExclude Condition=" '$(BuildNodeJS)' != 'true'" Include="@(NodeJsProjects)" />
  88. </ItemGroup>
  89. <!-- BuildJava -->
  90. <ItemGroup>
  91. <JavaProjects Include="$(RepoRoot)src\SignalR\**\*.javaproj"
  92. Exclude="@(ProjectToExclude)" />
  93. <ProjectToBuild Condition=" '$(BuildJava)' == 'true'" Include="@(JavaProjects)" Exclude="@(ProjectToExclude)" BuildStep="managed" />
  94. <ProjectToExclude Condition=" '$(BuildJava)' != 'true'" Include="@(JavaProjects)" />
  95. </ItemGroup>
  96. <!-- BuildManaged (runs in parallel with BuildJava) -->
  97. <ItemGroup>
  98. <!--
  99. Use caution to avoid deep recursion. If the globbing pattern picks up something which exceeds MAX_PATH,
  100. the entire pattern will silently fail to evaluate correctly.
  101. -->
  102. <DotNetProjects Include="
  103. $(RepoRoot)src\Framework\App.Ref\src\Microsoft.AspNetCore.App.Ref.sfxproj;
  104. $(RepoRoot)src\Framework\App.Ref.Internal\src\Microsoft.AspNetCore.App.Ref.Internal.csproj;
  105. $(RepoRoot)src\Framework\App.Runtime\src\aspnetcore-runtime.proj;
  106. $(RepoRoot)src\Framework\App.Runtime\src\aspnetcore-runtime-composite.proj;
  107. $(RepoRoot)src\Framework\App.Runtime\src\aspnetcore-base-runtime.proj;
  108. $(RepoRoot)src\Framework\AspNetCoreAnalyzers\test\Microsoft.AspNetCore.App.Analyzers.Test.csproj;
  109. $(RepoRoot)src\Framework\test\Microsoft.AspNetCore.App.UnitTests.csproj;
  110. $(RepoRoot)src\Assets\**\*.*proj;
  111. $(RepoRoot)src\Caching\**\*.*proj;
  112. $(RepoRoot)src\DefaultBuilder\**\*.*proj;
  113. $(RepoRoot)src\Features\JsonPatch\**\*.*proj;
  114. $(RepoRoot)src\DataProtection\**\*.*proj;
  115. $(RepoRoot)src\Antiforgery\**\*.*proj;
  116. $(RepoRoot)src\Hosting\**\*.*proj;
  117. $(RepoRoot)src\Http\**\*.*proj;
  118. $(RepoRoot)src\HttpClientFactory\**\*.*proj;
  119. $(RepoRoot)src\Html.Abstractions\**\*.*proj;
  120. $(RepoRoot)src\Identity\**\*.*proj;
  121. $(RepoRoot)src\Servers\**\*.csproj;
  122. $(RepoRoot)src\Security\**\*.*proj;
  123. $(RepoRoot)src\SiteExtensions\Microsoft.Web.Xdt.Extensions\**\*.csproj;
  124. $(RepoRoot)src\SiteExtensions\LoggingAggregate\test\**\*.csproj;
  125. $(RepoRoot)src\Shared\**\*.*proj;
  126. $(RepoRoot)src\Tools\**\*.*proj;
  127. $(RepoRoot)src\Logging.AzureAppServices\**\src\*.csproj;
  128. $(RepoRoot)src\Middleware\**\*.csproj;
  129. $(RepoRoot)src\Razor\**\*.*proj;
  130. $(RepoRoot)src\Mvc\**\*.*proj;
  131. $(RepoRoot)src\Azure\**\*.*proj;
  132. $(RepoRoot)src\SignalR\**\*.csproj;
  133. $(RepoRoot)src\StaticAssets\**\*.csproj;
  134. $(RepoRoot)src\Components\**\*.csproj;
  135. $(RepoRoot)src\Analyzers\**\*.csproj;
  136. $(RepoRoot)src\FileProviders\**\*.csproj;
  137. $(RepoRoot)src\Configuration.KeyPerFile\**\*.csproj;
  138. $(RepoRoot)src\Localization\**\*.csproj;
  139. $(RepoRoot)src\ObjectPool\**\*.csproj;
  140. $(RepoRoot)src\JSInterop\**\*.csproj;
  141. $(RepoRoot)src\WebEncoders\**\*.csproj;
  142. $(RepoRoot)src\HealthChecks\**\*.csproj;
  143. $(RepoRoot)src\Testing\**\*.csproj;
  144. $(RepoRoot)src\Grpc\**\*.csproj;
  145. $(RepoRoot)src\ProjectTemplates\**\*.csproj;
  146. $(RepoRoot)src\Extensions\**\*.csproj;
  147. $(RepoRoot)src\BuildAfterTargetingPack\*.csproj;
  148. $(RepoRoot)src\OpenApi\**\*.csproj;
  149. $(RepoRoot)eng\tools\HelixTestRunner\HelixTestRunner.csproj;
  150. "
  151. Exclude="
  152. @(ProjectToBuild);
  153. @(ProjectToExclude);
  154. $(RepoRoot)**\node_modules\**\*;
  155. $(RepoRoot)**\bin\**\*;
  156. $(RepoRoot)**\obj\**\*;"
  157. Condition=" '$(BuildMainlyReferenceProviders)' != 'true' " />
  158. <DotNetProjects Include="
  159. $(RepoRoot)src\Assets\**\*.*proj;
  160. $(RepoRoot)src\Caching\**\src\*.csproj;
  161. $(RepoRoot)src\DefaultBuilder\**\src\*.csproj;
  162. $(RepoRoot)src\Features\JsonPatch\**\src\*.csproj;
  163. $(RepoRoot)src\DataProtection\**\src\*.csproj;
  164. $(RepoRoot)src\Antiforgery\**\src\*.csproj;
  165. $(RepoRoot)src\Hosting\**\src\*.csproj;
  166. $(RepoRoot)src\Http\**\src\*.csproj;
  167. $(RepoRoot)src\HttpClientFactory\**\src\*.csproj;
  168. $(RepoRoot)src\Html.Abstractions\src\*.csproj;
  169. $(RepoRoot)src\Identity\**\src\*.csproj;
  170. $(RepoRoot)src\Servers\**\src\*.csproj;
  171. $(RepoRoot)src\Security\**\src\*.csproj;
  172. $(RepoRoot)src\SiteExtensions\**\src\*.csproj;
  173. $(RepoRoot)src\Tools\**\src\*.csproj;
  174. $(RepoRoot)src\Logging.AzureAppServices\**\src\*.csproj;
  175. $(RepoRoot)src\Middleware\**\src\*.csproj;
  176. $(RepoRoot)src\Razor\**\src\*.csproj;
  177. $(RepoRoot)src\Mvc\**\src\*.csproj;
  178. $(RepoRoot)src\Azure\**\src\*.csproj;
  179. $(RepoRoot)src\SignalR\**\src\*.csproj;
  180. $(RepoRoot)src\StaticAssets\src\*.csproj;
  181. $(RepoRoot)src\Components\**\src\*.csproj;
  182. $(RepoRoot)src\FileProviders\**\src\*.csproj;
  183. $(RepoRoot)src\Configuration.KeyPerFile\**\src\*.csproj;
  184. $(RepoRoot)src\Localization\**\src\*.csproj;
  185. $(RepoRoot)src\ObjectPool\**\src\*.csproj;
  186. $(RepoRoot)src\JSInterop\**\src\*.csproj;
  187. $(RepoRoot)src\WebEncoders\**\src\*.csproj;
  188. $(RepoRoot)src\HealthChecks\**\src\*.csproj;
  189. $(RepoRoot)src\Testing\**\src\*.csproj;
  190. $(RepoRoot)src\Extensions\**\src\*.csproj;
  191. $(RepoRoot)src\BuildAfterTargetingPack\*.csproj;
  192. $(RepoRoot)src\OpenApi\**\src\*.csproj;
  193. "
  194. Exclude="
  195. @(ProjectToBuild);
  196. @(ProjectToExclude);
  197. $(RepoRoot)**\node_modules\**\*;
  198. $(RepoRoot)**\bin\**\*;
  199. $(RepoRoot)**\obj\**\*;"
  200. Condition=" '$(BuildMainlyReferenceProviders)' == 'true' " />
  201. <ProjectToBuild Condition=" '$(BuildManaged)' == 'true'" Include="@(DotNetProjects)" Exclude="@(ProjectToExclude)" BuildStep="managed" />
  202. <ProjectToExclude Condition=" '$(BuildManaged)' != 'true'" Include="@(DotNetProjects)" />
  203. </ItemGroup>
  204. <!-- BuildInstallers -->
  205. <PropertyGroup>
  206. <_BuildWindowsInstallers Condition="'$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64' OR '$(TargetArchitecture)' == 'arm64') ">true</_BuildWindowsInstallers>
  207. <_VcxTargetPlatform Condition="'$(TargetArchitecture)' == 'x86'">Win32</_VcxTargetPlatform>
  208. <_VcxTargetPlatform Condition="'$(TargetArchitecture)' == 'x64'">x64</_VcxTargetPlatform>
  209. <_VcxTargetPlatform Condition="'$(TargetArchitecture)' == 'arm64'">ARM64</_VcxTargetPlatform>
  210. </PropertyGroup>
  211. <ItemGroup Condition="'$(DotNetBuild)' != 'true' and '$(_BuildWindowsInstallers)' == 'true' ">
  212. <!-- Build the ANCM custom action -->
  213. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=x64" />
  214. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=Win32" />
  215. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=ARM64" />
  216. <!-- Build the ANCM msis -->
  217. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj" AdditionalProperties="Platform=x64" />
  218. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj" AdditionalProperties="Platform=x86" />
  219. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj" AdditionalProperties="Platform=arm64" />
  220. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMV2\ANCMV2.wixproj" AdditionalProperties="Platform=x64" />
  221. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMV2\ANCMV2.wixproj" AdditionalProperties="Platform=x86" />
  222. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMV2\ANCMV2.wixproj" AdditionalProperties="Platform=arm64" />
  223. <!-- Build the targeting pack installers -->
  224. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=x64" />
  225. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=x86" />
  226. <!-- This really shouldn't be here, but instead of harvesting from the intermediate/output directories, the targeting pack installer logic
  227. harvests from a zip of the reference assemblies. Producing it in each leg ends up with multiple targeting packs
  228. getting produced and the BAR will reject the build. Centralize building the targeting pack in the x86/x64 leg. -->
  229. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=arm64" />
  230. <!-- Build the SharedFramework installers -->
  231. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" AdditionalProperties="Platform=x64" />
  232. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" AdditionalProperties="Platform=x86" />
  233. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" AdditionalProperties="Platform=arm64" />
  234. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\SharedFramework\SharedFramework.wixproj" AdditionalProperties="Platform=x64" />
  235. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\SharedFramework\SharedFramework.wixproj" AdditionalProperties="Platform=x86" />
  236. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\SharedFramework\SharedFramework.wixproj" AdditionalProperties="Platform=arm64" />
  237. <!-- Windows hosting bundle -->
  238. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\WindowsHostingBundle\WindowsHostingBundle.wixproj" AdditionalProperties="Platform=x86" />
  239. </ItemGroup>
  240. <!-- In a vertical build, only build the MSIs for the current vertical in the first pass and build the hosting bundle in the second pass -->
  241. <ItemGroup Condition="'$(DotNetBuild)' == 'true' and ('$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1') and '$(_BuildWindowsInstallers)' == 'true'">
  242. <!-- Build the ANCM custom action -->
  243. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=$(_VcxTargetPlatform)" />
  244. <!-- Build the ANCM msis -->
  245. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj" AdditionalProperties="Platform=$(TargetArchitecture)" />
  246. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMV2\ANCMV2.wixproj" AdditionalProperties="Platform=$(TargetArchitecture)" />
  247. <!-- Build the targeting pack installers -->
  248. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=$(TargetArchitecture)" />
  249. <!-- Build the SharedFramework installers -->
  250. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" AdditionalProperties="Platform=$(TargetArchitecture)" />
  251. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\SharedFramework\SharedFramework.wixproj" AdditionalProperties="Platform=$(TargetArchitecture)" />
  252. </ItemGroup>
  253. <ItemGroup Condition="'$(DotNetBuild)' == 'true' and ('$(DotNetBuildPass)' == '2') and '$(TargetOsName)' == 'win' and '$(TargetArchitecture)' == 'x64'">
  254. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\WindowsHostingBundle\WindowsHostingBundle.wixproj" AdditionalProperties="Platform=x86" />
  255. </ItemGroup>
  256. <ItemGroup Condition="'$(TargetRuntimeIdentifier)' == 'linux-x64' OR '$(TargetRuntimeIdentifier)' == 'linux-arm64'">
  257. <InstallerProject Condition=" '$(LinuxInstallerType)' == 'deb' "
  258. Include="$(RepoRoot)src\Installers\Debian\**\*.*proj" />
  259. <InstallerProject Condition=" '$(LinuxInstallerType)' == 'rpm' "
  260. Include="$(RepoRoot)src\Installers\Rpm\**\*.*proj" />
  261. </ItemGroup>
  262. <ItemGroup>
  263. <ProjectToBuild Condition=" '$(BuildInstallers)' == 'true'" Include="@(InstallerProject)" BuildStep="installer" />
  264. </ItemGroup>
  265. </Otherwise>
  266. </Choose>
  267. </Project>