dependabot-nuget 0.242.1 → 0.243.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/helpers/lib/NuGetUpdater/.editorconfig +37 -28
  3. data/helpers/lib/NuGetUpdater/.gitignore +1 -0
  4. data/helpers/lib/NuGetUpdater/NuGetProjects/NuGet.CommandLine/AssemblyMetadataExtractor.cs +2 -1
  5. data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Program.cs +2 -2
  6. data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Update.cs +178 -176
  7. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Files/JsonBuildFile.cs +2 -1
  8. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Files/PackagesConfigBuildFile.cs +1 -0
  9. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Files/ProjectBuildFile.cs +5 -4
  10. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/FrameworkChecker/CompatabilityChecker.cs +1 -0
  11. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/FrameworkChecker/FrameworkCompatibilityService.cs +10 -5
  12. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/FrameworkChecker/SupportedFrameworks.cs +16 -12
  13. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/BindingRedirectManager.cs +18 -17
  14. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/BindingRedirectResolver.cs +7 -7
  15. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/DotNetToolsJsonUpdater.cs +13 -20
  16. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/GlobalJsonUpdater.cs +9 -3
  17. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/PackagesConfigUpdater.cs +32 -16
  18. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/SdkPackageUpdater.cs +42 -22
  19. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdaterWorker.cs +32 -13
  20. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/WebApplicationTargetsConditionPatcher.cs +47 -0
  21. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/XmlFilePreAndPostProcessor.cs +55 -0
  22. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/JsonHelper.cs +12 -9
  23. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +49 -42
  24. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/PathHelper.cs +16 -3
  25. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/ProcessExtensions.cs +6 -6
  26. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/XmlExtensions.cs +11 -0
  27. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Files/ProjectBuildFileTests.cs +18 -9
  28. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/FrameworkChecker/CompatibilityCheckerFacts.cs +2 -2
  29. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/FrameworkChecker/FrameworkCompatibilityServiceFacts.cs +7 -7
  30. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/FrameworkChecker/SupportedFrameworkFacts.cs +1 -1
  31. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/PackagesConfigUpdaterTests.cs +9 -9
  32. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorker.DirsProj.cs +81 -80
  33. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs +22 -9
  34. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.DotNetTools.cs +140 -104
  35. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.GlobalJson.cs +25 -25
  36. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.Mixed.cs +8 -9
  37. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs +198 -22
  38. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.Sdk.cs +401 -399
  39. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/JsonHelperTests.cs +17 -15
  40. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +111 -42
  41. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/SdkPackageUpdaterTests.cs +103 -87
  42. data/lib/dependabot/nuget/file_parser/project_file_parser.rb +45 -19
  43. data/lib/dependabot/nuget/file_parser.rb +21 -3
  44. data/lib/dependabot/nuget/file_updater.rb +42 -6
  45. data/lib/dependabot/nuget/native_helpers.rb +27 -8
  46. data/lib/dependabot/nuget/nuget_client.rb +66 -23
  47. data/lib/dependabot/nuget/nuget_config_credential_helpers.rb +7 -3
  48. data/lib/dependabot/nuget/update_checker/compatibility_checker.rb +63 -59
  49. data/lib/dependabot/nuget/update_checker/dependency_finder.rb +2 -2
  50. data/lib/dependabot/nuget/update_checker/nupkg_fetcher.rb +1 -1
  51. data/lib/dependabot/nuget/update_checker/nuspec_fetcher.rb +22 -17
  52. data/lib/dependabot/nuget/update_checker/repository_finder.rb +292 -270
  53. data/lib/dependabot/nuget/update_checker/tfm_comparer.rb +11 -13
  54. data/lib/dependabot/nuget/update_checker/tfm_finder.rb +80 -82
  55. data/lib/dependabot/nuget/update_checker/version_finder.rb +3 -2
  56. data/lib/dependabot/nuget/version.rb +18 -7
  57. data/lib/dependabot/nuget.rb +0 -2
  58. metadata +7 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a49c3bda283658e65f9a37cf33e5b4855048bf2673bcfdcde4bb2e39d00d68e
