dependabot-nuget 0.288.0 → 0.289.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/helpers/lib/NuGetUpdater/Directory.Packages.props +19 -17
  3. data/helpers/lib/NuGetUpdater/NuGetProjects/NuGet.Packaging/NuGet.Packaging.csproj +0 -1
  4. data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Analyze.cs +3 -1
  5. data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Discover.cs +23 -3
  6. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/AnalyzeWorker.cs +30 -15
  7. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/CompatabilityChecker.cs +1 -1
  8. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/RequirementArrayConverter.cs +39 -0
  9. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/VersionFinder.cs +1 -1
  10. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Clone/ShellGitCommandHandler.cs +1 -1
  11. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs +60 -66
  12. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DotNetToolsJsonDiscovery.cs +2 -2
  13. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/GlobalJsonDiscovery.cs +2 -2
  14. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/PackagesConfigDiscovery.cs +11 -3
  15. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/PackagesConfigDiscoveryResult.cs +1 -0
  16. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/ProjectDiscoveryResult.cs +2 -4
  17. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/SdkProjectDiscovery.cs +54 -11
  18. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/WorkspaceDiscoveryResult.cs +0 -1
  19. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/ExperimentsManager.cs +1 -2
  20. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Files/JsonBuildFile.cs +1 -1
  21. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/FrameworkChecker/CompatabilityChecker.cs +2 -2
  22. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/RunWorker.cs +43 -54
  23. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/BindingRedirectManager.cs +13 -43
  24. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/DotNetToolsJsonUpdater.cs +4 -4
  25. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/GlobalJsonUpdater.cs +5 -5
  26. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/LockFileUpdater.cs +2 -10
  27. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/PackageReferenceUpdater.cs +38 -33
  28. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/PackagesConfigUpdater.cs +12 -11
  29. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdaterWorker.cs +16 -12
  30. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/ConsoleLogger.cs +1 -1
  31. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/DependencyConflictResolver.cs +19 -19
  32. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/ILogger.cs +11 -1
  33. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +18 -17
  34. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/NuGetHelper.cs +1 -17
  35. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/PathHelper.cs +17 -9
  36. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/ProjectHelper.cs +96 -0
  37. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Analyze/AnalyzeWorkerTests.cs +87 -5
  38. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTestBase.cs +2 -5
  39. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.PackagesConfig.cs +16 -0
  40. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Proj.cs +6 -0
  41. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Project.cs +147 -36
  42. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.cs +184 -48
  43. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/ExpectedDiscoveryResults.cs +5 -5
  44. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/SdkProjectDiscoveryTests.cs +32 -10
  45. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/RunWorkerTests.cs +400 -76
  46. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/SerializationTests.cs +2 -2
  47. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdatedDependencyListTests.cs +60 -2
  48. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/TestLogger.cs +1 -1
  49. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/BindingRedirectsTests.cs +1 -1
  50. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs +4 -2
  51. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackageReference.cs +40 -0
  52. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs +1 -1
  53. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/AssertEx.cs +1 -1
  54. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/LinuxOnlyAttribute.cs +12 -0
  55. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +8 -5
  56. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/PathHelperTests.cs +47 -2
  57. data/lib/dependabot/nuget/analysis/analysis_json_reader.rb +3 -1
  58. data/lib/dependabot/nuget/file_fetcher.rb +12 -393
  59. data/lib/dependabot/nuget/file_parser.rb +23 -60
  60. data/lib/dependabot/nuget/file_updater.rb +21 -16
  61. data/lib/dependabot/nuget/native_discovery/native_dependency_file_discovery.rb +2 -9
  62. data/lib/dependabot/nuget/native_discovery/native_discovery_json_reader.rb +183 -77
  63. data/lib/dependabot/nuget/native_discovery/native_project_discovery.rb +25 -3
  64. data/lib/dependabot/nuget/native_discovery/native_workspace_discovery.rb +1 -8
  65. data/lib/dependabot/nuget/native_update_checker/native_update_checker.rb +17 -4
  66. metadata +8 -9
  67. data/helpers/lib/NuGetUpdater/NuGetProjects/Directory.Packages.props +0 -29
  68. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/RequirementConverter.cs +0 -17
  69. data/lib/dependabot/nuget/file_fetcher/import_paths_finder.rb +0 -73
  70. data/lib/dependabot/nuget/file_fetcher/sln_project_paths_finder.rb +0 -60
