@@ -23,7 +23,7 @@ public enum PackageType
2323 {
2424 new object [ ] { "Microsoft.Build.NoTargets" , "3.7.0" , PackageType . Text } ,
2525 new object [ ] { "Microsoft.Extensions.Logging.Abstractions" , "6.0.4" , PackageType . Reference } ,
26- new object [ ] { "NuGet.Protocol " , "6.12.1" , PackageType . Reference } ,
26+ new object [ ] { "NuGet.Packaging " , "6.12.1" , PackageType . Reference } ,
2727 new object [ ] { "System.Buffers" , "4.6.0" , PackageType . Reference } ,
2828 new object [ ] { "System.Security.Cryptography.ProtectedData" , "8.0.0" , PackageType . Reference } ,
2929 } ;
@@ -64,14 +64,27 @@ public void VerifyGenerateScript(string package, string version, PackageType typ
6464
6565 ExecuteHelper . ExecuteProcessValidateExitCode ( command , arguments , Output ) ;
6666
67+ // Copy any customization files from the source directory to the sandbox directory.
68+ // This is necessary because git diff doesn't support exclusions when comparing files outside of the repository.
69+ string [ ] customFiles = { "Customizations.cs" , "Customizations.props" } ;
70+ foreach ( string customFile in customFiles )
71+ {
72+ string srcFile = Path . Combine ( pkgSrcDirectory , customFile ) ;
73+ if ( File . Exists ( srcFile ) )
74+ {
75+ string destFile = Path . Combine ( pkgSandboxDirectory , customFile ) ;
76+ File . Copy ( srcFile , destFile ) ;
77+ }
78+ }
79+
6780 ( Process Process , string StdOut , string StdErr ) result =
6881 ExecuteHelper . ExecuteProcess ( "git" , $ "diff --no-index { pkgSrcDirectory } { pkgSandboxDirectory } ", Output , true ) ;
6982
7083 string diff = result . StdOut ;
7184 if ( diff != string . Empty )
7285 {
7386 Assert . Fail ( $ "Regenerated package '{ package } , { version } ' does not match the checked-in content. { Environment . NewLine } "
74- + $ "{ diff } { Environment . NewLine } ") ;
87+ + $ "{ diff } { Environment . NewLine } ") ;
7588 }
7689 else if ( result . Process . ExitCode != 0 )
7790 {
0 commit comments