diff --git a/src/SourceBuild/content/eng/tools/tasks/SourceBuild.MSBuildSdkResolver/SourceBuiltSdkResolver.cs b/src/SourceBuild/content/eng/tools/tasks/SourceBuild.MSBuildSdkResolver/SourceBuiltSdkResolver.cs
index 250c620bf..ebef7c45f 100644
--- a/src/SourceBuild/content/eng/tools/tasks/SourceBuild.MSBuildSdkResolver/SourceBuiltSdkResolver.cs
+++ b/src/SourceBuild/content/eng/tools/tasks/SourceBuild.MSBuildSdkResolver/SourceBuiltSdkResolver.cs
@@ -12,17 +12,17 @@ using System.Linq;
namespace Microsoft.DotNet.SourceBuild.Tasks
{
///
- /// Extends the SDK to handle "SOURCE_BUILD_SDK_*" override environment variables. Each override
+ /// Extends the SDK to handle "SOURCE_BUILT_SDK_*" override environment variables. Each override
/// should provide a set of 3 environment variables:
///
- /// SOURCE_BUILD_SDK_ID_EXAMPLE=Your.Sdk.Example
+ /// SOURCE_BUILT_SDK_ID_EXAMPLE=Your.Sdk.Example
/// ID of the SDK nuget package to override.
///
- /// SOURCE_BUILD_SDK_DIR_EXAMPLE=/git/repo/bin/extracted/Your.Sdk.Example/
+ /// SOURCE_BUILT_SDK_DIR_EXAMPLE=/git/repo/bin/extracted/Your.Sdk.Example/
/// Directory where the sdk/Sdk.props and/or sdk/Sdk.targets files are located. This should be
/// the directory where the override SDK package is extracted.
///
- /// SOURCE_BUILD_SDK_VERSION_EXAMPLE=1.0.0-source-built
+ /// SOURCE_BUILT_SDK_VERSION_EXAMPLE=1.0.0-source-built
/// (Optional) Version of the SDK package to use. This is informational.
///
public class SourceBuiltSdkResolver : SdkResolver
diff --git a/src/SourceBuild/content/global.json b/src/SourceBuild/content/global.json
index edd5896df..543d86454 100644
--- a/src/SourceBuild/content/global.json
+++ b/src/SourceBuild/content/global.json
@@ -4,6 +4,7 @@
},
"msbuild-sdks": {
"Microsoft.Build.NoTargets": "3.7.0",
+ "Microsoft.Build.Traversal": "3.4.0",
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24075.2"
}
}
diff --git a/src/SourceBuild/content/repo-projects/Directory.Build.props b/src/SourceBuild/content/repo-projects/Directory.Build.props
index 4a87ec572..7c9ac1dd6 100644
--- a/src/SourceBuild/content/repo-projects/Directory.Build.props
+++ b/src/SourceBuild/content/repo-projects/Directory.Build.props
@@ -28,12 +28,23 @@
$(ProjectDirectory)NuGet.config
$(ProjectDirectory)NuGet.Config
+ $(NuGetConfigFile)
+
+ $(BaseIntermediateOutputPath)$([System.IO.Path]::GetFileName('$(OriginalNuGetConfigFile)'))
+
$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'source-built-sdks'))
$([MSBuild]::ValueOrDefault('$(ARCADE_BOOTSTRAP_VERSION)', '$(ArcadeSdkVersion)'))
+
+
+ $([System.IO.File]::ReadAllText($(RepoRoot)global.json))
+ $([System.Text.RegularExpressions.Regex]::Match($(VMRGlobalJsonContents), '"Microsoft.Build.NoTargets": "([^"]*)"').Groups.get_Item(1))
+ $([System.Text.RegularExpressions.Regex]::Match($(VMRGlobalJsonContents), '"Microsoft.Build.Traversal": "([^"]*)"').Groups.get_Item(1))
+
+
-
0
@@ -60,6 +71,7 @@
$(BuildArgs) /p:DotNetBuildOrchestrator=true
$(BuildArgs) /p:CrossBuild=true
$(BuildArgs) /p:DotNetBuildSkipTests=true
+ $(BuildArgs) /p:RestoreConfigFile=$(NuGetConfigFile)
@@ -133,6 +145,9 @@
+
+
+
@@ -170,6 +185,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -90,49 +104,44 @@
https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json
-
-
-
-
-
-
-
-
-
-
-
@@ -572,16 +581,21 @@
Condition="'@(BuiltSdkPackageOverride)' != ''"
Inputs="$(MSBuildProjectFullPath)"
Outputs="$(BaseIntermediateOutputPath)ExtractToolPackage.complete">
+
+ <_ToolPackagesRoot Condition="'$(RepositoryName)' != 'source-build-reference-packages'">$(SourceBuiltPackagesPath)
+ <_ToolPackagesRoot Condition="'$(RepositoryName)' == 'source-build-reference-packages'">$(ReferencePackagesDir)
+
+
<_ToolPackage
Condition="'%(BuiltSdkPackageOverride.Version)' == ''"
- Include="$(SourceBuiltPackagesPath)%(BuiltSdkPackageOverride.Identity)*.nupkg"
- Exclude="$(SourceBuiltPackagesPath)%(BuiltSdkPackageOverride.Identity)*.symbols.nupkg"
+ Include="$(_ToolPackagesRoot)%(BuiltSdkPackageOverride.Identity)*.nupkg"
+ Exclude="$(_ToolPackagesRoot)%(BuiltSdkPackageOverride.Identity)*.symbols.nupkg"
Id="%(BuiltSdkPackageOverride.Identity)" />
<_ToolPackage
Condition="'%(BuiltSdkPackageOverride.Version)' != ''"
- Include="$(SourceBuiltPackagesPath)%(BuiltSdkPackageOverride.Identity).%(BuiltSdkPackageOverride.Version).nupkg"
- Exclude="$(SourceBuiltPackagesPath)%(BuiltSdkPackageOverride.Identity).%(BuiltSdkPackageOverride.Version).symbols.nupkg"
+ Include="$(_ToolPackagesRoot)%(BuiltSdkPackageOverride.Identity).%(BuiltSdkPackageOverride.Version).nupkg"
+ Exclude="$(_ToolPackagesRoot)%(BuiltSdkPackageOverride.Identity).%(BuiltSdkPackageOverride.Version).symbols.nupkg"
Id="%(BuiltSdkPackageOverride.Identity)" />
diff --git a/src/SourceBuild/content/repo-projects/source-build-reference-packages.proj b/src/SourceBuild/content/repo-projects/source-build-reference-packages.proj
index a3bf43dae..cff1f387a 100644
--- a/src/SourceBuild/content/repo-projects/source-build-reference-packages.proj
+++ b/src/SourceBuild/content/repo-projects/source-build-reference-packages.proj
@@ -19,7 +19,13 @@
$(BuildArgs) /p:LocalNuGetPackageCacheDirectory=$(LocalNuGetPackageCacheDirectory)
+
+
+
+
+
diff --git a/src/SourceBuild/patches/aspnetcore/0001-Enable-use-of-RestoreConfigFile-property-in-source-b.patch b/src/SourceBuild/patches/aspnetcore/0001-Enable-use-of-RestoreConfigFile-property-in-source-b.patch
new file mode 100644
index 000000000..5fa530c55
--- /dev/null
+++ b/src/SourceBuild/patches/aspnetcore/0001-Enable-use-of-RestoreConfigFile-property-in-source-b.patch
@@ -0,0 +1,22 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nikola Milosavljevic
+Date: Wed, 31 Jan 2024 16:40:03 +0000
+Subject: [PATCH] Enable use of RestoreConfigFile property in source-build
+
+Backport: https://github.com/dotnet/aspnetcore/pull/53738
+---
+ eng/SourceBuild.props | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props
+index 991a0e2e51..e637eb0143 100644
+--- a/eng/SourceBuild.props
++++ b/eng/SourceBuild.props
+@@ -40,6 +40,7 @@
+ <_AdditionalRepoTaskBuildArgs />
+ <_AdditionalRepoTaskBuildArgs Condition="'$(DotNetRuntimeSourceFeed)' != ''" >$(_AdditionalRepoTaskBuildArgs) --runtimesourcefeed $(DotNetRuntimeSourceFeed)
+ <_AdditionalRepoTaskBuildArgs Condition="'$(DotNetRuntimeSourceFeedKey)' != ''" >$(_AdditionalRepoTaskBuildArgs) --runtimesourcefeedkey $(DotNetRuntimeSourceFeedKey)
++ <_AdditionalRepoTaskBuildArgs Condition="'$(RestoreConfigFile)' != ''" >$(_AdditionalRepoTaskBuildArgs) /p:RestoreConfigFile=$(RestoreConfigFile)
+
+
+
diff --git a/src/SourceBuild/patches/razor/0001-Add-missing-SDK-dependency-to-global.json.patch b/src/SourceBuild/patches/razor/0001-Add-missing-SDK-dependency-to-global.json.patch
new file mode 100644
index 000000000..24fcbff18
--- /dev/null
+++ b/src/SourceBuild/patches/razor/0001-Add-missing-SDK-dependency-to-global.json.patch
@@ -0,0 +1,34 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nikola Milosavljevic
+Date: Thu, 1 Feb 2024 20:38:17 +0000
+Subject: [PATCH] Add missing SDK dependency to global.json
+
+Backport: https://github.com/dotnet/razor/pull/9886
+---
+ global.json | 3 ++-
+ .../Microsoft.NET.Sdk.Razor.SourceGenerators.Transport.csproj | 2 +-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/global.json b/global.json
+index ada577e39..c3c7a902c 100644
+--- a/global.json
++++ b/global.json
+@@ -21,6 +21,7 @@
+ "rollForward": "latestPatch"
+ },
+ "msbuild-sdks": {
+- "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24075.5"
++ "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24075.5",
++ "Microsoft.Build.NoTargets": "2.0.1"
+ }
+ }
+diff --git a/src/Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators.Transport/Microsoft.NET.Sdk.Razor.SourceGenerators.Transport.csproj b/src/Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators.Transport/Microsoft.NET.Sdk.Razor.SourceGenerators.Transport.csproj
+index b1f652079..91885d077 100644
+--- a/src/Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators.Transport/Microsoft.NET.Sdk.Razor.SourceGenerators.Transport.csproj
++++ b/src/Compiler/Microsoft.NET.Sdk.Razor.SourceGenerators.Transport/Microsoft.NET.Sdk.Razor.SourceGenerators.Transport.csproj
+@@ -1,4 +1,4 @@
+-
++
+
+
+ netstandard2.0
diff --git a/src/SourceBuild/patches/runtime/0001-Enable-use-of-RestoreConfigFile-property-in-source-b.patch b/src/SourceBuild/patches/runtime/0001-Enable-use-of-RestoreConfigFile-property-in-source-b.patch
new file mode 100644
index 000000000..9ccf0e453
--- /dev/null
+++ b/src/SourceBuild/patches/runtime/0001-Enable-use-of-RestoreConfigFile-property-in-source-b.patch
@@ -0,0 +1,22 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nikola Milosavljevic
+Date: Wed, 31 Jan 2024 16:48:26 +0000
+Subject: [PATCH] Enable use of RestoreConfigFile property in source-build
+
+Backport: https://github.com/dotnet/runtime/pull/97778
+---
+ eng/SourceBuild.props | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props
+index 3b544528694..dee4316dbbf 100644
+--- a/eng/SourceBuild.props
++++ b/eng/SourceBuild.props
+@@ -51,6 +51,7 @@
+ $(InnerBuildArgs) /p:OfficialBuildId=$(OfficialBuildId)
+ $(InnerBuildArgs) /p:ContinuousIntegrationBuild=$(ContinuousIntegrationBuild)
+ $(InnerBuildArgs) /p:PortableBuild=$(PortableBuild)
++ $(InnerBuildArgs) /p:RestoreConfigFile=$(RestoreConfigFile)
+
+
+
diff --git a/src/SourceBuild/patches/sdk/0002-Add-missing-SDK-dependency-to-global.json.patch b/src/SourceBuild/patches/sdk/0002-Add-missing-SDK-dependency-to-global.json.patch
new file mode 100644
index 000000000..786a738f3
--- /dev/null
+++ b/src/SourceBuild/patches/sdk/0002-Add-missing-SDK-dependency-to-global.json.patch
@@ -0,0 +1,34 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nikola Milosavljevic
+Date: Thu, 1 Feb 2024 20:49:37 +0000
+Subject: [PATCH] Add missing SDK dependency to global.json
+
+Backport: https://github.com/dotnet/sdk/pull/38426
+---
+ global.json | 3 ++-
+ src/Containers/packaging/package.csproj | 2 +-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/global.json b/global.json
+index a294ff1e80..d79e46c295 100644
+--- a/global.json
++++ b/global.json
+@@ -15,6 +15,7 @@
+ },
+ "msbuild-sdks": {
+ "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24076.5",
+- "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24076.5"
++ "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24076.5",
++ "Microsoft.Build.NoTargets": "3.7.0"
+ }
+ }
+diff --git a/src/Containers/packaging/package.csproj b/src/Containers/packaging/package.csproj
+index 590b15e874..a3a40db735 100644
+--- a/src/Containers/packaging/package.csproj
++++ b/src/Containers/packaging/package.csproj
+@@ -1,4 +1,4 @@
+-
++
+
+ $(SdkTargetFramework)
+ true