@@ -12,36 +12,6 @@ namespace PostSharp.Engineering.BuildTools.Build.Files;
1212/// </summary>
1313internal static class GlobalJsonFile
1414{
15- /// <summary>
16- /// Cleans a version string returned by dotnet-install.ps1.
17- /// </summary>
18- private static string ? CleanSdkVersion ( BuildContext context , string ? input )
19- {
20- if ( input == null )
21- {
22- return null ;
23- }
24-
25- var versionParts = input . Split ( '-' ) ;
26-
27- var version = versionParts . Length > 1 && (
28-
29- // On Linux, the dotnet-install.ps1 returns a version with "-servicing.<build>" suffix, but the SDK version is without it.
30- versionParts [ 1 ] . StartsWith ( "servicing" , StringComparison . Ordinal )
31-
32- // On Linux, the dotnet-install.ps1 returns a version with "-rtm.<build>" suffix, but the SDK version is without it.
33- || versionParts [ 1 ] . StartsWith ( "rtm" , StringComparison . Ordinal ) )
34- ? versionParts [ 0 ]
35- : input ;
36-
37- if ( version != input )
38- {
39- context . Console . WriteImportantMessage ( $ "Overriding version { input } to { version } ." ) ;
40- }
41-
42- return version ;
43- }
44-
4515 internal static bool TryWrite ( BuildContext context , string ? overrideSdkVersion = null )
4616 {
4717 var product = context . Product ;
@@ -84,7 +54,7 @@ internal static bool TryWrite( BuildContext context, string? overrideSdkVersion
8454 {
8555 "//": "This file is generated by PostSharp.Engineering. Do not edit or add to git.",
8656 "sdk": {
87- "version": "{{ CleanSdkVersion ( context , overrideSdkVersion ) ?? product . DotNetSdkVersion . Version }} ",
57+ "version": "{{ overrideSdkVersion ?? product . DotNetSdkVersion . Version }} ",
8858 "rollForward": "{{ rollForward }} ",
8959 "allowPrerelease": {{ product . DotNetSdkVersion . AllowPrerelease . ToString ( ) . ToLowerInvariant ( ) }}
9060 },
0 commit comments