@@ -57,12 +57,14 @@ public partial class DiscoveryWorkerTests
57
57
  new("TargetFrameworks", "net7.0;net8.0", "myproj.csproj"),
58
58
  ],
59
59
  TargetFrameworks = ["net7.0"], // net8.0 has no packages and is not reported
60
+ ReferencedProjectPaths = [],
61
+ ImportedFiles = [
62
+ "Directory.Build.props",
63
+ "Directory.Packages.props",
64
+ ],
65
+ AdditionalFiles = [],
60
66
  },
61
67
  ],
62
- ImportedFiles = [
63
- "Directory.Build.props",
64
- "Directory.Packages.props",
65
- ],
66
68
  }
67
69
  );
68
70
  }
@@ -119,12 +121,14 @@ public partial class DiscoveryWorkerTests
119
121
  new("TargetFrameworks", "net7.0;net8.0", "myproj.csproj"),
120
122
  ],
121
123
  TargetFrameworks = ["net7.0", "net8.0"],
124
+ ReferencedProjectPaths = [],
125
+ ImportedFiles = [
126
+ "Directory.Build.props",
127
+ "Directory.Packages.props",
128
+ ],
129
+ AdditionalFiles = [],
122
130
  },
123
131
  ],
124
- ImportedFiles = [
125
- "Directory.Build.props",
126
- "Directory.Packages.props",
127
- ],
128
132
  }
129
133
  );
130
134
  }
@@ -187,12 +191,14 @@ public partial class DiscoveryWorkerTests
187
191
  new("TargetFramework", "net8.0", "project.csproj"),
188
192
  ],
189
193
  TargetFrameworks = ["net8.0"],
194
+ ReferencedProjectPaths = [],
195
+ ImportedFiles = [
196
+ "Directory.Build.props",
197
+ "Directory.Build.targets",
198
+ ],
199
+ AdditionalFiles = [],
190
200
  }
191
201
  ],
192
- ImportedFiles = [
193
- "Directory.Build.props",
194
- "Directory.Build.targets"
195
- ],
196
202
  }
197
203
  );
198
204
  }
@@ -255,12 +261,14 @@ public partial class DiscoveryWorkerTests
255
261
  new("TargetFramework", "net8.0", "project.csproj"),
256
262
  ],
257
263
  TargetFrameworks = ["net8.0"],
264
+ ReferencedProjectPaths = [],
265
+ ImportedFiles = [
266
+ "Directory.Build.props",
267
+ "Directory.Build.targets"
268
+ ],
269
+ AdditionalFiles = [],
258
270
  }
259
271
  ],
260
- ImportedFiles = [
261
- "Directory.Build.props",
262
- "Directory.Build.targets"
263
- ],
264
272
  }
265
273
  );
266
274
  }
@@ -308,11 +316,13 @@ public partial class DiscoveryWorkerTests
308
316
  new("TargetFramework", "net8.0", "project.csproj"),
309
317
  ],
310
318
  TargetFrameworks = ["net8.0"],
319
+ ReferencedProjectPaths = [],
320
+ ImportedFiles = [
321
+ "Directory.Packages.props"
322
+ ],
323
+ AdditionalFiles = [],
311
324
  },
312
325
  ],
313
- ImportedFiles = [
314
- "Directory.Packages.props",
315
- ]
316
326
  }
317
327
  );
318
328
  }
@@ -360,11 +370,13 @@ public partial class DiscoveryWorkerTests
360
370
  new("TargetFramework", "net8.0", "project.csproj"),
361
371
  ],
362
372
  TargetFrameworks = ["net8.0"],
373
+ ReferencedProjectPaths = [],
374
+ ImportedFiles = [
375
+ "Directory.Packages.props"
376
+ ],
377
+ AdditionalFiles = [],
363
378
  },
364
379
  ],
