9
9
#addin nuget: ? package = Mono . ApiTools . NuGetDiff & version = 1.3 .2
10
10
#addin nuget: ? package = Xamarin . Nuget . Validator & version = 1.1 .1
11
11
12
- #tool nuget: ? package = mdoc & version = 5.8 .3
12
+ #tool nuget: ? package = mdoc & version = 5.8 .9
13
13
#tool nuget: ? package = xunit . runner . console & version = 2.4 .1
14
14
#tool nuget: ? package = vswhere & version = 2.8 .4
15
15
@@ -450,7 +450,7 @@ Task ("samples")
450
450
{ "xamarin.forms.windows" , "x86" } ,
451
451
} ;
452
452
453
- void BuildSample ( FilePath sln )
453
+ void BuildSample ( FilePath sln , bool dryrun )
454
454
{
455
455
var platform = sln . GetDirectory ( ) . GetDirectoryName ( ) . ToLower ( ) ;
456
456
var name = sln . GetFilenameWithoutExtension ( ) ;
@@ -470,12 +470,19 @@ Task ("samples")
470
470
buildPlatform = platformMatrix [ platform ] ;
471
471
}
472
472
473
- Information ( $ "Building { sln } ({ platform } )...") ;
474
-
475
- RunNuGetRestorePackagesConfig ( sln ) ;
476
- RunMSBuild ( sln , platform : buildPlatform ) ;
473
+ if ( dryrun ) {
474
+ Information ( $ " BUILD { sln } ") ;
475
+ } else {
476
+ Information ( $ "Building sample { sln } ({ platform } )...") ;
477
+ RunNuGetRestorePackagesConfig ( sln ) ;
478
+ RunMSBuild ( sln , platform : buildPlatform ) ;
479
+ }
477
480
} else {
478
- Information ( $ "Skipping { sln } ({ platform } )...") ;
481
+ if ( dryrun ) {
482
+ Information ( $ " SKIP (NS) { sln } (not supported)") ;
483
+ } else {
484
+ Information ( $ "Skipping sample { sln } ({ platform } )...") ;
485
+ }
479
486
}
480
487
}
481
488
@@ -511,38 +518,49 @@ Task ("samples")
511
518
Information ( " " + sln ) ;
512
519
}
513
520
514
- foreach ( var sln in solutions ) {
515
- // might have been deleted due to a platform build and cleanup
516
- if ( ! FileExists ( sln ) )
517
- continue ;
518
-
519
- var name = sln . GetFilenameWithoutExtension ( ) ;
520
- var slnPlatform = name . GetExtension ( ) ;
521
-
522
- if ( string . IsNullOrEmpty ( slnPlatform ) ) {
523
- // this is the main solution
524
- var variants = GetFiles ( sln . GetDirectory ( ) . CombineWithFilePath ( name ) + ".*.sln" ) ;
525
- if ( ! variants . Any ( ) ) {
526
- // there is no platform variant
527
- BuildSample ( sln ) ;
528
- // delete the built sample
529
- CleanDirectories ( sln . GetDirectory ( ) . FullPath ) ;
530
- } else {
531
- // skip as there is a platform variant
532
- }
533
- } else {
534
- // this is a platform variant
535
- slnPlatform = slnPlatform . ToLower ( ) ;
536
- var shouldBuild =
537
- ( isLinux && slnPlatform == ".linux" ) ||
538
- ( isMac && slnPlatform == ".mac" ) ||
539
- ( isWin && slnPlatform == ".windows" ) ;
540
- if ( shouldBuild ) {
541
- BuildSample ( sln ) ;
542
- // delete the built sample
543
- CleanDirectories ( sln . GetDirectory ( ) . FullPath ) ;
521
+ foreach ( var dryrun in new [ ] { true , false } ) {
522
+ if ( dryrun )
523
+ Information ( "Sample builds:" ) ;
524
+
525
+ foreach ( var sln in solutions ) {
526
+ // might have been deleted due to a platform build and cleanup
527
+ if ( ! FileExists ( sln ) )
528
+ continue ;
529
+
530
+ var name = sln . GetFilenameWithoutExtension ( ) ;
531
+ var slnPlatform = name . GetExtension ( ) ;
532
+
533
+ if ( string . IsNullOrEmpty ( slnPlatform ) ) {
534
+ // this is the main solution
535
+ var variants = GetFiles ( sln . GetDirectory ( ) . CombineWithFilePath ( name ) + ".*.sln" ) ;
536
+ if ( ! variants . Any ( ) ) {
537
+ // there is no platform variant
538
+ BuildSample ( sln , dryrun ) ;
539
+ // delete the built sample
540
+ if ( ! dryrun )
541
+ CleanDirectories ( sln . GetDirectory ( ) . FullPath ) ;
542
+ } else {
543
+ // skip as there is a platform variant
544
+ if ( dryrun )
545
+ Information ( $ " SKIP (PS) { sln } (has platform specific)") ;
546
+ }
544
547
} else {
545
- // skip this as this is not the correct platform
548
+ // this is a platform variant
549
+ slnPlatform = slnPlatform . ToLower ( ) ;
550
+ var shouldBuild =
551
+ ( isLinux && slnPlatform == ".linux" ) ||
552
+ ( isMac && slnPlatform == ".mac" ) ||
553
+ ( isWin && slnPlatform == ".windows" ) ;
554
+ if ( shouldBuild ) {
555
+ BuildSample ( sln , dryrun ) ;
556
+ // delete the built sample
557
+ if ( ! dryrun )
558
+ CleanDirectories ( sln . GetDirectory ( ) . FullPath ) ;
559
+ } else {
560
+ // skip this as this is not the correct platform
561
+ if ( dryrun )
562
+ Information ( $ " SKIP (AP) { sln } (has alternate platform)") ;
563
+ }
546
564
}
547
565
}
548
566
}
0 commit comments