Build.props 10 KB

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