365
- ImportedFiles = [
366
- "Directory.Packages.props",
367
- ]
368
380
  }
369
381
  );
370
382
  }
@@ -426,14 +438,16 @@ public partial class DiscoveryWorkerTests
426
438
  new("TargetFramework", "net7.0", "myproj.csproj"),
427
439
  ],
428
440
  TargetFrameworks = ["net7.0"],
441
+ ReferencedProjectPaths = [],
442
+ ImportedFiles = [
443
+ "Directory.Build.targets",
444
+ "NUGET_PACKAGES/microsoft.build.centralpackageversions/2.1.3/Sdk/Sdk.props", // this is an artifact of the package cache existing next to the csproj
445
+ "NUGET_PACKAGES/microsoft.build.centralpackageversions/2.1.3/Sdk/Sdk.targets", // this is an artifact of the package cache existing next to the csproj
446
+ "Packages.props",
447
+ ],
448
+ AdditionalFiles = [],
429
449
  },
430
450
  ],
431
- ImportedFiles = [
432
- "Directory.Build.targets",
433
- "NUGET_PACKAGES/microsoft.build.centralpackageversions/2.1.3/Sdk/Sdk.props", // this is an artifact of the package cache existing next to the csproj
434
- "NUGET_PACKAGES/microsoft.build.centralpackageversions/2.1.3/Sdk/Sdk.targets", // this is an artifact of the package cache existing next to the csproj
435
- "Packages.props",
436
- ]
437
451
  }
438
452
  );
439
453
  }
@@ -496,14 +510,16 @@ public partial class DiscoveryWorkerTests
496
510
  new("TargetFramework", "net7.0", "myproj.csproj"),
497
511
  ],
498
512
  TargetFrameworks = ["net7.0"],
513
+ ReferencedProjectPaths = [],
514
+ ImportedFiles = [
515
+ "Directory.Build.targets",
516
+ "NUGET_PACKAGES/microsoft.build.centralpackageversions/2.1.3/Sdk/Sdk.props", // this is an artifact of the package cache existing next to the csproj
517
+ "NUGET_PACKAGES/microsoft.build.centralpackageversions/2.1.3/Sdk/Sdk.targets", // this is an artifact of the package cache existing next to the csproj
518
+ "Packages.props",
519
+ ],
520
+ AdditionalFiles = [],
499
521
  },
500
522
  ],
501
- ImportedFiles = [
502
- "Directory.Build.targets",
503
- "NUGET_PACKAGES/microsoft.build.centralpackageversions/2.1.3/Sdk/Sdk.props", // this is an artifact of the package cache existing next to the csproj
504
- "NUGET_PACKAGES/microsoft.build.centralpackageversions/2.1.3/Sdk/Sdk.targets", // this is an artifact of the package cache existing next to the csproj
505
- "Packages.props",
506
- ]
507
523
  }
508
524
  );
509
525
  }
@@ -547,6 +563,9 @@ public partial class DiscoveryWorkerTests
547
563
  new("TargetFramework", "net8.0", "myproj.csproj"),
548
564
  ],
549
565
  TargetFrameworks = ["net8.0"],
566
+ ReferencedProjectPaths = [],
567
+ ImportedFiles = [],
568
+ AdditionalFiles = [],
550
569
  }
551
570
  ],
552
571
  }
@@ -592,6 +611,9 @@ public partial class DiscoveryWorkerTests
592
611
  new("TargetFramework", "net8.0", "myproj.csproj"),
593
612
  ],
594
613
  TargetFrameworks = ["net8.0"],
614
+ ReferencedProjectPaths = [],
615
+ ImportedFiles = [],
616
+ AdditionalFiles = [],
595
617
  }
596
618
  ],
597
619
  }
@@ -641,9 +663,13 @@ public partial class DiscoveryWorkerTests
641
663
  new("TargetFramework", "net8.0", "myproj.csproj"),
642
664
  ],
643
665
  TargetFrameworks = ["net8.0"],
666
+ ReferencedProjectPaths = [],
667
+ ImportedFiles = [
668
+ "Directory.Build.props"
669
+ ],
670
+ AdditionalFiles = [],
644
671
  }