4
- data.tar.gz: 340fb04884786613bcbf75e25f7b51be9e662d26211418804965162df2c95c2a
3
+ metadata.gz: 6ecad798e54b8e04842c43e88be3ba17db4d9db05593913fa8709a60abe4ff6c
4
+ data.tar.gz: 3180c91c48986b9512477e05fe9479f02bf64dd2aa4c1883bcdc8e2b48b7459c
5
5
  SHA512:
6
- metadata.gz: 55e5a6b6949b5d30cfd95fb8ac185e9ccad548e0f8cc073237181c8a99e76252602920f6ff4cce68afb8310b4e358a7191ff4c9fe1ef27e92147529eb6c0012a
7
- data.tar.gz: ea153c1649add8848551c6a54577beb7fa554f557275d1ed09928d741bc5ded5a1bfe7ed39561592bda152d8ded72f4081d30da3fcd748500f5d887825c27eb9
6
+ metadata.gz: 3a01fbdf21447a7816e2a421ae23fb26facf9dfa1a96ad0e1182f160d5b615cc8100b6c7733465cd9894acd64300066fde48540f8062c60fbb0ca8684e5b25de
7
+ data.tar.gz: 43d41b0c9b051671f5bafc6d050ca95d6c9f3e959ce6f1bdea896b834a1de3e0c63ee4b9e96ff981b216d33fee79be3f530736f9763ccddff2899bcc47f449e0
@@ -24,6 +24,8 @@ insert_final_newline = true
24
24
  #### .NET Coding Conventions ####
25
25
  [*.{cs,vb}]
26
26
 
27
+ max_line_length = 0
28
+
27
29
  # Organize usings
28
30
  dotnet_separate_import_directive_groups = true
29
31
  dotnet_sort_system_directives_first = true
@@ -131,7 +133,8 @@ csharp_new_line_before_catch = true
131
133
  csharp_new_line_before_else = true
132
134
  csharp_new_line_before_finally = true
133
135
  csharp_new_line_before_members_in_anonymous_types = true
134
- csharp_new_line_before_members_in_object_initializers = true
136
+ # The following line is commented out to work around a Rider formatter bug. `true` is the default value.
137
+ # csharp_new_line_before_members_in_object_initializers = true
135
138
  csharp_new_line_before_open_brace = all
136
139
  csharp_new_line_between_query_expression_clauses = true
137
140
 
@@ -143,6 +146,9 @@ csharp_indent_case_contents_when_block = true
143
146
  csharp_indent_labels = one_less_than_current
144
147
  csharp_indent_switch_labels = true
145
148
 
149
+ resharper_outdent_statement_labels = true
150
+ resharper_indent_raw_literal_string = indent
151
+
146
152
  # Space preferences
147
153
  csharp_space_after_cast = false
148
154
  csharp_space_after_colon_in_inheritance_clause = true
@@ -256,31 +262,31 @@ dotnet_naming_rule.non_field_members_should_be_pascalcase.style = pascalcase
256
262
 
257
263
  dotnet_naming_symbols.interfaces.applicable_kinds = interface
258
264
  dotnet_naming_symbols.interfaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
259
- dotnet_naming_symbols.interfaces.required_modifiers =
265
+ dotnet_naming_symbols.interfaces.required_modifiers =
260
266
 
261
267
  dotnet_naming_symbols.enums.applicable_kinds = enum
262
268
  dotnet_naming_symbols.enums.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
263
- dotnet_naming_symbols.enums.required_modifiers =
269
+ dotnet_naming_symbols.enums.required_modifiers =
264
270
 
265
271
  dotnet_naming_symbols.events.applicable_kinds = event
266
272
  dotnet_naming_symbols.events.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
267
- dotnet_naming_symbols.events.required_modifiers =
273
+ dotnet_naming_symbols.events.required_modifiers =
268
274
 
269
275
  dotnet_naming_symbols.methods.applicable_kinds = method
270
276
  dotnet_naming_symbols.methods.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
271
- dotnet_naming_symbols.methods.required_modifiers =
277
+ dotnet_naming_symbols.methods.required_modifiers =
272
278
 
273
279
  dotnet_naming_symbols.properties.applicable_kinds = property
274
280
  dotnet_naming_symbols.properties.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
275
- dotnet_naming_symbols.properties.required_modifiers =
281
+ dotnet_naming_symbols.properties.required_modifiers =
276
282
 
277
283
  dotnet_naming_symbols.public_fields.applicable_kinds = field
