@@ -467,12 +467,21 @@ private void CopyStagingAreaIntoDestination(BuildPostProcessArgs args, HashSet<s
467467 {
468468 destinationFolder = Directory . GetCurrentDirectory ( ) ;
469469 }
470+
471+ HashSet < string > fileExtensionsToInclude = new HashSet < string >
472+ {
473+ ".exe" ,
474+ ".dll" ,
475+ ".winmd" ,
476+ ".pdb" ,
477+ } ;
478+
470479 // Copy entire staging area over
471- CopyFilesToDestination ( args . stagingArea , destinationFolder , filesToNotOverwrite ) ;
480+ CopyFilesToDestination ( args . stagingArea , destinationFolder , filesToNotOverwrite , fileExtensionsToInclude ) ;
472481 args . report . RecordFilesMoved ( args . stagingArea , destinationFolder ) ;
473482 }
474483
475- private static void CopyFilesToDestination ( string source , string target , HashSet < string > filesToNotOverwrite )
484+ private static void CopyFilesToDestination ( string source , string target , HashSet < string > filesToNotOverwrite , HashSet < string > fileExtensionsToIncludeInManagedDirectory )
476485 {
477486 if ( ! Directory . Exists ( target ) )
478487 {
@@ -481,6 +490,9 @@ private static void CopyFilesToDestination(string source, string target, HashSet
481490
482491 foreach ( string sourceFile in Directory . GetFiles ( source ) )
483492 {
493+ if ( Path . GetDirectoryName ( source ) == "Managed" && ! fileExtensionsToIncludeInManagedDirectory . Contains ( Path . GetExtension ( sourceFile ) ) )
494+ continue ;
495+
484496 var targetFile = Path . Combine ( target , Path . GetFileName ( sourceFile ) ) ;
485497
486498 if ( File . Exists ( targetFile ) )
@@ -495,7 +507,7 @@ private static void CopyFilesToDestination(string source, string target, HashSet
495507 }
496508
497509 foreach ( var directory in Directory . GetDirectories ( source ) )
498- CopyFilesToDestination ( directory , Path . Combine ( target , Path . GetFileName ( directory ) ) , filesToNotOverwrite ) ;
510+ CopyFilesToDestination ( directory , Path . Combine ( target , Path . GetFileName ( directory ) ) , filesToNotOverwrite , fileExtensionsToIncludeInManagedDirectory ) ;
499511 }
500512
501513 protected abstract string GetStagingAreaPluginsFolder ( BuildPostProcessArgs args ) ;
0 commit comments