DotNetBuild.props 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <!-- Whenever altering this or other Source Build files, please include @dotnet/source-build-internal as a reviewer. -->
  2. <Project>
  3. <PropertyGroup>
  4. <GitHubRepositoryName>aspnetcore</GitHubRepositoryName>
  5. <SourceBuildManagedOnly>true</SourceBuildManagedOnly>
  6. <SourceBuildTargetFrameworkFilter>netstandard2.0%3bnetstandard2.1%3bnetcoreapp2.1%3bnetcoreapp3.1%3bnet5.0%3bnet6.0%3bnet7.0%3bnet8.0%3bnet9.0</SourceBuildTargetFrameworkFilter>
  7. </PropertyGroup>
  8. <!--
  9. Remove inner source .globalconfig file as both the inner and outer config files get loaded and cause a conflict.
  10. Leaving the inner will cause all conflicting settings to be ignored.
  11. https://learn.microsoft.com/dotnet/fundamentals/code-analysis/configuration-files#general-options.
  12. This only needs to be done if there is an inner clone.
  13. -->
  14. <Target Name="RemoveInnerGlobalConfig"
  15. DependsOnTargets="PrepareInnerSourceBuildRepoRoot"
  16. BeforeTargets="RunInnerSourceBuildCommand"
  17. Condition="'$(DotNetBuildOrchestrator)' != 'true'">
  18. <Delete Files="$(InnerSourceBuildRepoRoot).globalconfig" />
  19. </Target>
  20. <!-- Build RepoTasks - this is normally triggered via the build script but the inner ArPow source-build is run via msbuild.
  21. https://github.com/dotnet/source-build/issues/3807 -->
  22. <Target Name="BuildRepoTasks"
  23. Condition="'$(DotNetBuildInnerRepo)' == 'true' and '$(DotNetBuildSourceOnly)' == 'true'"
  24. BeforeTargets="Execute">
  25. <!-- If the alternative runtime location and key are present, pass those through -->
  26. <PropertyGroup>
  27. <_AdditionalRepoTaskBuildArgs />
  28. <_AdditionalRepoTaskBuildArgs Condition="'$(DotNetRuntimeSourceFeed)' != ''" >$(_AdditionalRepoTaskBuildArgs) --runtimesourcefeed $(DotNetRuntimeSourceFeed)</_AdditionalRepoTaskBuildArgs>
  29. <_AdditionalRepoTaskBuildArgs Condition="'$(DotNetRuntimeSourceFeedKey)' != ''" >$(_AdditionalRepoTaskBuildArgs) --runtimesourcefeedkey $(DotNetRuntimeSourceFeedKey)</_AdditionalRepoTaskBuildArgs>
  30. <_AdditionalRepoTaskBuildArgs Condition="'$(RestoreConfigFile)' != ''" >$(_AdditionalRepoTaskBuildArgs) /p:RestoreConfigFile=$(RestoreConfigFile)</_AdditionalRepoTaskBuildArgs>
  31. </PropertyGroup>
  32. <ItemGroup>
  33. <!-- We need to flow FullAssemblySigningSupported even when building repo tasks because they use full signing -->
  34. <InnerBuildEnv Condition="'$(FullAssemblySigningSupported)' != ''" Include="FullAssemblySigningSupported=$(FullAssemblySigningSupported)" />
  35. <InnerBuildEnv Include="DotNetBuildSourceOnly=$(DotNetBuildSourceOnly)" />
  36. </ItemGroup>
  37. <!-- Call the build.sh script to build the repo tasks. Set IgnoreStandardErrorWarningFormat
  38. to true. This avoids fatal errors, because in internal builds there are usually a few failed installation
  39. attempts as the install script walks through potential locations for a runtime.
  40. The overall build script will return a proper exit code, but we don't want to pick up the printed error messages. -->
  41. <Exec
  42. Command="./eng/build.sh --only-build-repo-tasks -bl $(_AdditionalRepoTaskBuildArgs)"
  43. IgnoreStandardErrorWarningFormat="true"
  44. WorkingDirectory="$(InnerSourceBuildRepoRoot)"
  45. EnvironmentVariables="@(InnerBuildEnv)"
  46. Condition="'$(OS)' != 'Windows_NT'" />
  47. <Exec
  48. Command=".\eng\build.cmd -OnlyBuildRepoTasks -bl $(_AdditionalRepoTaskBuildArgs)"
  49. IgnoreStandardErrorWarningFormat="true"
  50. WorkingDirectory="$(InnerSourceBuildRepoRoot)"
  51. EnvironmentVariables="@(InnerBuildEnv)"
  52. Condition="'$(OS)' == 'Windows_NT'" />
  53. </Target>
  54. <Target Name="CustomizeInnerBuildArgs"
  55. BeforeTargets="GetSourceBuildCommandConfiguration">
  56. <PropertyGroup>
  57. <InnerBuildArgs Condition="'$(SourceBuildUseMonoRuntime)' == 'true'">$(InnerBuildArgs) /p:CrossgenOutput=false</InnerBuildArgs>
  58. </PropertyGroup>
  59. </Target>
  60. <Target Name="GetAspnetcoreCategorizedIntermediateNupkgContents"
  61. BeforeTargets="GetCategorizedIntermediateNupkgContents">
  62. <PropertyGroup>
  63. <InstallersArtifactsDir>$(CurrentRepoSourceBuildArtifactsDir)\installers\$(Configuration)\</InstallersArtifactsDir>
  64. </PropertyGroup>
  65. <ItemGroup>
  66. <!--
  67. Add the internal installers artifacts required by dotnet/installer.
  68. -->
  69. <IntermediateNupkgArtifactFile Include="$(InstallersArtifactsDir)aspnetcore-runtime-*.tar.gz" />
  70. <IntermediateNupkgArtifactFile Include="$(InstallersArtifactsDir)aspnetcore_base_runtime.version" />
  71. <IntermediateNupkgArtifactFile Include="$(InstallersArtifactsDir)aspnetcore-runtime-*.msi" />
  72. <IntermediateNupkgArtifactFile Include="$(InstallersArtifactsDir)aspnetcore-runtime-*.pkg" />
  73. <IntermediateNupkgArtifactFile Include="$(InstallersArtifactsDir)aspnetcore-runtime-*.deb" />
  74. <IntermediateNupkgArtifactFile Include="$(InstallersArtifactsDir)aspnetcore-runtime-*.rpm" />
  75. </ItemGroup>
  76. </Target>
  77. <Target Name="RestoreNpmPackages"
  78. Condition="'$(BuildNodeJS)' == 'true' and '$(DotNetBuildSourceOnly)' == 'true'"
  79. BeforeTargets="RunInnerSourceBuildCommand">
  80. <Message Text="Checking node version..." Importance="high" />
  81. <Exec
  82. Command="node --version"
  83. WorkingDirectory="$(InnerSourceBuildRepoRoot)" />
  84. <Message Text="Checking npm version..." Importance="high" />
  85. <Exec
  86. Command="npm --version"
  87. WorkingDirectory="$(InnerSourceBuildRepoRoot)" />
  88. <PropertyGroup>
  89. <!-- Disable installing puppeteer browsers when running in source build -->
  90. <_AdditionalEnvironmentVariable Condition="$(ArcadeBuildFromSource) == 'true'">PUPPETEER_SKIP_DOWNLOAD=1</_AdditionalEnvironmentVariable>
  91. </PropertyGroup>
  92. <Exec
  93. Command="npm ci"
  94. WorkingDirectory="$(InnerSourceBuildRepoRoot)"
  95. EnvironmentVariables="$(_AdditionalEnvironmentVariable)" />
  96. </Target>
  97. <Target Name="BuildNpmFiles"
  98. Condition="'$(BuildNodeJS)' == 'true' and '$(DotNetBuildSourceOnly)' == 'true'"
  99. DependsOnTargets="RestoreNpmPackages"
  100. BeforeTargets="RunInnerSourceBuildCommand">
  101. <Message Text="Building Node JS files..." Importance="high" />
  102. <Exec
  103. Command="npm run build"
  104. WorkingDirectory="$(InnerSourceBuildRepoRoot)" />
  105. </Target>
  106. </Project>