645
672
  ],
646
- ImportedFiles = ["Directory.Build.props"],
647
673
  }
648
674
  );
649
675
  }
@@ -692,9 +718,13 @@ public partial class DiscoveryWorkerTests
692
718
  new("TargetFramework", "$(SomeTfm)", "myproj.csproj"),
693
719
  ],
694
720
  TargetFrameworks = ["net8.0"],
721
+ ReferencedProjectPaths = [],
722
+ ImportedFiles = [
723
+ "Directory.Build.props"
724
+ ],
725
+ AdditionalFiles = [],
695
726
  }
696
727
  ],
697
- ImportedFiles = ["Directory.Build.props"],
698
728
  }
699
729
  );
700
730
  }
@@ -765,6 +795,9 @@ public partial class DiscoveryWorkerTests
765
795
  new("TargetFramework", "net8.0", "myproj.csproj"),
766
796
  ],
767
797
  TargetFrameworks = ["net8.0"],
798
+ ReferencedProjectPaths = [],
799
+ ImportedFiles = [],
800
+ AdditionalFiles = [],
768
801
  }
769
802
  ]
770
803
  }
@@ -812,6 +845,9 @@ public partial class DiscoveryWorkerTests
812
845
  new("TargetFrameworks", "net7.0;net8.0", "myproj.csproj"),
813
846
  ],
814
847
  TargetFrameworks = ["net7.0", "net8.0"],
848
+ ReferencedProjectPaths = [],
849
+ ImportedFiles = [],
850
+ AdditionalFiles = [],
815
851
  }
816
852
  ],
817
853
  }
@@ -857,6 +893,9 @@ public partial class DiscoveryWorkerTests
857
893
  new("TargetFrameworks", "net7.0;net8.0", "myproj.csproj"),
858
894
  ],
859
895
  TargetFrameworks = ["net7.0", "net8.0"],
896
+ ReferencedProjectPaths = [],
897
+ ImportedFiles = [],
898
+ AdditionalFiles = [],
860
899
  }
861
900
  ],
862
901
  }
@@ -918,6 +957,8 @@ public partial class DiscoveryWorkerTests
918
957
  new("TargetFramework", "net8.0", @"test/unit-tests.csproj"),
919
958
  ],
920
959
  TargetFrameworks = ["net8.0"],
960
+ ImportedFiles = [],
961
+ AdditionalFiles = [],
921
962
  },
922
963
  new()
923
964
  {
@@ -929,6 +970,9 @@ public partial class DiscoveryWorkerTests
929
970
  new("TargetFramework", "net8.0", @"src/helpers.csproj"),
930
971
  ],
931
972
  TargetFrameworks = ["net8.0"],
973
+ ReferencedProjectPaths = [],
974
+ ImportedFiles = [],
975
+ AdditionalFiles = [],
932
976
  }
933
977
  ]
934
978
  }
@@ -989,6 +1033,8 @@ public partial class DiscoveryWorkerTests
989
1033
  new("TargetFramework", "net8.0", @"test/unit-tests.csproj"),
990
1034
  ],
991
1035
  TargetFrameworks = ["net8.0"],
1036
+ ImportedFiles = [],
1037
+ AdditionalFiles = [],
992
1038
  },
993
1039
  new()
994
1040
  {
@@ -1000,6 +1046,9 @@ public partial class DiscoveryWorkerTests
1000
1046
  new("TargetFramework", "net8.0", @"src/helpers.csproj"),
1001
1047
  ],
1002
1048
  TargetFrameworks = ["net8.0"],
1049
+ ReferencedProjectPaths = [],
1050
+ ImportedFiles = [],
1051
+ AdditionalFiles = [],
1003
1052
  }
1004
1053
  ]
1005
1054
  }
@@ -1062,6 +1111,9 @@ public partial class DiscoveryWorkerTests
1062
1111
  new("TargetFramework", "net8.0", @"projects/library.csproj"),
1063
1112
  ],
1064
1113
  TargetFrameworks = ["net8.0"],
1114
+ ReferencedProjectPaths = [],
1115
+ ImportedFiles = [],
1116
+ AdditionalFiles = [],
1065
1117
  }
