Skip to content

Commit 1188193

Browse files
committed
Update the RID for the sdk to be the target rid for stage2
1 parent ca8e965 commit 1188193

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/Layout/redist/targets/OverlaySdkOnLKG.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
Stage0MicrosoftNETCoreAppRefPackageVersionPath="$(_DotNetHiveRoot)/sdk/$(Stage0SdkVersion)/Microsoft.NETCoreSdk.BundledVersions.props"
3535
MicrosoftNETCoreAppRefPackageVersion="$(MicrosoftNETCoreAppRefPackageVersion)"
3636
NewSDKVersion="$(Version)"
37+
TargetRid="$(TargetRid)"
3738
OutputPath="$(RedistInstallerLayoutPath)/sdk/$(Version)/Microsoft.NETCoreSdk.BundledVersions.props"/>
3839

3940
<!-- Copy artifacts to the testhost folder. -->

src/Tasks/sdk-tasks/OverrideAndCreateBundledNETCoreAppPackageVersion.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ namespace Microsoft.DotNet.Build.Tasks
2020
/// and then update the stage 0 back.
2121
///
2222
/// Override NETCoreSdkVersion to stage 0 sdk version like 6.0.100-dev
23+
/// Override NETCoreSdkRuntimeIdentifier and NETCoreSdkPortableRuntimeIdentifier to match the target RID
2324
///
2425
/// Use a task to override since it was generated as a string literal replace anyway.
2526
/// And using C# can have better error when anything goes wrong.
@@ -37,6 +38,8 @@ public sealed class OverrideAndCreateBundledNETCoreAppPackageVersion : Task
3738

3839
[Required] public string NewSDKVersion { get; set; }
3940

41+
[Required] public string TargetRid { get; set; }
42+
4043
[Required] public string OutputPath { get; set; }
4144

4245
public override bool Execute()
@@ -46,6 +49,7 @@ public override bool Execute()
4649
File.ReadAllText(Stage0MicrosoftNETCoreAppRefPackageVersionPath),
4750
MicrosoftNETCoreAppRefPackageVersion,
4851
NewSDKVersion,
52+
TargetRid,
4953
Log));
5054
return true;
5155
}
@@ -54,6 +58,7 @@ public static string ExecuteInternal(
5458
string stage0MicrosoftNETCoreAppRefPackageVersionContent,
5559
string microsoftNETCoreAppRefPackageVersion,
5660
string newSDKVersion,
61+
string targetRid,
5762
TaskLoggingHelper log = null)
5863
{
5964
var projectXml = XDocument.Parse(stage0MicrosoftNETCoreAppRefPackageVersionContent);
@@ -63,6 +68,8 @@ public static string ExecuteInternal(
6368
var propertyGroup = projectXml.Root.Elements(ns + "PropertyGroup").First();
6469

6570
propertyGroup.Element(ns + "NETCoreSdkVersion").Value = newSDKVersion;
71+
propertyGroup.Element(ns + "NETCoreSdkRuntimeIdentifier").Value = targetRid;
72+
propertyGroup.Element(ns + "NETCoreSdkPortableRuntimeIdentifier").Value = targetRid;
6673

6774

6875
var originalBundledNETCoreAppPackageVersion = propertyGroup.Element(ns + "BundledNETCoreAppPackageVersion").Value;

0 commit comments

Comments
 (0)