278
284
  dotnet_naming_symbols.public_fields.applicable_accessibilities = public, internal
279
- dotnet_naming_symbols.public_fields.required_modifiers =
285
+ dotnet_naming_symbols.public_fields.required_modifiers =
280
286
 
281
287
  dotnet_naming_symbols.private_fields.applicable_kinds = field
282
288
  dotnet_naming_symbols.private_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
283
- dotnet_naming_symbols.private_fields.required_modifiers =
289
+ dotnet_naming_symbols.private_fields.required_modifiers =
284
290
 
285
291
  dotnet_naming_symbols.private_static_fields.applicable_kinds = field
286
292
  dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
@@ -288,15 +294,15 @@ dotnet_naming_symbols.private_static_fields.required_modifiers = static
288
294
 
289
295
  dotnet_naming_symbols.types_and_namespaces.applicable_kinds = namespace, class, struct, interface, enum
290
296
  dotnet_naming_symbols.types_and_namespaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
291
- dotnet_naming_symbols.types_and_namespaces.required_modifiers =
297
+ dotnet_naming_symbols.types_and_namespaces.required_modifiers =
292
298
 
293
299
  dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
294
300
  dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
295
- dotnet_naming_symbols.non_field_members.required_modifiers =
301
+ dotnet_naming_symbols.non_field_members.required_modifiers =
296
302
 
297
303
  dotnet_naming_symbols.type_parameters.applicable_kinds = namespace
298
304
  dotnet_naming_symbols.type_parameters.applicable_accessibilities = *
299
- dotnet_naming_symbols.type_parameters.required_modifiers =
305
+ dotnet_naming_symbols.type_parameters.required_modifiers =
300
306
 
301
307
  dotnet_naming_symbols.private_constant_fields.applicable_kinds = field
302
308
  dotnet_naming_symbols.private_constant_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
@@ -304,7 +310,7 @@ dotnet_naming_symbols.private_constant_fields.required_modifiers = const
304
310
 
305
311
  dotnet_naming_symbols.local_variables.applicable_kinds = local
306
312
  dotnet_naming_symbols.local_variables.applicable_accessibilities = local
307
- dotnet_naming_symbols.local_variables.required_modifiers =
313
+ dotnet_naming_symbols.local_variables.required_modifiers =
308
314
 
309
315
  dotnet_naming_symbols.local_constants.applicable_kinds = local
310
316
  dotnet_naming_symbols.local_constants.applicable_accessibilities = local
@@ -312,7 +318,7 @@ dotnet_naming_symbols.local_constants.required_modifiers = const
312
318
 
313
319
  dotnet_naming_symbols.parameters.applicable_kinds = parameter
314
320
  dotnet_naming_symbols.parameters.applicable_accessibilities = *
315
- dotnet_naming_symbols.parameters.required_modifiers =
321
+ dotnet_naming_symbols.parameters.required_modifiers =
316
322
 
317
323
  dotnet_naming_symbols.public_constant_fields.applicable_kinds = field
318
324
  dotnet_naming_symbols.public_constant_fields.applicable_accessibilities = public, internal
@@ -328,37 +334,40 @@ dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = readon
328
334
 
329
335
  dotnet_naming_symbols.local_functions.applicable_kinds = local_function
330
336
  dotnet_naming_symbols.local_functions.applicable_accessibilities = *
331
- dotnet_naming_symbols.local_functions.required_modifiers =
337
+ dotnet_naming_symbols.local_functions.required_modifiers =
332
338
 
333
339
  # Naming styles
334
340
 
335
- dotnet_naming_style.pascalcase.required_prefix =
336
- dotnet_naming_style.pascalcase.required_suffix =
337
- dotnet_naming_style.pascalcase.word_separator =
341
+ dotnet_naming_style.pascalcase.required_prefix =
342
+ dotnet_naming_style.pascalcase.required_suffix =
343
+ dotnet_naming_style.pascalcase.word_separator =
338
344
  dotnet_naming_style.pascalcase.capitalization = pascal_case
339
345
 
340
346
  dotnet_naming_style.ipascalcase.required_prefix = I