1066
1118
  ]
1067
1119
  }
@@ -1108,6 +1160,9 @@ public partial class DiscoveryWorkerTests
1108
1160
  new("TargetFrameworks", "net8.0-ios;net8.0-android;net8.0-macos;net8.0-maccatalyst", @"src/project.csproj"),
1109
1161
  ],
1110
1162
  TargetFrameworks = ["net8.0-android", "net8.0-ios", "net8.0-maccatalyst", "net8.0-macos"],
1163
+ ReferencedProjectPaths = [],
1164
+ ImportedFiles = [],
1165
+ AdditionalFiles = [],
1111
1166
  }
1112
1167
  ]
1113
1168
  }
@@ -1151,6 +1206,62 @@ public partial class DiscoveryWorkerTests
1151
1206
  new("TargetFrameworks", "net8.0-ios;net8.0-android;net8.0-macos;net8.0-maccatalyst", @"src/project.csproj"),
1152
1207
  ],
1153
1208
  TargetFrameworks = ["net8.0-android", "net8.0-ios", "net8.0-maccatalyst", "net8.0-macos"],
1209
+ ReferencedProjectPaths = [],
1210
+ ImportedFiles = [],
1211
+ AdditionalFiles = [],
1212
+ }
1213
+ ]
1214
+ }
1215
+ );
1216
+ }
1217
+
1218
+ [Theory]
1219
+ [InlineData(true)]
1220
+ [InlineData(false)]
1221
+ public async Task PackageLockJsonFileIsReported(bool useDirectDiscovery)
1222
+ {
1223
+ await TestDiscoveryAsync(
1224
+ experimentsManager: new ExperimentsManager() { UseDirectDiscovery = useDirectDiscovery },
1225
+ packages:
1226
+ [
1227
+ MockNuGetPackage.CreateSimplePackage("Some.Package", "1.2.3", "net8.0"),
1228
+ ],
1229
+ workspacePath: "src",
1230
+ files:
1231
+ [
1232
+ ("src/project.csproj", """
1233
+ <Project Sdk="Microsoft.NET.Sdk">
1234
+ <PropertyGroup>
1235
+ <TargetFramework>net8.0</TargetFramework>
1236
+ </PropertyGroup>
1237
+ <ItemGroup>
1238
+ <PackageReference Include="Some.Package" Version="1.2.3" />
1239
+ </ItemGroup>
1240
+ </Project>
1241
+ """),
1242
+ ("src/packages.lock.json", """
1243
+ {}
1244
+ """),
1245
+ ],
1246
+ expectedResult: new()
1247
+ {
1248
+ Path = "src",
1249
+ Projects = [
1250
+ new()
1251
+ {
1252
+ FilePath = "project.csproj",
1253
+ Dependencies = [
1254
+ new("Some.Package", "1.2.3", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true)
1255
+ ],
1256
+ Properties = [
1257
+ new("TargetFramework", "net8.0", "src/project.csproj"),
1258
+ ],
1259
+ TargetFrameworks = ["net8.0"],
1260
+ ReferencedProjectPaths = [],
1261
+ ImportedFiles = [],
1262
+ AdditionalFiles = [
1263
+ "packages.lock.json"
1264
+ ],
1154
1265
  }
1155
1266
  ]
1156
1267
  }
@@ -65,7 +65,10 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
65
65
  Properties = [
66
66
  new("SomePackageVersion", "9.0.1", projectPath),
67
67
  new("TargetFramework", "net8.0", projectPath),
68
- ]
68
+ ],
69
+ ReferencedProjectPaths = [],
70
+ ImportedFiles = [],
71
+ AdditionalFiles = [],
69
72
  }
70
73
  ]
71
74
  }
@@ -111,7 +114,10 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
111
114
  ],
112
115
  Properties = [
113
116
  new("TargetFramework", "net472", "src/project.csproj"),
114
- ]
117
+ ],
118
+ ReferencedProjectPaths = [],
119
+ ImportedFiles = [],
120
+ AdditionalFiles = [],
115
121
  }
116
122
  ]
117
123
  }
