@@ -23,7 +23,7 @@ public enum PackageType
23
23
{
24
24
new object [ ] { "Microsoft.Build.NoTargets" , "3.7.0" , PackageType . Text } ,
25
25
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 } ,
27
27
new object [ ] { "System.Buffers" , "4.6.0" , PackageType . Reference } ,
28
28
new object [ ] { "System.Security.Cryptography.ProtectedData" , "8.0.0" , PackageType . Reference } ,
29
29
} ;
@@ -64,14 +64,27 @@ public void VerifyGenerateScript(string package, string version, PackageType typ
64
64
65
65
ExecuteHelper . ExecuteProcessValidateExitCode ( command , arguments , Output ) ;
66
66
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
+
67
80
( Process Process , string StdOut , string StdErr ) result =
68
81
ExecuteHelper . ExecuteProcess ( "git" , $ "diff --no-index { pkgSrcDirectory } { pkgSandboxDirectory } ", Output , true ) ;
69
82
70
83
string diff = result . StdOut ;
71
84
if ( diff != string . Empty )
72
85
{
73
86
Assert . Fail ( $ "Regenerated package '{ package } , { version } ' does not match the checked-in content. { Environment . NewLine } "
74
- + $ "{ diff } { Environment . NewLine } ") ;
87
+ + $ "{ diff } { Environment . NewLine } ") ;
75
88
}
76
89
else if ( result . Process . ExitCode != 0 )
77
90
{
0 commit comments