341
- dotnet_naming_style.ipascalcase.required_suffix =
342
- dotnet_naming_style.ipascalcase.word_separator =
347
+ dotnet_naming_style.ipascalcase.required_suffix =
348
+ dotnet_naming_style.ipascalcase.word_separator =
343
349
  dotnet_naming_style.ipascalcase.capitalization = pascal_case
344
350
 
345
351
  dotnet_naming_style.tpascalcase.required_prefix = T
346
- dotnet_naming_style.tpascalcase.required_suffix =
347
- dotnet_naming_style.tpascalcase.word_separator =
352
+ dotnet_naming_style.tpascalcase.required_suffix =
353
+ dotnet_naming_style.tpascalcase.word_separator =
348
354
  dotnet_naming_style.tpascalcase.capitalization = pascal_case
349
355
 
350
356
  dotnet_naming_style._camelcase.required_prefix = _
351
- dotnet_naming_style._camelcase.required_suffix =
352
- dotnet_naming_style._camelcase.word_separator =
357
+ dotnet_naming_style._camelcase.required_suffix =
358
+ dotnet_naming_style._camelcase.word_separator =
353
359
  dotnet_naming_style._camelcase.capitalization = camel_case
354
360
 
355
- dotnet_naming_style.camelcase.required_prefix =
356
- dotnet_naming_style.camelcase.required_suffix =
357
- dotnet_naming_style.camelcase.word_separator =
361
+ dotnet_naming_style.camelcase.required_prefix =
362
+ dotnet_naming_style.camelcase.required_suffix =
363
+ dotnet_naming_style.camelcase.word_separator =
358
364
  dotnet_naming_style.camelcase.capitalization = camel_case
359
365
 
360
366
  dotnet_naming_style.s_camelcase.required_prefix = s_
361
- dotnet_naming_style.s_camelcase.required_suffix =
362
- dotnet_naming_style.s_camelcase.word_separator =
367
+ dotnet_naming_style.s_camelcase.required_suffix =
368
+ dotnet_naming_style.s_camelcase.word_separator =
363
369
  dotnet_naming_style.s_camelcase.capitalization = camel_case
364
370
 
371
+ [NuGetUpdater.Core.Test/FrameworkChecker/SupportedFrameworkFacts.cs]
372
+ generated_code = true
373
+ disable_formatter = true
@@ -3,3 +3,4 @@ artifacts/
3
3
  bin/
4
4
  obj/
5
5
  Properties/launchSettings.json
6
+ NuGetUpdater.sln.DotSettings.user
@@ -8,6 +8,7 @@ using System.Globalization;
8
8
  using System.IO;
9
9
  using System.Linq;
10
10
  using System.Reflection;
11
+
11
12
  using NuGet.Common;
12
13
  using NuGet.Packaging;
13
14
  using NuGet.Packaging.Core;
@@ -84,7 +85,7 @@ namespace NuGet.CommandLine
84
85
  }
85
86
 
86
87
  builder.Properties.AddRange(assemblyMetadata.Properties);
87
- // Let the id be overriden by AssemblyMetadataAttribute
88
+ // Let the id be overridden by AssemblyMetadataAttribute
88
89
  // This preserves the existing behavior if no id metadata
89
90
  // is provided by the assembly.
90
91
  if (builder.Properties.ContainsKey("id"))
@@ -11,9 +11,9 @@ internal sealed class Program
11
11
  internal static async Task<int> Main(string[] args)