@@ -160,7 +166,10 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
160
166
  Properties = [
161
167
  new("SomePackageVersion", "9.0.1", "src/project.csproj"),
162
168
  new("TargetFramework", "net8.0", "src/project.csproj"),
163
- ]
169
+ ],
170
+ ReferencedProjectPaths = [],
171
+ ImportedFiles = [],
172
+ AdditionalFiles = [],
164
173
  }
165
174
  ]
166
175
  }
@@ -209,7 +218,112 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
209
218
  Properties = [
210
219
  new("SomePackageVersion", "9.0.1", "src/project.csproj"),
211
220
  new("TargetFramework", "net8.0", "src/project.csproj"),
212
- ]
221
+ ],
222
+ ImportedFiles = [],
223
+ AdditionalFiles = [],
224
+ }
225
+ ]
226
+ }
227
+ );
228
+ }
229
+
230
+ [LinuxOnlyFact]
231
+ public async Task TestDependenciesCaseSensitiveProjectPaths()
232
+ {
233
+ await TestDiscoveryAsync(
234
+ packages:
235
+ [
236
+ MockNuGetPackage.CreateSimplePackage("Some.Package", "9.0.1", "net8.0"),
237
+ ],
238
+ experimentsManager: new ExperimentsManager() { UseDirectDiscovery = true },
239
+ workspacePath: "src",
240
+ files: new[]
241
+ {
242
+ ("src/test/project1/project1.csproj", """
243
+ <Project Sdk="Microsoft.NET.Sdk">
244
+ <PropertyGroup>
245
+ <TargetFramework>net8.0</TargetFramework>
246
+ </PropertyGroup>
247
+
248
+ <ItemGroup>
249
+ <PackageReference Include="Some.Package" Version="9.0.1" />
250
+ </ItemGroup>
251
+ </Project>
252
+ """),
253
+ ("src/TEST/project2/project2.csproj", """
254
+ <Project Sdk="Microsoft.NET.Sdk">
255
+ <PropertyGroup>
256
+ <TargetFramework>net8.0</TargetFramework>
257
+ </PropertyGroup>
258
+
259
+ <ItemGroup>
260
+ <PackageReference Include="Some.Package" Version="9.0.1" />
261
+ </ItemGroup>
262
+ </Project>
263
+ """),
264
+ // Add solution files
265
+ ("src/solution.sln", """
266
+ Microsoft Visual Studio Solution File, Format Version 12.00
267
+ # Visual Studio 14
268
+ VisualStudioVersion = 14.0.22705.0
269
+ MinimumVisualStudioVersion = 10.0.40219.1
270
+ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "project1", "test\project1\project1.csproj", "{782E0C0A-10D3-444D-9640-263D03D2B20C}"
271
+ EndProject
272
+ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "project2", "test\project2\project2.csproj", "{782E0C0A-10D3-444D-9640-263D03D2B20D}"
273
+ EndProject
274
+ Global
275
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
276
+ Debug|Any CPU = Debug|Any CPU
277
+ Release|Any CPU = Release|Any CPU
278
+ EndGlobalSection
279
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
280
+ {782E0C0A-10D3-444D-9640-263D03D2B20C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
281
+ {782E0C0A-10D3-444D-9640-263D03D2B20C}.Debug|Any CPU.Build.0 = Debug|Any CPU
282
+ {782E0C0A-10D3-444D-9640-263D03D2B20C}.Release|Any CPU.ActiveCfg = Release|Any CPU
283
+ {782E0C0A-10D3-444D-9640-263D03D2B20C}.Release|Any CPU.Build.0 = Release|Any CPU
284
+ {782E0C0A-10D3-444D-9640-263D03D2B20D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
285
+ {782E0C0A-10D3-444D-9640-263D03D2B20D}.Debug|Any CPU.Build.0 = Debug|Any CPU
286
+ {782E0C0A-10D3-444D-9640-263D03D2B20D}.Release|Any CPU.ActiveCfg = Release|Any CPU
287
+ {782E0C0A-10D3-444D-9640-263D03D2B20D}.Release|Any CPU.Build.0 = Release|Any CPU
288
+ EndGlobalSection
289
+ GlobalSection(SolutionProperties) = preSolution
290
+ HideSolutionNode = FALSE
291
+ EndGlobalSection
292
+ EndGlobal
293
+ """)
294
+
295
+ },
296
+ expectedResult: new()
297
+ {
298
+ Path = "src",
299
+ Projects = [
300
+ new()
301
+ {
302
+ FilePath = "test/project1/project1.csproj",
303
+ TargetFrameworks = ["net8.0"],
304
+ ReferencedProjectPaths = [],
305
+ Dependencies = [
306
+ new("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true),
307
+ ],
308
+ Properties = [
309
+ new("TargetFramework", "net8.0", "src/test/project1/project1.csproj"),
310
+ ],
311
+ ImportedFiles = [],
312
+ AdditionalFiles = [],
313
+ },
314
+ new()
315
+ {
316
+ FilePath = "TEST/project2/project2.csproj",
317
+ TargetFrameworks = ["net8.0"],
318
+ ReferencedProjectPaths = [],
319
+ Dependencies = [
320
+ new("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true),
321
+ ],
322
+ Properties = [
323
+ new("TargetFramework", "net8.0", "src/TEST/project2/project2.csproj"),
324
+ ],
325
+ ImportedFiles = [],
326
+ AdditionalFiles = [],
213
327
  }
214
328
  ]
215
329
  }
@@ -258,7 +372,9 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
258
372
  Properties = [
259
373
  new("SomePackageVersion", "9.0.1", "src/project.csproj"),
260
374
  new("TargetFramework", "net8.0", "src/project.csproj"),
261
- ]
375
+ ],
376
+ ImportedFiles = [],
377
+ AdditionalFiles = [],
262
378
  }
263
379
  ]
264
380
  }
