Stop making tools.sh changes during source-build (#17664)

Co-authored-by: Michael Simons <msimons@microsoft.com>
This commit is contained in:
Nikola Milosavljevic 2023-11-01 10:57:00 -07:00 committed by GitHub
parent b9f8a4b0ed
commit e051067c46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 56 additions and 23 deletions

View file

@ -58,29 +58,6 @@
NewText="$(NewText)" />
</Target>
<Target Name="UpdateBuildToolFramework"
BeforeTargets="Build"
Condition="'$(EngCommonToolsShFile)' != ''"
Inputs="$(MSBuildProjectFullPath)"
Outputs="$(RepoCompletedSemaphorePath)UpdateBuildToolFramework.complete" >
<!-- Update the BuildToolFramework for repos that have not adopted the current version of Arcade-->
<ReplaceTextInFile InputFile="$(EngCommonToolsShFile)"
OldText="_InitializeBuildToolFramework=&quot;netcoreapp3.1&quot;"
NewText="_InitializeBuildToolFramework=&quot;$(NetCurrent)&quot;" />
<ReplaceTextInFile InputFile="$(EngCommonToolsShFile)"
OldText="_InitializeBuildToolFramework=&quot;net7.0&quot;"
NewText="_InitializeBuildToolFramework=&quot;$(NetCurrent)&quot;" />
<!-- Temporary workaround for when the ci option is specified, non-zero exit are swallowed which prevents builds from failing within
the build process. https://github.com/dotnet/source-build/issues/2307 -->
<ReplaceTextInFile InputFile="$(EngCommonToolsShFile)"
OldText="ExitWithExitCode 0"
NewText="ExitWithExitCode $exit_code" />
<WriteLinesToFile File="$(RepoCompletedSemaphorePath)UpdateBuildToolFramework.complete" Overwrite="true" />
</Target>
<Target Name="UpdateNuGetConfig"
BeforeTargets="Build"
Condition="'$(NuGetConfigFile)' != '' OR '@(NuGetConfigFiles)' != ''"

View file

@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nikola Milosavljevic <nikolam@microsoft.com>
Date: Mon, 30 Oct 2023 22:45:58 +0000
Subject: [PATCH] Allow override of build tool framework version
Backport: https://github.com/dotnet/command-line-api/pull/2283
---
eng/common/tools.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/eng/common/tools.sh b/eng/common/tools.sh
index 2f27d745..422e711d 100644
--- a/eng/common/tools.sh
+++ b/eng/common/tools.sh
@@ -312,7 +312,12 @@ function InitializeBuildTool {
# return values
_InitializeBuildTool="$_InitializeDotNetCli/dotnet"
_InitializeBuildToolCommand="msbuild"
- _InitializeBuildToolFramework="net7.0"
+ # use override if it exists - commonly set by source-build
+ if [[ -z "${_OverrideArcadeInitializeBuildToolFramework}" ]]; then
+ _InitializeBuildToolFramework="net7.0"
+ else
+ _InitializeBuildToolFramework="${_OverrideArcadeInitializeBuildToolFramework}"
+ fi
}
# Set RestoreNoCache as a workaround for https://github.com/NuGet/Home/issues/3116

View file

@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nikola Milosavljevic <nikolam@microsoft.com>
Date: Mon, 30 Oct 2023 22:52:31 +0000
Subject: [PATCH] Allow override of build tool framework version
Backport: https://github.com/dotnet/aspnetcore/issues/51753
---
eng/common/tools.sh | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/eng/common/tools.sh b/eng/common/tools.sh
index 17f0a36..343490c 100755
--- a/eng/common/tools.sh
+++ b/eng/common/tools.sh
@@ -312,7 +312,12 @@ function InitializeBuildTool {
# return values
_InitializeBuildTool="$_InitializeDotNetCli/dotnet"
_InitializeBuildToolCommand="msbuild"
- _InitializeBuildToolFramework="netcoreapp3.1"
+ # use override if it exists - commonly set by source-build
+ if [[ -z "${_OverrideArcadeInitializeBuildToolFramework}" ]]; then
+ _InitializeBuildToolFramework="netcoreapp3.1"
+ else
+ _InitializeBuildToolFramework="${_OverrideArcadeInitializeBuildToolFramework}"
+ fi
}
# Set RestoreNoCache as a workaround for https://github.com/NuGet/Home/issues/3116