Skip to content

Commit d31bc72

Browse files
authored
Merge pull request #19902 from wli3/cherry-pick-main-changes
Cherry pick main changes
2 parents dbc4991 + 604d40d commit d31bc72

File tree

5 files changed

+21
-12
lines changed

5 files changed

+21
-12
lines changed

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"tools": {
3-
"dotnet": "6.0.100-rc.1.21417.19",
3+
"dotnet": "6.0.100-rc.1.21419.15",
44
"runtimes": {
55
"dotnet": [
66
"$(VSRedistCommonNetCoreSharedFrameworkx6460PackageVersion)"

src/Layout/redist/targets/OverlaySdkOnLKG.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<OverrideAndCreateBundledNETCoreAppPackageVersion
3737
Stage0MicrosoftNETCoreAppRefPackageVersionPath="$(_DotNetHiveRoot)/sdk/$(Stage0SdkVersion)/Microsoft.NETCoreSdk.BundledVersions.props"
3838
MicrosoftNETCoreAppRefPackageVersion="$(MicrosoftNETCoreAppRefPackageVersion)"
39+
NewSDKVersion="$(Version)"
3940
OutputPath="$(SdkOutputDirectory)/Microsoft.NETCoreSdk.BundledVersions.props"/>
4041

4142
<Copy SourceFiles="@(ToolsetToOverlay)"

src/Layout/toolset-tasks/OverrideAndCreateBundledNETCoreAppPackageVersion.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ namespace Microsoft.DotNet.Build.Tasks
1919
/// If there is a change depended on the latest runtime. Without override the runtime version in BundledNETCoreAppPackageVersion
2020
/// we would need to somehow get this change in without the test, and then insertion dotnet/installer
2121
/// and then update the stage 0 back.
22+
///
23+
/// Override NETCoreSdkVersion to stage 0 sdk version like 6.0.100-dev
2224
///
2325
/// Use a task to override since it was generated as a string literal replace anyway.
2426
/// And using C# can have better error when anything goes wrong.
@@ -33,20 +35,24 @@ public sealed class OverrideAndCreateBundledNETCoreAppPackageVersion : Task
3335
[Required] public string Stage0MicrosoftNETCoreAppRefPackageVersionPath { get; set; }
3436

3537
[Required] public string MicrosoftNETCoreAppRefPackageVersion { get; set; }
38+
[Required] public string NewSDKVersion { get; set; }
3639

3740
[Required] public string OutputPath { get; set; }
3841

3942
public override bool Execute()
4043
{
4144
File.WriteAllText(OutputPath,
42-
ExecuteInternal(File.ReadAllText(Stage0MicrosoftNETCoreAppRefPackageVersionPath),
43-
MicrosoftNETCoreAppRefPackageVersion));
45+
ExecuteInternal(
46+
File.ReadAllText(Stage0MicrosoftNETCoreAppRefPackageVersionPath),
47+
MicrosoftNETCoreAppRefPackageVersion,
48+
NewSDKVersion));
4449
return true;
4550
}
4651

4752
public static string ExecuteInternal(
4853
string stage0MicrosoftNETCoreAppRefPackageVersionContent,
49-
string microsoftNETCoreAppRefPackageVersion)
54+
string microsoftNETCoreAppRefPackageVersion,
55+
string newSDKVersion)
5056
{
5157
var projectXml = XDocument.Parse(stage0MicrosoftNETCoreAppRefPackageVersionContent);
5258

@@ -56,8 +62,10 @@ public static string ExecuteInternal(
5662

5763
var isSDKServicing = IsSDKServicing(propertyGroup.Element(ns + "NETCoreSdkVersion").Value);
5864

65+
propertyGroup.Element(ns + "NETCoreSdkVersion").Value = newSDKVersion;
66+
5967
var originalBundledNETCoreAppPackageVersion =
60-
propertyGroup.Element(ns + "BundledNETCoreAppPackageVersion").Value;
68+
propertyGroup.Element(ns + "BundledNETCoreAppPackageVersion").Value;
6169
propertyGroup.Element(ns + "BundledNETCoreAppPackageVersion").Value = microsoftNETCoreAppRefPackageVersion;
6270

6371
void CheckAndReplaceElement(XElement element)

src/Tests/HelixTasks/HelixTasks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<ItemGroup>
1010
<PackageReference Include="Microsoft.Build" Version="15.7.179" />
1111
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.7.179" />
12-
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
12+
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
1313
<PackageReference Include="System.Reflection.Metadata" Version="1.7.0" />
1414
<PackageReference Include="NuGet.ProjectModel" Version="$(NuGetProjectModelVersion)" />
1515
</ItemGroup>

src/Tests/Microsoft.NET.Build.Tests/WorkloadTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,14 @@ public void It_should_get_suggested_workload_by_GetRequiredWorkloads_target()
263263

264264
getValuesCommand.GetValues()
265265
.Should()
266-
.BeEquivalentTo("microsoft-android-sdk-full");
266+
.BeEquivalentTo("android");
267267
}
268268

269-
[Theory(Skip = "https://github.com/dotnet/sdk/issues/19866")]
270-
[InlineData("net6.0-android;net6.0-ios", "net6.0-android;net6.0-ios", "microsoft-android-sdk-full;microsoft-ios-sdk-full")]
271-
[InlineData("net6.0", "net6.0;net6.0-android;net6.0-ios", "microsoft-android-sdk-full;microsoft-ios-sdk-full")]
272-
[InlineData("net6.0;net6.0-ios", "net6.0;net6.0-android", "microsoft-android-sdk-full;microsoft-ios-sdk-full")]
273-
[InlineData("net6.0", "net6.0", null)]
269+
[Theory]
270+
[InlineData("net6.0-android;net6.0-ios", "net6.0-android;net6.0-ios", "android;android-aot")]
271+
[InlineData("net6.0", "net6.0;net6.0-android;net6.0-ios", "macos;android-aot")]
272+
[InlineData("net6.0;net6.0-ios", "net6.0;net6.0-android", "macos;android-aot")]
273+
[InlineData("net6.0", "net6.0", "macos")]
274274
public void Given_multi_target_It_should_get_suggested_workload_by_GetRequiredWorkloads_target(string mainTfm, string referencingTfm, string expected)
275275
{
276276
var mainProject = new TestProject()

0 commit comments

Comments
 (0)