@@ -315,7 +431,12 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
315
431
  Dependencies = [
316
432
  new("Some.Package", "7.0.1", DependencyType.PackagesConfig, TargetFrameworks: ["net45"]),
317
433
  ],
318
- Properties = []
434
+ Properties = [],
435
+ ReferencedProjectPaths = [],
436
+ ImportedFiles = [],
437
+ AdditionalFiles = [
438
+ "packages.config",
439
+ ],
319
440
  }
320
441
  ]
321
442
  }
@@ -372,13 +493,15 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
372
493
  ],
373
494
  Properties = [
374
495
  new("TargetFramework", "net8.0", "src/project.csproj")
375
- ]
496
+ ],
497
+ ReferencedProjectPaths = [],
498
+ ImportedFiles = [
499
+ "../Directory.Build.props",
500
+ "../Directory.Packages.props",
501
+ ],
502
+ AdditionalFiles = [],
376
503
  }
377
504
  ],
378
- ImportedFiles = [
379
- "Directory.Build.props",
380
- "Directory.Packages.props",
381
- ]
382
505
  }
383
506
  );
384
507
  }
@@ -435,13 +558,15 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
435
558
  new("ManagePackageVersionsCentrally", "true", "Directory.Packages.props"),
436
559
  new("SomePackageVersion", "9.0.1", "Directory.Packages.props"),
437
560
  new("TargetFramework", "net8.0", "src/project.csproj")
438
- ]
561
+ ],
562
+ ReferencedProjectPaths = [],
563
+ ImportedFiles = [
564
+ "../Directory.Build.props",
565
+ "../Directory.Packages.props",
566
+ ],
567
+ AdditionalFiles = [],
439
568
  }
440
569
  ],
441
- ImportedFiles = [
442
- "Directory.Build.props",
443
- "Directory.Packages.props",
444
- ]
445
570
  }
446
571
  );
447
572
  }
@@ -553,13 +678,15 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
553
678
  ],
554
679
  Properties = [
555
680
  new("TargetFrameworks", "net7.0;net8.0", "src/project.csproj")
556
- ]
681
+ ],
682
+ ReferencedProjectPaths = [],
683
+ ImportedFiles = [
684
+ "../Directory.Build.props",
685
+ "../Directory.Packages.props",
686
+ ],
687
+ AdditionalFiles = [],
557
688
  }
