@@ -362,6 +362,56 @@ public void TrimmedAppsWithCulturesGetExtraImages(string rid, string expectedIma
362
362
computedBaseImageTag . Should ( ) . BeEquivalentTo ( expectedImage ) ;
363
363
}
364
364
365
+ [ InlineData ( "linux-musl-x64" , "mcr.microsoft.com/dotnet/runtime-deps:8.0-alpine" ) ]
366
+ [ InlineData ( "linux-x64" , "mcr.microsoft.com/dotnet/runtime-deps:8.0-jammy-chiseled" ) ]
367
+ [ Theory ]
368
+ public void TrimmedAppsWithoutCulturesGetbaseImages ( string rid , string expectedImage )
369
+ {
370
+ var ( project , logger , d ) = ProjectInitializer . InitProject ( new ( )
371
+ {
372
+ [ "NetCoreSdkVersion" ] = "8.0.100" ,
373
+ [ "TargetFrameworkVersion" ] = "v8.0" ,
374
+ [ KnownStrings . Properties . ContainerRuntimeIdentifier ] = rid ,
375
+ [ KnownStrings . Properties . PublishSelfContained ] = true . ToString ( ) ,
376
+ [ KnownStrings . Properties . PublishTrimmed ] = true . ToString ( ) ,
377
+ [ KnownStrings . Properties . InvariantGlobalization ] = true . ToString ( )
378
+ } , projectName : $ "{ nameof ( TrimmedAppsWithCulturesGetExtraImages ) } _{ rid } _{ expectedImage } ") ;
379
+ using var _ = d ;
380
+ var instance = project . CreateProjectInstance ( global ::Microsoft . Build . Execution . ProjectInstanceSettings . None ) ;
381
+ instance . Build ( new [ ] { ComputeContainerBaseImage } , null , null , out var outputs ) . Should ( ) . BeTrue ( String . Join ( Environment . NewLine , logger . Errors ) ) ;
382
+ var computedBaseImageTag = instance . GetProperty ( ContainerBaseImage ) ? . EvaluatedValue ;
383
+ computedBaseImageTag . Should ( ) . BeEquivalentTo ( expectedImage ) ;
384
+ }
385
+
386
+ [ InlineData ( true , false , "linux-musl-x64" , true , "mcr.microsoft.com/dotnet/runtime-deps:8.0-alpine" ) ]
387
+ [ InlineData ( true , false , "linux-musl-x64" , false , "mcr.microsoft.com/dotnet/runtime-deps:8.0-alpine-extra" ) ]
388
+ [ InlineData ( false , true , "linux-musl-x64" , true , "mcr.microsoft.com/dotnet/nightly/runtime-deps:8.0-alpine-aot" ) ]
389
+ [ InlineData ( false , true , "linux-musl-x64" , false , "mcr.microsoft.com/dotnet/runtime-deps:8.0-alpine-extra" ) ]
390
+
391
+ [ InlineData ( true , false , "linux-x64" , true , "mcr.microsoft.com/dotnet/runtime-deps:8.0-jammy-chiseled" ) ]
392
+ [ InlineData ( true , false , "linux-x64" , false , "mcr.microsoft.com/dotnet/runtime-deps:8.0-jammy-chiseled-extra" ) ]
393
+ [ InlineData ( false , true , "linux-x64" , true , "mcr.microsoft.com/dotnet/nightly/runtime-deps:8.0-jammy-chiseled-aot" ) ]
394
+ [ InlineData ( false , true , "linux-x64" , false , "mcr.microsoft.com/dotnet/runtime-deps:8.0-jammy-chiseled-extra" ) ]
395
+ [ Theory ]
396
+ public void TheBigMatrixOfTrimmingInference ( bool trimmed , bool aot , string rid , bool invariant , string expectedImage )
397
+ {
398
+ var ( project , logger , d ) = ProjectInitializer . InitProject ( new ( )
399
+ {
400
+ [ "NetCoreSdkVersion" ] = "8.0.100" ,
401
+ [ "TargetFrameworkVersion" ] = "v8.0" ,
402
+ [ KnownStrings . Properties . ContainerRuntimeIdentifier ] = rid ,
403
+ [ KnownStrings . Properties . PublishSelfContained ] = true . ToString ( ) ,
404
+ [ KnownStrings . Properties . PublishTrimmed ] = trimmed . ToString ( ) ,
405
+ [ KnownStrings . Properties . PublishAot ] = aot . ToString ( ) ,
406
+ [ KnownStrings . Properties . InvariantGlobalization ] = invariant . ToString ( )
407
+ } , projectName : $ "{ nameof ( TrimmedAppsWithCulturesGetExtraImages ) } _{ rid } _{ expectedImage } ") ;
408
+ using var _ = d ;
409
+ var instance = project . CreateProjectInstance ( global ::Microsoft . Build . Execution . ProjectInstanceSettings . None ) ;
410
+ instance . Build ( new [ ] { ComputeContainerBaseImage } , null , null , out var outputs ) . Should ( ) . BeTrue ( String . Join ( Environment . NewLine , logger . Errors ) ) ;
411
+ var computedBaseImageTag = instance . GetProperty ( ContainerBaseImage ) ? . EvaluatedValue ;
412
+ computedBaseImageTag . Should ( ) . BeEquivalentTo ( expectedImage ) ;
413
+ }
414
+
365
415
[ InlineData ( "linux-musl-x64" , "mcr.microsoft.com/dotnet/runtime-deps:7.0-alpine" ) ]
366
416
[ InlineData ( "linux-x64" , "mcr.microsoft.com/dotnet/runtime-deps:7.0" ) ]
367
417
[ Theory ]
0 commit comments