Build.props 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <Project>
  2. <PropertyGroup>
  3. <TargetRuntimeIdentifier Condition="'$(TargetRuntimeIdentifier)' == ''">$(TargetOsName)-$(TargetArchitecture)</TargetRuntimeIdentifier>
  4. </PropertyGroup>
  5. <PropertyGroup Condition=" '$(BuildAllProjects)' == 'true' ">
  6. <BuildNative Condition="'$(BuildNative)' == ''">true</BuildNative>
  7. <BuildManaged Condition="'$(BuildManaged)' == ''">true</BuildManaged>
  8. <BuildNodeJS Condition="'$(BuildNodeJS)' == ''">true</BuildNodeJS>
  9. <BuildJava Condition="'$(BuildJava)' == ''">true</BuildJava>
  10. </PropertyGroup>
  11. <!-- These projects are always excluded, even when -projects is specified on command line. -->
  12. <ItemGroup>
  13. <!-- Explicitly excluded projects -->
  14. <ProjectToExclude Include="$(ProjectToExclude)" />
  15. <!-- These projects use 'legacy' csproj, which is not supported by dotnet-msbuild. -->
  16. <ProjectToExclude Include="
  17. $(RepoRoot)src\Servers\HttpSys\samples\TestClient\TestClient.csproj;
  18. $(RepoRoot)src\Middleware\WebSockets\samples\TestServer\WebSockets.TestServer.csproj;
  19. "
  20. Condition=" '$(MSBuildRuntimeType)' == 'Core' " />
  21. <!-- Exclude the websockets samples for now because they use classic .csproj, which is not yet supported in our build. -->
  22. <ProjectToExclude Include="$(RepoRoot)src\Middleware\WebSockets\samples\**\*.csproj" />
  23. <!-- These projects are meant to be executed by tests. -->
  24. <ProjectToExclude Include="
  25. $(RepoRoot)src\Tools\dotnet-watch\test\TestProjects\**\*.csproj;
  26. $(RepoRoot)src\Tools\Tests.Common\TestProjects\**\*.csproj;
  27. $(RepoRoot)src\Razor\Razor.Design\test\testassets\**\*.*proj;
  28. $(RepoRoot)src\submodules\**\*.*proj;
  29. $(RepoRoot)src\Installers\**\*.*proj;
  30. $(RepoRoot)src\SignalR\clients\ts\**\node_modules\**\*.*proj;
  31. $(RepoRoot)src\Components\Web.JS\node_modules\**\*.*proj;
  32. $(RepoRoot)src\Components\Blazor\Build\testassets\**\*.*proj;
  33. $(RepoRoot)src\ProjectTemplates\BlazorWasm.ProjectTemplates\content\**\*.csproj;
  34. $(RepoRoot)src\ProjectTemplates\Web.ProjectTemplates\content\**\*.csproj;
  35. $(RepoRoot)src\ProjectTemplates\Web.ProjectTemplates\content\**\*.fsproj;
  36. $(RepoRoot)src\ProjectTemplates\Web.Spa.ProjectTemplates\content\**\*.csproj;
  37. " />
  38. <!-- Exclude the benchmarks because they use <PackageReference>. -->
  39. <ProjectToExclude Include="
  40. $(RepoRoot)src\Components\benchmarkapps\**\*.csproj;
  41. $(RepoRoot)src\Mvc\benchmarkapps\**\*.csproj;
  42. $(RepoRoot)src\Servers\Kestrel\perf\PlatformBenchmarks\**\*.csproj;
  43. $(RepoRoot)src\SignalR\perf\benchmarkapps\**\*.csproj;
  44. " />
  45. </ItemGroup>
  46. <Choose>
  47. <!-- Project selection can be overridden on the command line by passing in -projects -->
  48. <When Condition="'$(ProjectToBuild)' != ''">
  49. <ItemGroup>
  50. <ProjectToBuild Include="$(ProjectToBuild)" Exclude="@(ProjectToExclude);$(RepoRoot)**\bin\**\*;$(RepoRoot)**\obj\**\*">
  51. <RestoreInParallel Condition="'%(Extension)' == '.npmproj'">false</RestoreInParallel>
  52. </ProjectToBuild>
  53. </ItemGroup>
  54. </When>
  55. <Otherwise>
  56. <ItemGroup Condition=" '$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win' ">
  57. <!-- Build the ANCM custom action -->
  58. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=x64" />
  59. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=Win32" />
  60. <!-- Build the ANCM msis -->
  61. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj" AdditionalProperties="Platform=x64" />
  62. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj" AdditionalProperties="Platform=x86" />
  63. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMV2\ANCMV2.wixproj" AdditionalProperties="Platform=x64" />
  64. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMV2\ANCMV2.wixproj" AdditionalProperties="Platform=x86" />
  65. <!-- Build the targeting pack installers -->
  66. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=x64" />
  67. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=x86" />
  68. <!-- Build the SharedFramework installers -->
  69. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" AdditionalProperties="Platform=x64" />
  70. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" AdditionalProperties="Platform=x86" />
  71. <!-- Build the SharedFramework wixlib -->
  72. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=x64" />
  73. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=x86" />
  74. <!-- Windows hosting bundled -->
  75. <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\WindowsHostingBundle\WindowsHostingBundle.wixproj" AdditionalProperties="Platform=x86" />
  76. </ItemGroup>
  77. <ItemGroup Condition="'$(BuildInstallers)' == 'true' AND '$(TargetRuntimeIdentifier)' == 'linux-x64'">
  78. <ProjectToBuild Condition=" '$(LinuxInstallerType)' == 'deb' "
  79. Include="$(RepoRoot)src\Installers\Debian\**\*.*proj" />
  80. <ProjectToBuild Condition=" '$(LinuxInstallerType)' == 'rpm' "
  81. Include="$(RepoRoot)src\Installers\Rpm\**\*.*proj" />
  82. </ItemGroup>
  83. <ItemGroup>
  84. <NativeProjects Condition=" '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64') "
  85. Include="$(RepoRoot)src\**\*.vcxproj" Exclude="@(ProjectToExclude)">
  86. <!-- Required to prevent triggering double-builds. See src\Servers\IIS\ResolveIisReferences.targets for details. -->
  87. <AdditionalProperties Condition="'$(TargetArchitecture)' == 'x64'">Platform=x64</AdditionalProperties>
  88. <AdditionalProperties Condition="'$(TargetArchitecture)' == 'x86'">Platform=Win32</AdditionalProperties>
  89. </NativeProjects>
  90. <ProjectToBuild Condition=" '$(BuildNative)' == 'true'" Include="@(NativeProjects)" Exclude="@(ProjectToExclude)" />
  91. <ProjectToExclude Condition=" '$(BuildNative)' != 'true'" Include="@(NativeProjects)" />
  92. <NodeJsProjects Include="
  93. $(RepoRoot)src\Components\Web.JS\Microsoft.AspNetCore.Components.Web.JS.npmproj;
  94. $(RepoRoot)src\SignalR\**\*.npmproj;
  95. $(RepoRoot)src\Middleware\**\*.npmproj;
  96. "
  97. RestoreInParallel="false"
  98. Exclude="@(ProjectToExclude)" />
  99. <ProjectToBuild Condition=" '$(BuildNodeJS)' == 'true'" Include="@(NodeJsProjects)" Exclude="@(ProjectToExclude)" />
  100. <ProjectToExclude Condition=" '$(BuildNodeJS)' != 'true'" Include="@(NodeJsProjects)" />
  101. <JavaProjects Include="$(RepoRoot)src\SignalR\**\*.javaproj"
  102. Exclude="@(ProjectToExclude)" />
  103. <ProjectToBuild Condition=" '$(BuildJava)' == 'true'" Include="@(JavaProjects)" Exclude="@(ProjectToExclude)" />
  104. <ProjectToExclude Condition=" '$(BuildJava)' != 'true'" Include="@(JavaProjects)" />
  105. <!--
  106. Use caution to avoid deep recursion. If the globbing pattern picks up something which exceeds MAX_PATH,
  107. the entire pattern will silently fail to evaluate correctly.
  108. -->
  109. <DotNetProjects Include="
  110. $(RepoRoot)src\Framework\ref\Microsoft.AspNetCore.App.Ref.csproj;
  111. $(RepoRoot)src\Framework\src\Microsoft.AspNetCore.App.Runtime.csproj;
  112. $(RepoRoot)src\Framework\test\Microsoft.AspNetCore.App.UnitTests.csproj;
  113. $(RepoRoot)src\DefaultBuilder\**\*.*proj;
  114. $(RepoRoot)src\Features\JsonPatch\**\*.*proj;
  115. $(RepoRoot)src\DataProtection\**\*.*proj;
  116. $(RepoRoot)src\Antiforgery\**\*.*proj;
  117. $(RepoRoot)src\Hosting\**\*.*proj;
  118. $(RepoRoot)src\Http\**\*.*proj;
  119. $(RepoRoot)src\Html\**\*.*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\Shared\**\*.*proj;
  125. $(RepoRoot)src\Tools\**\*.*proj;
  126. $(RepoRoot)src\Middleware\**\*.csproj;
  127. $(RepoRoot)src\Razor\**\*.*proj;
  128. $(RepoRoot)src\Mvc\**\*.*proj;
  129. $(RepoRoot)src\Azure\**\*.*proj;
  130. $(RepoRoot)src\MusicStore\**\*.*proj;
  131. $(RepoRoot)src\SignalR\**\*.csproj;
  132. $(RepoRoot)src\Components\**\*.csproj;
  133. $(RepoRoot)src\Analyzers\**\*.csproj;
  134. $(RepoRoot)src\ProjectTemplates\*\*.csproj;
  135. $(RepoRoot)src\ProjectTemplates\testassets\*\*.csproj;
  136. "
  137. Exclude="
  138. @(ProjectToBuild);
  139. @(ProjectToExclude);
  140. $(RepoRoot)**\node_modules\**\*;
  141. $(RepoRoot)**\bin\**\*;
  142. $(RepoRoot)**\obj\**\*;" />
  143. <ProjectToBuild Condition=" '$(BuildManaged)' == 'true'" Include="@(DotNetProjects)" Exclude="@(ProjectToExclude)" />
  144. <ProjectToExclude Condition=" '$(BuildManaged)' != 'true'" Include="@(DotNetProjects)" />
  145. </ItemGroup>
  146. </Otherwise>
  147. </Choose>
  148. </Project>