@@ -106,7 +106,7 @@ private static bool Validate(CommandLineOptions options, ILogger logger)
106106
107107 foreach ( string runtime in options . Runtimes )
108108 {
109- if ( ! TryParse ( runtime , out RuntimeMoniker runtimeMoniker ) )
109+ if ( ! TryParse ( runtime , out RuntimeMoniker runtimeMoniker , out _ ) )
110110 {
111111 logger . WriteLineError ( $ "The provided runtime \" { runtime } \" is invalid. Available options are: { string . Join ( ", " , Enum . GetNames ( typeof ( RuntimeMoniker ) ) . Select ( name => name . ToLower ( ) ) ) } .") ;
112112 return false ;
@@ -359,7 +359,7 @@ private static IEnumerable<Job> Expand(Job baseJob, CommandLineOptions options,
359359
360360 private static Job CreateJobForGivenRuntime ( Job baseJob , string runtimeId , CommandLineOptions options )
361361 {
362- if ( ! TryParse ( runtimeId , out RuntimeMoniker runtimeMoniker ) )
362+ if ( ! TryParse ( runtimeId , out RuntimeMoniker runtimeMoniker , out string platformSpecificPostfix ) )
363363 {
364364 throw new InvalidOperationException ( "Impossible, already validated by the Validate method" ) ;
365365 }
@@ -373,9 +373,10 @@ private static Job CreateJobForGivenRuntime(Job baseJob, string runtimeId, Comma
373373 case RuntimeMoniker . Net472 :
374374 case RuntimeMoniker . Net48 :
375375 case RuntimeMoniker . Net481 :
376+ var clrRuntime = runtimeMoniker . GetRuntime ( ) ;
376377 return baseJob
377- . WithRuntime ( runtimeMoniker . GetRuntime ( ) )
378- . WithToolchain ( CsProjClassicNetToolchain . From ( runtimeId , options . RestorePath ? . FullName ) ) ;
378+ . WithRuntime ( clrRuntime )
379+ . WithToolchain ( CsProjClassicNetToolchain . From ( clrRuntime . MsBuildMoniker , clrRuntime . Name , options . RestorePath ? . FullName ) ) ;
379380 case RuntimeMoniker . NetCoreApp20 :
380381 case RuntimeMoniker . NetCoreApp21 :
381382 case RuntimeMoniker . NetCoreApp22 :
@@ -387,9 +388,10 @@ private static Job CreateJobForGivenRuntime(Job baseJob, string runtimeId, Comma
387388 case RuntimeMoniker . Net50 :
388389 case RuntimeMoniker . Net60 :
389390 case RuntimeMoniker . Net70 :
391+ var coreRuntime = runtimeMoniker . GetRuntime ( ) ;
390392 return baseJob
391- . WithRuntime ( runtimeMoniker . GetRuntime ( ) )
392- . WithToolchain ( CsProjCoreToolchain . From ( new NetCoreAppSettings ( runtimeId , null , runtimeId , options . CliPath ? . FullName , options . RestorePath ? . FullName ) ) ) ;
393+ . WithRuntime ( coreRuntime )
394+ . WithToolchain ( CsProjCoreToolchain . From ( new NetCoreAppSettings ( coreRuntime . MsBuildMoniker + platformSpecificPostfix , null , coreRuntime . Name + platformSpecificPostfix , options . CliPath ? . FullName , options . RestorePath ? . FullName ) ) ) ;
393395 case RuntimeMoniker . Mono :
394396 return baseJob . WithRuntime ( new MonoRuntime ( "Mono" , options . MonoPath ? . FullName ) ) ;
395397 case RuntimeMoniker . NativeAot60 :
@@ -432,6 +434,7 @@ private static Job CreateAotJob(Job baseJob, CommandLineOptions options, Runtime
432434 builder . UseNuGet ( ilCompilerVersion , nuGetFeedUrl ) ;
433435
434436 var runtime = runtimeMoniker . GetRuntime ( ) ;
437+ builder . DisplayName ( runtime . Name ) ;
435438 builder . TargetFrameworkMoniker ( runtime . MsBuildMoniker ) ;
436439
437440 return baseJob . WithRuntime ( runtime ) . WithToolchain ( builder . ToToolchain ( ) ) ;
@@ -564,13 +567,20 @@ private static string GetCoreRunToolchainDisplayName(IReadOnlyList<FileInfo> pat
564567 return coreRunPath . FullName . Substring ( lastCommonDirectorySeparatorIndex ) ;
565568 }
566569
567- private static bool TryParse ( string runtime , out RuntimeMoniker runtimeMoniker )
570+ private static bool TryParse ( string runtime , out RuntimeMoniker runtimeMoniker , out string platformSpecificPostfix )
568571 {
569572 int index = runtime . IndexOf ( '-' ) ;
570573
571- return index < 0
572- ? Enum . TryParse < RuntimeMoniker > ( runtime . Replace ( "." , string . Empty ) , ignoreCase : true , out runtimeMoniker )
573- : Enum . TryParse < RuntimeMoniker > ( runtime . Substring ( 0 , index ) . Replace ( "." , string . Empty ) , ignoreCase : true , out runtimeMoniker ) ;
574+ if ( index < 0 )
575+ {
576+ platformSpecificPostfix = "" ;
577+ return Enum . TryParse < RuntimeMoniker > ( runtime . Replace ( "." , string . Empty ) , ignoreCase : true , out runtimeMoniker ) ;
578+ }
579+ else
580+ {
581+ platformSpecificPostfix = runtime . Substring ( index ) . ToLower ( ) ;
582+ return Enum . TryParse < RuntimeMoniker > ( runtime . Substring ( 0 , index ) . Replace ( "." , string . Empty ) , ignoreCase : true , out runtimeMoniker ) ;
583+ }
574584 }
575585 }
576586}
0 commit comments