558
689
  ],
559
- ImportedFiles = [
560
- "Directory.Build.props",
561
- "Directory.Packages.props",
562
- ],
563
690
  GlobalJson = new()
564
691
  {
565
692
  FilePath = "global.json",
@@ -656,13 +783,15 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
656
783
  new("ManagePackageVersionsCentrally", "true", "Directory.Packages.props"),
657
784
  new("SomePackageVersion", "9.0.1", "Directory.Packages.props"),
658
785
  new("TargetFrameworks", "net7.0;net8.0", "src/project.csproj"),
659
- ]
786
+ ],
787
+ ReferencedProjectPaths = [],
788
+ ImportedFiles = [
789
+ "../Directory.Build.props",
790
+ "../Directory.Packages.props",
791
+ ],
792
+ AdditionalFiles = [],
660
793
  }
661
794
  ],
662
- ImportedFiles = [
663
- "Directory.Build.props",
664
- "Directory.Packages.props"
665
- ]
666
795
  }
667
796
  );
668
797
  }
@@ -717,23 +846,25 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
717
846
  Path = "",
718
847
  Projects = [
719
848
  new()
720
- {
721
- FilePath = "src/project.csproj",
722
- TargetFrameworks = ["net7.0", "net8.0"],
723
- Dependencies = [
724
- new("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net7.0", "net8.0"], IsDirect: true)
725
- ],
726
- Properties = [
727
- new("ManagePackageVersionsCentrally", "true", "Directory.Packages.props"),
728
- new("SomePackageVersion", "9.0.1", "Directory.Packages.props"),
729
- new("TargetFrameworks", "net7.0;net8.0", "src/project.csproj"),
730
- ]
731
- }
849
+ {
850
+ FilePath = "src/project.csproj",
851
+ TargetFrameworks = ["net7.0", "net8.0"],
852
+ Dependencies = [
853
+ new("Some.Package", "9.0.1", DependencyType.PackageReference, TargetFrameworks: ["net7.0", "net8.0"], IsDirect: true)
854
+ ],
855
+ Properties = [
856
+ new("ManagePackageVersionsCentrally", "true", "Directory.Packages.props"),
857
+ new("SomePackageVersion", "9.0.1", "Directory.Packages.props"),
858
+ new("TargetFrameworks", "net7.0;net8.0", "src/project.csproj"),
859
+ ],
860
+ ReferencedProjectPaths = [],
861
+ ImportedFiles = [
862
+ "../Directory.Build.props",
863
+ "../Directory.Packages.props",
864
+ ],
865
+ AdditionalFiles = [],
866
+ }
732
867
  ],
733
- ImportedFiles = [
734
- "Directory.Build.props",
735
- "Directory.Packages.props"
736
- ]
737
868
  }
738
869
  );
739
870
  }
@@ -846,13 +977,15 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
846
977
  new("ManagePackageVersionsCentrally", "true", "Directory.Packages.props"),
847
978
  new("SomePackageVersion", "9.0.1", "Directory.Packages.props"),
848
979
  new("TargetFrameworks", "net7.0;net8.0", "src/project.csproj")
849
- ]
980
+ ],
981
+ ReferencedProjectPaths = [],
982
+ ImportedFiles = [
983
+ "../Directory.Build.props",
984
+ "../Directory.Packages.props",
985
+ ],
986
+ AdditionalFiles = [],
850
987
  }
851
988
  ],
852
- ImportedFiles = [
853
- "Directory.Build.props",
854
- "Directory.Packages.props",
855
- ],
856
989
  GlobalJson = new()
857
990
  {
858
991
  FilePath = "global.json",
@@ -951,7 +1084,10 @@ public partial class DiscoveryWorkerTests : DiscoveryWorkerTestBase
951
1084
  ],
952
1085
  Properties = [
953
1086
  new("TargetFramework", "net8.0", @"src/supported.csproj"),
954
- ]
1087
+ ],
1088
+ ReferencedProjectPaths = [],
1089
+ ImportedFiles = [],
1090
+ AdditionalFiles = [],
955
1091
  }
956
1092
  ]
957
1093
  }