12
12
  {
13
13
  var exitCode = 0;
14
- Action<int> setExitCode = (int code) => exitCode = code;
14
+ Action<int> setExitCode = code => exitCode = code;
15
15
 
16
- var command = new RootCommand()
16
+ var command = new RootCommand
17
17
  {
18
18
  FrameworkCheckCommand.GetCommand(setExitCode),
19
19
  UpdateCommand.GetCommand(setExitCode),
@@ -16,186 +16,187 @@ public partial class EntryPointTests
16
16
  [Fact]
17
17
  public async Task WithSolution()
18
18
  {
19
- await Run(path => new[]
20
- {
21
- "update",
22
- "--repo-root",
23
- path,
24
- "--solution-or-project",
25
- Path.Combine(path, "path/to/solution.sln"),
26
- "--dependency",
27
- "Newtonsoft.Json",
28
- "--new-version",
29
- "13.0.1",
30
- "--previous-version",
31
- "7.0.1",
32
- },
33
- new[]
34
- {
35
- ("path/to/solution.sln", """
36
- Microsoft Visual Studio Solution File, Format Version 12.00
37
- # Visual Studio 14
38
- VisualStudioVersion = 14.0.22705.0
39
- MinimumVisualStudioVersion = 10.0.40219.1
40
- Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "my", "my.csproj", "{782E0C0A-10D3-444D-9640-263D03D2B20C}"
41
- EndProject
42
- Global
43
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
44
- Debug|Any CPU = Debug|Any CPU
45
- Release|Any CPU = Release|Any CPU
46
- EndGlobalSection
47
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
48
- {782E0C0A-10D3-444D-9640-263D03D2B20C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
49
- {782E0C0A-10D3-444D-9640-263D03D2B20C}.Debug|Any CPU.Build.0 = Debug|Any CPU
50
- {782E0C0A-10D3-444D-9640-263D03D2B20C}.Release|Any CPU.ActiveCfg = Release|Any CPU
51
- {782E0C0A-10D3-444D-9640-263D03D2B20C}.Release|Any CPU.Build.0 = Release|Any CPU
52
- EndGlobalSection
53
- GlobalSection(SolutionProperties) = preSolution
54
- HideSolutionNode = FALSE
55
- EndGlobalSection
56
- EndGlobal
57
- """),
58
- ("path/to/my.csproj", """
59
- <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
60
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
61
- <PropertyGroup>
62
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
63
- </PropertyGroup>
64
- <ItemGroup>
65
- <None Include="packages.config" />
66
- </ItemGroup>
67
- <ItemGroup>
68
- <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
69
- <HintPath>packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
70
- <Private>True</Private>
71
- </Reference>
72
- </ItemGroup>
73
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
74
- </Project>
75
- """),
76
- ("path/to/packages.config", """
77
- <packages>
78
- <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
79
- </packages>
80
- """)
81
- },
82
- new[]
83
- {
84
- ("path/to/my.csproj", """
85
- <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
86
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
87
- <PropertyGroup>
88
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
89
- </PropertyGroup>
90
- <ItemGroup>
91
- <None Include="packages.config" />
92
- </ItemGroup>
93
- <ItemGroup>
94
- <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
95
- <HintPath>packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
96
- <Private>True</Private>
97
- </Reference>
98
- </ItemGroup>
99
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
100
- </Project>
101
- """),
102
- ("path/to/packages.config", """
103
- <?xml version="1.0" encoding="utf-8"?>
104
- <packages>
105
- <package id="Newtonsoft.Json" version="13.0.1" targetFramework="net45" />
106
- </packages>
107
- """)
108
- });
19
+ await Run(path =>
20
+ [
21
+ "update",
22
+ "--repo-root",
23
+ path,
24
+ "--solution-or-project",
25
+ Path.Combine(path, "path/to/solution.sln"),
26
+ "--dependency",
27
+ "Newtonsoft.Json",
28
+ "--new-version",
29
+ "13.0.1",
30
+ "--previous-version",
31
+ "7.0.1",
32
+ ],
33
+ [
34
+ ("path/to/solution.sln", """
35
+ Microsoft Visual Studio Solution File, Format Version 12.00
36
+ # Visual Studio 14
37
+ VisualStudioVersion = 14.0.22705.0
38
+ MinimumVisualStudioVersion = 10.0.40219.1
39
+ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "my", "my.csproj", "{782E0C0A-10D3-444D-9640-263D03D2B20C}"
40
+ EndProject
41
+ Global
42
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
43
+ Debug|Any CPU = Debug|Any CPU
44
+ Release|Any CPU = Release|Any CPU
45
+ EndGlobalSection
46
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
47
+ {782E0C0A-10D3-444D-9640-263D03D2B20C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
48
+ {782E0C0A-10D3-444D-9640-263D03D2B20C}.Debug|Any CPU.Build.0 = Debug|Any CPU
49
+ {782E0C0A-10D3-444D-9640-263D03D2B20C}.Release|Any CPU.ActiveCfg = Release|Any CPU
50
+ {782E0C0A-10D3-444D-9640-263D03D2B20C}.Release|Any CPU.Build.0 = Release|Any CPU
51
+ EndGlobalSection
52
+ GlobalSection(SolutionProperties) = preSolution
53
+ HideSolutionNode = FALSE
54
+ EndGlobalSection
55
+ EndGlobal
56
+ """),
57
+ ("path/to/my.csproj", """
58
+ <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
59
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
60
+ <PropertyGroup>
61
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
62
+ </PropertyGroup>
63
+ <ItemGroup>
64
+ <None Include="packages.config" />
65
+ </ItemGroup>
66
+ <ItemGroup>
67
+ <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
68
+ <HintPath>packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
69
+ <Private>True</Private>
70
+ </Reference>
71
+ </ItemGroup>
72
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
73
+ </Project>
74
+ """),
75
+ ("path/to/packages.config", """
76
+ <packages>
77
+ <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
78
+ </packages>
79
+ """)
80
+ ],
81
+ [
82
+ ("path/to/my.csproj", """
83
+ <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
84
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
85
+ <PropertyGroup>
86
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
87
+ </PropertyGroup>
88
+ <ItemGroup>
89
+ <None Include="packages.config" />
90
+ </ItemGroup>
91
+ <ItemGroup>
92
+ <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
93
+ <HintPath>packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
94
+ <Private>True</Private>
95
+ </Reference>
96
+ </ItemGroup>
97
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
98
+ </Project>
99
+ """),
100
+ ("path/to/packages.config", """
101
+ <?xml version="1.0" encoding="utf-8"?>
102
+ <packages>
103
+ <package id="Newtonsoft.Json" version="13.0.1" targetFramework="net45" />
104
+ </packages>
105
+ """)
106
+ ]);
109
107
  }
110
108
 
111
109
  [Fact]
112
110
  public async Task WithProject()
113
111
  {
114
- await Run(path => new[]
115
- {
116
- "update",
117
- "--repo-root",
118
- path,
119
- "--solution-or-project",
120
- Path.Combine(path, "path/to/my.csproj"),
121
- "--dependency",
122
- "Newtonsoft.Json",
123
- "--new-version",
124
- "13.0.1",
125
- "--previous-version",
126
- "7.0.1",
127
- "--verbose"
128
- },
129
- new[]
130
- {
131
- ("path/to/my.csproj", """
132
- <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
133
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
134
- <PropertyGroup>
135
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
136
- </PropertyGroup>
137
- <ItemGroup>
138
- <None Include="packages.config" />
139
- </ItemGroup>
140
- <ItemGroup>
141
- <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
142
- <HintPath>packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
143
- <Private>True</Private>
144
- </Reference>
145
- </ItemGroup>
146
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
147
- </Project>
148
- """),
149
- ("path/to/packages.config", """
150
- <packages>
151
- <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
152
- </packages>
153
- """)
154
- },
155
- new[]
156
- {
157
- ("path/to/my.csproj", """
158
- <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
159
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
160
- <PropertyGroup>
161
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
162
- </PropertyGroup>
163
- <ItemGroup>
164
- <None Include="packages.config" />
165
- </ItemGroup>
166
- <ItemGroup>
167
- <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
168
- <HintPath>packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
169
- <Private>True</Private>
170
- </Reference>
171
- </ItemGroup>
172
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
173
- </Project>
174
- """),
175
- ("path/to/packages.config", """
176
- <?xml version="1.0" encoding="utf-8"?>
177
- <packages>
178
- <package id="Newtonsoft.Json" version="13.0.1" targetFramework="net45" />
179
- </packages>
180
- """)
181
- });
112
+ await Run(path =>
113
+ [
114
+ "update",
115
+ "--repo-root",
116
+ path,
117
+ "--solution-or-project",
118
+ Path.Combine(path, "path/to/my.csproj"),
119
+ "--dependency",
120
+ "Newtonsoft.Json",
121
+ "--new-version",
122
+ "13.0.1",
123
+ "--previous-version",
124
+ "7.0.1",
125
+ "--verbose"
126
+ ],
127
+ [
128
+ ("path/to/my.csproj", """
129
+ <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
130
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
131
+ <PropertyGroup>
132
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
133
+ </PropertyGroup>
134
+ <ItemGroup>
135
+ <None Include="packages.config" />
136
+ </ItemGroup>
137
+ <ItemGroup>
138
+ <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
139
+ <HintPath>packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
140
+ <Private>True</Private>
141
+ </Reference>
142
+ </ItemGroup>
143
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
144
+ </Project>
145
+ """),
146
+ ("path/to/packages.config", """
147
+ <packages>
148
+ <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
149
+ </packages>
150
+ """)
151
+ ],
152
+ [
153
+ ("path/to/my.csproj", """
154
+ <Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
155
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
156
+ <PropertyGroup>
157
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
158
+ </PropertyGroup>
159
+ <ItemGroup>
160
+ <None Include="packages.config" />
161
+ </ItemGroup>
162
+ <ItemGroup>
163
+ <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
164
+ <HintPath>packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
165
+ <Private>True</Private>
166
+ </Reference>
167
+ </ItemGroup>
168
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
169
+ </Project>
170
+ """),
171
+ ("path/to/packages.config", """
172
+ <?xml version="1.0" encoding="utf-8"?>
173
+ <packages>
174
+ <package id="Newtonsoft.Json" version="13.0.1" targetFramework="net45" />
175
+ </packages>
176
+ """)
177
+ ]);
182
178
  }
183
179
 
184
180
  [Fact]
185
181
  public async Task WithDirsProjAndDirectoryBuildPropsThatIsOutOfDirectoryButStillMatchingThePackage()
186
182
  {
187
- await Run(path => new[]
188
- {
183
+ await Run(path =>
184
+ [
189
185
  "update",
190
- "--repo-root", path,
191
- "--solution-or-project", $"{path}/some-dir/dirs.proj",
192
- "--dependency", "NuGet.Versioning",
193
- "--new-version", "6.6.1",
194
- "--previous-version", "6.1.0",
186
+ "--repo-root",
187
+ path,
188
+ "--solution-or-project",
189
+ $"{path}/some-dir/dirs.proj",
190
+ "--dependency",
191
+ "NuGet.Versioning",
192
+ "--new-version",
193
+ "6.6.1",
194
+ "--previous-version",
195
+ "6.1.0",
195
196
  "--verbose"
196
- },
197
- initialFiles: new[]
198
- {
197
+ ],
198
+ initialFiles:
199
+ [
199
200
  ("some-dir/dirs.proj", """
200
201
  <Project Sdk="Microsoft.Build.Traversal">
201
202
  <ItemGroup>
@@ -232,16 +233,16 @@ public partial class EntryPointTests
232
233
  """),
233
234
  ("other-dir/Directory.Build.props", """
234
235
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
235
-
236
+
236
237
  <ItemGroup>
237
238
  <PackageReference Include="NuGet.Versioning" Version="6.1.0" />
238
239
  </ItemGroup>
239
240
 
240
241
  </Project>
241
242
  """)
242
- },
243
- expectedFiles: new[]
244
- {
243
+ ],
244
+ expectedFiles:
245
+ [
245
246
  ("some-dir/dirs.proj", """
246
247
  <Project Sdk="Microsoft.Build.Traversal">
247
248
  <ItemGroup>
@@ -250,7 +251,8 @@ public partial class EntryPointTests
250
251
  </ItemGroup>
251
252
  </Project>
252
253
  """),
253
- ("some-dir/project1/project.csproj", """
254
+ ("some-dir/project1/project.csproj",
255
+ """
254
256
  <Project Sdk="Microsoft.NET.Sdk">
255
257
  <PropertyGroup>
256
258
  <OutputType>Exe</OutputType>
@@ -278,20 +280,20 @@ public partial class EntryPointTests
278
280
  """),
279
281
  ("other-dir/Directory.Build.props", """
280
282
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
281
-
283
+
282
284
  <ItemGroup>
283
285
  <PackageReference Include="NuGet.Versioning" Version="6.1.0" />
284
286
  </ItemGroup>
285
287
 
286
288
  </Project>
287
289
  """)
288
- }
290
+ ]
289
291
  );
290
292
  }
291
293
 
292
294
  private static async Task Run(Func<string, string[]> getArgs, (string Path, string Content)[] initialFiles, (string, string)[] expectedFiles)
293
295
  {
294
- var actualFiles = await RunUpdate(initialFiles, async (path) =>
296
+ var actualFiles = await RunUpdate(initialFiles, async path =>
295
297
  {
296
298
  var sb = new StringBuilder();
297
299
  var writer = new StringWriter(sb);