@@ -379,27 +379,37 @@ private static Job CreateJobForGivenRuntime(Job baseJob, string runtimeId, Comma
379
379
380
380
return baseJob . WithRuntime ( runtime ) . WithToolchain ( builder . ToToolchain ( ) ) ;
381
381
case RuntimeMoniker . Wasm :
382
- var wasmRuntime = new WasmRuntime (
383
- mainJs : options . WasmMainJs ,
384
- msBuildMoniker : "net5.0" ,
385
- javaScriptEngine : options . WasmJavascriptEngine ? . FullName ?? "v8" ,
386
- javaScriptEngineArguments : options . WasmJavaScriptEngineArguments ) ;
387
-
388
- var toolChain = WasmToolChain . From ( new NetCoreAppSettings (
389
- targetFrameworkMoniker : wasmRuntime . MsBuildMoniker ,
390
- runtimeFrameworkVersion : null ,
391
- name : wasmRuntime . Name ,
392
- customDotNetCliPath : options . CliPath ? . FullName ,
393
- packagesPath : options . RestorePath ? . FullName ,
394
- timeout : timeOut ?? NetCoreAppSettings . DefaultBuildTimeout ,
395
- customRuntimePack : options . CustomRuntimePack ) ) ;
382
+ return MakeWasmJob ( baseJob , options , timeOut , RuntimeInformation . IsNetCore ? CoreRuntime . GetCurrentVersion ( ) . MsBuildMoniker : "net5.0" ) ;
383
+ case RuntimeMoniker . WasmNet50 :
384
+ return MakeWasmJob ( baseJob , options , timeOut , "net5.0" ) ;
385
+ case RuntimeMoniker . WasmNet60 :
386
+ return MakeWasmJob ( baseJob , options , timeOut , "net6.0" ) ;
396
387
397
- return baseJob . WithRuntime ( wasmRuntime ) . WithToolchain ( toolChain ) ;
398
388
default :
399
389
throw new NotSupportedException ( $ "Runtime { runtimeId } is not supported") ;
400
390
}
401
391
}
402
392
393
+ private static Job MakeWasmJob ( Job baseJob , CommandLineOptions options , TimeSpan ? timeOut , string msBuildMoniker )
394
+ {
395
+ var wasmRuntime = new WasmRuntime (
396
+ mainJs : options . WasmMainJs ,
397
+ msBuildMoniker : msBuildMoniker ,
398
+ javaScriptEngine : options . WasmJavascriptEngine ? . FullName ?? "v8" ,
399
+ javaScriptEngineArguments : options . WasmJavaScriptEngineArguments ) ;
400
+
401
+ var toolChain = WasmToolChain . From ( new NetCoreAppSettings (
402
+ targetFrameworkMoniker : wasmRuntime . MsBuildMoniker ,
403
+ runtimeFrameworkVersion : null ,
404
+ name : wasmRuntime . Name ,
405
+ customDotNetCliPath : options . CliPath ? . FullName ,
406
+ packagesPath : options . RestorePath ? . FullName ,
407
+ timeout : timeOut ?? NetCoreAppSettings . DefaultBuildTimeout ,
408
+ customRuntimePack : options . CustomRuntimePack ) ) ;
409
+
410
+ return baseJob . WithRuntime ( wasmRuntime ) . WithToolchain ( toolChain ) ;
411
+ }
412
+
403
413
private static IEnumerable < IFilter > GetFilters ( CommandLineOptions options )
404
414
{
405
415
if ( options . Filters . Any ( ) )
0 commit comments