Build.props 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  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. <!-- In the .NET product build mode, don't build the native ANCM bits in pass 1 -->
  52. <ProjectToExclude Include="
  53. $(RepoRoot)src\Installers\**\*.vcxproj;
  54. "
  55. Condition=" '$(BuildNative)' == 'true' and '$(DotNetBuild)' == 'true' and ('$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1') " />
  56. <!-- This project requires inputs from x64, x86, and arm64 on Windows - therefore in the .NET product build mode, build it in pass 2 -->
  57. <ProjectToExclude Include="
  58. $(RepoRoot)src\Servers\IIS/IntegrationTesting.IIS\src\Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj;
  59. "
  60. Condition=" '$(TargetOsName)' == 'win' and '$(DotNetBuild)' == 'true' and ('$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1') " />
  61. </ItemGroup>
  62. <Choose>
  63. <!-- Project selection can be overridden on the command line by passing in -projects. -->
  64. <When Condition="'$(ProjectToBuild)' != '' and '$(DotNetBuildPass)' != '2'">
  65. <ItemGroup>
  66. <ProjectToBuild Include="$(ProjectToBuild)"
  67. Exclude="@(ProjectToExclude);$(RepoRoot)**\bin\**\*;$(RepoRoot)**\obj\**\*">
  68. <BuildInParallel Condition=" '%(Extension)' == '.nodeproj' OR '%(Extension)' == '.vcxproj' ">false</BuildInParallel>
  69. <RestoreInParallel Condition=" '%(Extension)' == '.nodeproj' ">false</RestoreInParallel>
  70. <!-- Also do not build in parallel w/in npm projects. -->
  71. <AdditionalProperties Condition=" '%(Extension)' == '.nodeproj' OR '%(Extension)' == '.vcxproj' ">BuildInParallel=false</AdditionalProperties>
  72. </ProjectToBuild>
  73. </ItemGroup>
  74. </When>
  75. <!-- Projects to build in .NET product build pass 2 -->
  76. <When Condition="'$(DotNetBuildPass)' == '2'">
  77. <ItemGroup Condition=" '$(DotNetBuild)' == 'true' AND '$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' == 'x64' ">
  78. <!-- Build Hosting Bundle -->
  79. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\WindowsHostingBundle\WindowsHostingBundle.wixproj">
  80. <AdditionalProperties>Platform=x86</AdditionalProperties>
  81. <DotNetBuildPass>$(DotNetBuildPass)</DotNetBuildPass>
  82. </ProjectToBuild>
  83. <ProjectToBuild Include="$(RepoRoot)src\Servers\IIS/IntegrationTesting.IIS\src\Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj" >
  84. <DotNetBuildPass>$(DotNetBuildPass)</DotNetBuildPass>
  85. </ProjectToBuild>
  86. <!-- Build SiteExtensions -->
  87. <ProjectToBuild Include="$(RepoRoot)src\SiteExtensions\LoggingAggregate\src\Microsoft.AspNetCore.AzureAppServices.SiteExtension\Microsoft.AspNetCore.AzureAppServices.SiteExtension.csproj">
  88. <DotNetBuildPass>$(DotNetBuildPass)</DotNetBuildPass>
  89. </ProjectToBuild>
  90. </ItemGroup>
  91. </When>
  92. <Otherwise>
  93. <!-- BuildNative -->
  94. <ItemGroup Condition=" '$(TargetOsName)' == 'win' AND '$(DotNetBuild)' == 'true' ">
  95. <NativeProjects Condition="'$(TargetArchitecture)' == 'x64'" Include="$(RepoRoot)src\**\*.vcxproj" Exclude="@(ProjectToExclude)" AdditionalProperties="Platform=x64" />
  96. <NativeProjects Condition="'$(TargetArchitecture)' == 'x86'" Include="$(RepoRoot)src\**\*.vcxproj" Exclude="@(ProjectToExclude)" AdditionalProperties="Platform=Win32" />
  97. <NativeProjects Condition="'$(TargetArchitecture)' == 'arm64'" Include="$(RepoRoot)src\**\*.vcxproj" Exclude="@(ProjectToExclude)" AdditionalProperties="Platform=arm64" />
  98. </ItemGroup>
  99. <ItemGroup Condition=" '$(TargetOsName)' == 'win' AND '$(DotNetBuild)' != 'true' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64' OR '$(TargetArchitecture)' == 'arm64') ">
  100. <NativeProjects Include="$(RepoRoot)src\**\*.vcxproj" Exclude="@(ProjectToExclude)" AdditionalProperties="Platform=x64" />
  101. <NativeProjects Include="$(RepoRoot)src\**\*.vcxproj" Exclude="@(ProjectToExclude)" AdditionalProperties="Platform=Win32" />
  102. <NativeProjects Include="$(RepoRoot)src\**\*.vcxproj" Exclude="@(ProjectToExclude)" AdditionalProperties="Platform=arm64" />
  103. </ItemGroup>
  104. <ItemGroup>
  105. <ProjectToBuild Condition=" $(BuildNative) " Include="@(NativeProjects)" Exclude="@(ProjectToExclude)" BuildStep="native" />
  106. <ProjectToExclude Condition=" !$(BuildNative) " Include="@(NativeProjects)" />
  107. </ItemGroup>
  108. <!-- BuildNode -->
  109. <ItemGroup>
  110. <NodeJsProjects
  111. Include="$(RepoRoot)eng\Npm.Workspace.nodeproj;
  112. $(RepoRoot)eng\Npm.Workspace.FunctionalTests.nodeproj;"
  113. AdditionalProperties="BuildInParallel=false"
  114. BuildInParallel="false"
  115. RestoreInParallel="false"
  116. Exclude="@(ProjectToExclude)" />
  117. <ExplicitRequiresDelay Include="$(RepoRoot)eng\Npm.Workspace.FunctionalTests.nodeproj" />
  118. <ProjectToBuild Condition=" '$(BuildNodeJS)' == 'true'" Include="@(NodeJsProjects)" Exclude="@(ProjectToExclude)" BuildStep="node" />
  119. <ProjectToExclude Condition=" '$(BuildNodeJS)' != 'true'" Include="@(NodeJsProjects)" />
  120. </ItemGroup>
  121. <!-- BuildJava -->
  122. <ItemGroup>
  123. <JavaProjects Include="$(RepoRoot)src\SignalR\**\*.javaproj"
  124. Exclude="@(ProjectToExclude)" />
  125. <ProjectToBuild Condition=" '$(BuildJava)' == 'true'" Include="@(JavaProjects)" Exclude="@(ProjectToExclude)" BuildStep="managed" />
  126. <ProjectToExclude Condition=" '$(BuildJava)' != 'true'" Include="@(JavaProjects)" />
  127. </ItemGroup>
  128. <!-- BuildManaged (runs in parallel with BuildJava) -->
  129. <ItemGroup>
  130. <!--
  131. Use caution to avoid deep recursion. If the globbing pattern picks up something which exceeds MAX_PATH,
  132. the entire pattern will silently fail to evaluate correctly.
  133. -->
  134. <DotNetProjects Include="
  135. $(RepoRoot)src\Framework\App.Ref\src\Microsoft.AspNetCore.App.Ref.sfxproj;
  136. $(RepoRoot)src\Framework\App.Ref.Internal\src\Microsoft.AspNetCore.App.Ref.Internal.csproj;
  137. $(RepoRoot)src\Framework\App.Runtime\src\aspnetcore-runtime.proj;
  138. $(RepoRoot)src\Framework\App.Runtime\src\aspnetcore-runtime-composite.proj;
  139. $(RepoRoot)src\Framework\App.Runtime\src\aspnetcore-base-runtime.proj;
  140. $(RepoRoot)src\Framework\App.Runtime\bundle\aspnetcore-runtime-bundle.bundleproj;
  141. $(RepoRoot)src\Framework\AspNetCoreAnalyzers\test\Microsoft.AspNetCore.App.Analyzers.Test.csproj;
  142. $(RepoRoot)src\Framework\test\Microsoft.AspNetCore.App.UnitTests.csproj;
  143. $(RepoRoot)src\Assets\**\*.*proj;
  144. $(RepoRoot)src\Caching\**\*.*proj;
  145. $(RepoRoot)src\DefaultBuilder\**\*.*proj;
  146. $(RepoRoot)src\Features\**\*.*proj;
  147. $(RepoRoot)src\DataProtection\**\*.*proj;
  148. $(RepoRoot)src\Antiforgery\**\*.*proj;
  149. $(RepoRoot)src\Hosting\**\*.*proj;
  150. $(RepoRoot)src\Http\**\*.*proj;
  151. $(RepoRoot)src\HttpClientFactory\**\*.*proj;
  152. $(RepoRoot)src\Html.Abstractions\**\*.*proj;
  153. $(RepoRoot)src\Identity\**\*.*proj;
  154. $(RepoRoot)src\Servers\**\*.csproj;
  155. $(RepoRoot)src\Security\**\*.*proj;
  156. $(RepoRoot)src\SiteExtensions\Microsoft.Web.Xdt.Extensions\**\*.csproj;
  157. $(RepoRoot)src\SiteExtensions\LoggingAggregate\test\**\*.csproj;
  158. $(RepoRoot)src\Shared\**\*.*proj;
  159. $(RepoRoot)src\Tools\**\*.*proj;
  160. $(RepoRoot)src\Logging.AzureAppServices\**\src\*.csproj;
  161. $(RepoRoot)src\Middleware\**\*.csproj;
  162. $(RepoRoot)src\Razor\**\*.*proj;
  163. $(RepoRoot)src\Mvc\**\*.*proj;
  164. $(RepoRoot)src\Azure\**\*.*proj;
  165. $(RepoRoot)src\SignalR\**\*.csproj;
  166. $(RepoRoot)src\StaticAssets\**\*.csproj;
  167. $(RepoRoot)src\Components\**\*.csproj;
  168. $(RepoRoot)src\Analyzers\**\*.csproj;
  169. $(RepoRoot)src\FileProviders\**\*.csproj;
  170. $(RepoRoot)src\Configuration.KeyPerFile\**\*.csproj;
  171. $(RepoRoot)src\Localization\**\*.csproj;
  172. $(RepoRoot)src\ObjectPool\**\*.csproj;
  173. $(RepoRoot)src\JSInterop\**\*.csproj;
  174. $(RepoRoot)src\WebEncoders\**\*.csproj;
  175. $(RepoRoot)src\HealthChecks\**\*.csproj;
  176. $(RepoRoot)src\Testing\**\*.csproj;
  177. $(RepoRoot)src\Grpc\**\*.csproj;
  178. $(RepoRoot)src\ProjectTemplates\**\*.csproj;
  179. $(RepoRoot)src\Extensions\**\*.csproj;
  180. $(RepoRoot)src\BuildAfterTargetingPack\*.csproj;
  181. $(RepoRoot)src\OpenApi\**\*.csproj;
  182. $(RepoRoot)eng\tools\HelixTestRunner\HelixTestRunner.csproj;
  183. "
  184. Exclude="
  185. @(ProjectToBuild);
  186. @(ProjectToExclude);
  187. $(RepoRoot)**\node_modules\**\*;
  188. $(RepoRoot)**\bin\**\*;
  189. $(RepoRoot)**\obj\**\*;"
  190. Condition=" '$(BuildMainlyReferenceProviders)' != 'true' " />
  191. <DotNetProjects Include="
  192. $(RepoRoot)src\Assets\**\*.*proj;
  193. $(RepoRoot)src\Caching\**\src\*.csproj;
  194. $(RepoRoot)src\DefaultBuilder\**\src\*.csproj;
  195. $(RepoRoot)src\Features\**\src\*.csproj;
  196. $(RepoRoot)src\DataProtection\**\src\*.csproj;
  197. $(RepoRoot)src\Antiforgery\**\src\*.csproj;
  198. $(RepoRoot)src\Hosting\**\src\*.csproj;
  199. $(RepoRoot)src\Http\**\src\*.csproj;
  200. $(RepoRoot)src\HttpClientFactory\**\src\*.csproj;
  201. $(RepoRoot)src\Html.Abstractions\src\*.csproj;
  202. $(RepoRoot)src\Identity\**\src\*.csproj;
  203. $(RepoRoot)src\Servers\**\src\*.csproj;
  204. $(RepoRoot)src\Security\**\src\*.csproj;
  205. $(RepoRoot)src\SiteExtensions\**\src\*.csproj;
  206. $(RepoRoot)src\Tools\**\src\*.csproj;
  207. $(RepoRoot)src\Logging.AzureAppServices\**\src\*.csproj;
  208. $(RepoRoot)src\Middleware\**\src\*.csproj;
  209. $(RepoRoot)src\Razor\**\src\*.csproj;
  210. $(RepoRoot)src\Mvc\**\src\*.csproj;
  211. $(RepoRoot)src\Azure\**\src\*.csproj;
  212. $(RepoRoot)src\SignalR\**\src\*.csproj;
  213. $(RepoRoot)src\StaticAssets\src\*.csproj;
  214. $(RepoRoot)src\Components\**\src\*.csproj;
  215. $(RepoRoot)src\FileProviders\**\src\*.csproj;
  216. $(RepoRoot)src\Configuration.KeyPerFile\**\src\*.csproj;
  217. $(RepoRoot)src\Localization\**\src\*.csproj;
  218. $(RepoRoot)src\ObjectPool\**\src\*.csproj;
  219. $(RepoRoot)src\JSInterop\**\src\*.csproj;
  220. $(RepoRoot)src\WebEncoders\**\src\*.csproj;
  221. $(RepoRoot)src\HealthChecks\**\src\*.csproj;
  222. $(RepoRoot)src\Testing\**\src\*.csproj;
  223. $(RepoRoot)src\Extensions\**\src\*.csproj;
  224. $(RepoRoot)src\BuildAfterTargetingPack\*.csproj;
  225. $(RepoRoot)src\OpenApi\**\src\*.csproj;
  226. "
  227. Exclude="
  228. @(ProjectToBuild);
  229. @(ProjectToExclude);
  230. $(RepoRoot)**\node_modules\**\*;
  231. $(RepoRoot)**\bin\**\*;
  232. $(RepoRoot)**\obj\**\*;"
  233. Condition=" '$(BuildMainlyReferenceProviders)' == 'true' " />
  234. <ProjectToBuild Condition=" '$(BuildManaged)' == 'true'" Include="@(DotNetProjects)" Exclude="@(ProjectToExclude)" BuildStep="managed" />
  235. <ProjectToExclude Condition=" '$(BuildManaged)' != 'true'" Include="@(DotNetProjects)" />
  236. </ItemGroup>
  237. <!-- BuildInstallers -->
  238. <PropertyGroup>
  239. <_BuildWindowsInstallers Condition="'$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64' OR '$(TargetArchitecture)' == 'arm64') ">true</_BuildWindowsInstallers>
  240. <_VcxTargetPlatform Condition="'$(TargetArchitecture)' == 'x86'">Win32</_VcxTargetPlatform>
  241. <_VcxTargetPlatform Condition="'$(TargetArchitecture)' == 'x64'">x64</_VcxTargetPlatform>
  242. <_VcxTargetPlatform Condition="'$(TargetArchitecture)' == 'arm64'">ARM64</_VcxTargetPlatform>
  243. </PropertyGroup>
  244. <!-- In .NET product build mode, build the installers entirely via HostingBundle ProjectReferences in pass 2 -->
  245. <ItemGroup Condition="'$(DotNetBuild)' != 'true' and '$(_BuildWindowsInstallers)' == 'true' ">
  246. <!-- Build the ANCM custom action -->
  247. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=x64" />
  248. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=Win32" />
  249. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=ARM64" />
  250. <!-- Build the ANCM msis -->
  251. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj" AdditionalProperties="Platform=x64" />
  252. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj" AdditionalProperties="Platform=x86" />
  253. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj" AdditionalProperties="Platform=arm64" />
  254. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMV2\ANCMV2.wixproj" AdditionalProperties="Platform=x64" />
  255. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMV2\ANCMV2.wixproj" AdditionalProperties="Platform=x86" />
  256. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMV2\ANCMV2.wixproj" AdditionalProperties="Platform=arm64" />
  257. <!-- Windows hosting bundle -->
  258. <InstallerProject Include="$(RepoRoot)src\Installers\Windows\WindowsHostingBundle\WindowsHostingBundle.wixproj" AdditionalProperties="Platform=x86" />
  259. </ItemGroup>
  260. <ItemGroup>
  261. <ProjectToBuild Condition=" '$(BuildInstallers)' == 'true'" Include="@(InstallerProject)" BuildStep="installer" />
  262. </ItemGroup>
  263. </Otherwise>
  264. </Choose>
  265. </Project>