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.
- checksums.yaml +4 -4
- data/helpers/lib/NuGetUpdater/Directory.Packages.props +19 -17
- data/helpers/lib/NuGetUpdater/NuGetProjects/NuGet.Packaging/NuGet.Packaging.csproj +0 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Analyze.cs +3 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Discover.cs +23 -3
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/AnalyzeWorker.cs +30 -15
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/CompatabilityChecker.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/RequirementArrayConverter.cs +39 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/VersionFinder.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Clone/ShellGitCommandHandler.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs +60 -66
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DotNetToolsJsonDiscovery.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/GlobalJsonDiscovery.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/PackagesConfigDiscovery.cs +11 -3
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/PackagesConfigDiscoveryResult.cs +1 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/ProjectDiscoveryResult.cs +2 -4
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/SdkProjectDiscovery.cs +54 -11
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/WorkspaceDiscoveryResult.cs +0 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/ExperimentsManager.cs +1 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Files/JsonBuildFile.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/FrameworkChecker/CompatabilityChecker.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Run/RunWorker.cs +43 -54
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/BindingRedirectManager.cs +13 -43
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/DotNetToolsJsonUpdater.cs +4 -4
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/GlobalJsonUpdater.cs +5 -5
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/LockFileUpdater.cs +2 -10
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/PackageReferenceUpdater.cs +38 -33
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/PackagesConfigUpdater.cs +12 -11
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdaterWorker.cs +16 -12
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/ConsoleLogger.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/DependencyConflictResolver.cs +19 -19
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/ILogger.cs +11 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +18 -17
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/NuGetHelper.cs +1 -17
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/PathHelper.cs +17 -9
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/ProjectHelper.cs +96 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Analyze/AnalyzeWorkerTests.cs +87 -5
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTestBase.cs +2 -5
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.PackagesConfig.cs +16 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Proj.cs +6 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Project.cs +147 -36
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.cs +184 -48
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/ExpectedDiscoveryResults.cs +5 -5
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/SdkProjectDiscoveryTests.cs +32 -10
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/RunWorkerTests.cs +400 -76
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/SerializationTests.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/UpdatedDependencyListTests.cs +60 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/TestLogger.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/BindingRedirectsTests.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs +4 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackageReference.cs +40 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/AssertEx.cs +1 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/LinuxOnlyAttribute.cs +12 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +8 -5
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/PathHelperTests.cs +47 -2
- data/lib/dependabot/nuget/analysis/analysis_json_reader.rb +3 -1
- data/lib/dependabot/nuget/file_fetcher.rb +12 -393
- data/lib/dependabot/nuget/file_parser.rb +23 -60
- data/lib/dependabot/nuget/file_updater.rb +21 -16
- data/lib/dependabot/nuget/native_discovery/native_dependency_file_discovery.rb +2 -9
- data/lib/dependabot/nuget/native_discovery/native_discovery_json_reader.rb +183 -77
- data/lib/dependabot/nuget/native_discovery/native_project_discovery.rb +25 -3
- data/lib/dependabot/nuget/native_discovery/native_workspace_discovery.rb +1 -8
- data/lib/dependabot/nuget/native_update_checker/native_update_checker.rb +17 -4
- metadata +8 -9
- data/helpers/lib/NuGetUpdater/NuGetProjects/Directory.Packages.props +0 -29
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/RequirementConverter.cs +0 -17
- data/lib/dependabot/nuget/file_fetcher/import_paths_finder.rb +0 -73
- data/lib/dependabot/nuget/file_fetcher/sln_project_paths_finder.rb +0 -60
@@ -1,73 +0,0 @@
|
|
1
|
-
# typed: strict
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require "nokogiri"
|
5
|
-
require "pathname"
|
6
|
-
require "sorbet-runtime"
|
7
|
-
|
8
|
-
require "dependabot/nuget/file_fetcher"
|
9
|
-
|
10
|
-
module Dependabot
|
11
|
-
module Nuget
|
12
|
-
class FileFetcher
|
13
|
-
class ImportPathsFinder
|
14
|
-
extend T::Sig
|
15
|
-
sig { params(project_file: T.untyped).void }
|
16
|
-
def initialize(project_file:)
|
17
|
-
@project_file = T.let(project_file, Dependabot::DependencyFile)
|
18
|
-
end
|
19
|
-
|
20
|
-
sig { returns(T::Array[String]) }
|
21
|
-
def import_paths
|
22
|
-
doc = T.let(Nokogiri::XML(project_file.content), Nokogiri::XML::Document)
|
23
|
-
doc.remove_namespaces!
|
24
|
-
doc.xpath("/Project/Import").filter_map do |import_node|
|
25
|
-
path = import_node.attribute("Project").value.strip.tr("\\", "/")
|
26
|
-
path = File.join(current_dir, path) unless current_dir.nil?
|
27
|
-
Pathname.new(path).cleanpath.to_path
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
sig { returns(T::Array[String]) }
|
32
|
-
def project_reference_paths
|
33
|
-
doc = T.let(Nokogiri::XML(project_file.content), Nokogiri::XML::Document)
|
34
|
-
doc.remove_namespaces!
|
35
|
-
doc.xpath("/Project/ItemGroup/ProjectReference").filter_map do |node|
|
36
|
-
attribute = node.attribute("Include")
|
37
|
-
next unless attribute
|
38
|
-
|
39
|
-
path = attribute.value.strip.tr("\\", "/")
|
40
|
-
path = File.join(current_dir, path) unless current_dir.nil?
|
41
|
-
Pathname.new(path).cleanpath.to_path
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
sig { returns(T::Array[String]) }
|
46
|
-
def project_file_paths
|
47
|
-
doc = T.let(Nokogiri::XML(project_file.content), Nokogiri::XML::Document)
|
48
|
-
doc.remove_namespaces!
|
49
|
-
doc.xpath("/Project/ItemGroup/ProjectFile").filter_map do |node|
|
50
|
-
attribute = node.attribute("Include")
|
51
|
-
next unless attribute
|
52
|
-
|
53
|
-
path = attribute.value.strip.tr("\\", "/")
|
54
|
-
path = File.join(current_dir, path) unless current_dir.nil?
|
55
|
-
Pathname.new(path).cleanpath.to_path
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
private
|
60
|
-
|
61
|
-
sig { returns(Dependabot::DependencyFile) }
|
62
|
-
attr_reader :project_file
|
63
|
-
|
64
|
-
sig { returns(T.nilable(String)) }
|
65
|
-
def current_dir
|
66
|
-
current_dir = project_file.name.rpartition("/").first
|
67
|
-
current_dir = nil if current_dir == ""
|
68
|
-
current_dir
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
@@ -1,60 +0,0 @@
|
|
1
|
-
# typed: strong
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
require "pathname"
|
5
|
-
require "sorbet-runtime"
|
6
|
-
|
7
|
-
require "dependabot/nuget/file_fetcher"
|
8
|
-
|
9
|
-
module Dependabot
|
10
|
-
module Nuget
|
11
|
-
class FileFetcher
|
12
|
-
class SlnProjectPathsFinder
|
13
|
-
extend T::Sig
|
14
|
-
|
15
|
-
sig { params(sln_file: Dependabot::DependencyFile).void }
|
16
|
-
def initialize(sln_file:)
|
17
|
-
@sln_file = sln_file
|
18
|
-
end
|
19
|
-
|
20
|
-
sig { returns(T::Array[String]) }
|
21
|
-
def project_paths
|
22
|
-
paths = T.let([], T::Array[String])
|
23
|
-
return paths unless sln_file.content
|
24
|
-
|
25
|
-
sln_file_lines = T.must(sln_file.content).lines
|
26
|
-
|
27
|
-
sln_file_lines.each do |line|
|
28
|
-
next unless line.match?(/^\s*Project\(/)
|
29
|
-
next unless line.split('"')[5]
|
30
|
-
|
31
|
-
path = line.split('"')[5]
|
32
|
-
next unless path
|
33
|
-
|
34
|
-
path = path.tr("\\", "/")
|
35
|
-
|
36
|
-
# If the path doesn't have an extension it's probably a directory
|
37
|
-
next unless path.match?(/\.[a-z]{2}proj$/)
|
38
|
-
|
39
|
-
path = File.join(current_dir, path) unless current_dir.nil?
|
40
|
-
paths << Pathname.new(path).cleanpath.to_path
|
41
|
-
end
|
42
|
-
|
43
|
-
paths
|
44
|
-
end
|
45
|
-
|
46
|
-
private
|
47
|
-
|
48
|
-
sig { returns(Dependabot::DependencyFile) }
|
49
|
-
attr_reader :sln_file
|
50
|
-
|
51
|
-
sig { returns(T.nilable(String)) }
|
52
|
-
def current_dir
|
53
|
-
current_dir = sln_file.name.rpartition("/").first
|
54
|
-
current_dir = nil if current_dir == ""
|
55
|
-
current_dir
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|