@@ -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 )
0 commit comments