dependabot-gradle 0.390.0 → 0.391.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.
- checksums.yaml +4 -4
- data/lib/dependabot/gradle/distributions.rb +2 -2
- data/lib/dependabot/gradle/file_fetcher.rb +6 -6
- data/lib/dependabot/gradle/file_parser/property_value_finder.rb +1 -1
- data/lib/dependabot/gradle/file_parser/repositories_finder.rb +5 -5
- data/lib/dependabot/gradle/file_parser.rb +12 -18
- data/lib/dependabot/gradle/file_updater/lockfile_updater.rb +65 -23
- data/lib/dependabot/gradle/file_updater/wrapper/command_builder.rb +3 -3
- data/lib/dependabot/gradle/file_updater/wrapper/executing_version_detector.rb +2 -5
- data/lib/dependabot/gradle/file_updater/wrapper/properties_document.rb +2 -2
- data/lib/dependabot/gradle/file_updater/wrapper/properties_reconciler.rb +1 -4
- data/lib/dependabot/gradle/file_updater/wrapper_updater.rb +1 -1
- data/lib/dependabot/gradle/file_updater.rb +27 -74
- data/lib/dependabot/gradle/metadata_finder.rb +8 -7
- data/lib/dependabot/gradle/package/package_details_fetcher.rb +5 -5
- data/lib/dependabot/gradle/update_checker/multi_dependency_updater.rb +14 -14
- data/lib/dependabot/gradle/update_checker/requirements_updater.rb +30 -10
- data/lib/dependabot/gradle/update_checker.rb +9 -13
- data/lib/dependabot/gradle/version.rb +5 -8
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dc95dfd45dcabce388680e617eaffd9ba19b84ef8a729cffd616cfb06ad4cb43
|
|
4
|
+
data.tar.gz: 67e2f381c9cabd09d54a93b0c153ad7e64a1344a652954e0d59a5008dfd7d56e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 31931d172c06b4afca6bb258af47b1e6420fc59c46ac3dc63d483e5c5e18395a775dcbe6fcd8ae77a38f611378e5cb4d84db26d26851ca52e36dc20413b4f220
|
|
7
|
+
data.tar.gz: b2faa2bcf5a79fb88d2e085ff504ad55028cfcd8f8f6851d54815a902137fa19b91eef51d1e1eb60c514d1f8e4f039b1d588f75d1d037b43aae58cf700863013
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# typed:
|
|
1
|
+
# typed: strong
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
4
|
require "dependabot/dependency_requirement"
|
|
@@ -14,7 +14,7 @@ module Dependabot
|
|
|
14
14
|
sig { params(requirements: T::Array[Dependabot::DependencyRequirement]).returns(T::Boolean) }
|
|
15
15
|
def self.distribution_requirements?(requirements)
|
|
16
16
|
requirements.any? do |req|
|
|
17
|
-
req.
|
|
17
|
+
req.source_string("type") == DISTRIBUTION_DEPENDENCY_TYPE
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
end
|
|
@@ -16,13 +16,13 @@ module Dependabot
|
|
|
16
16
|
require_relative "file_parser"
|
|
17
17
|
require_relative "file_fetcher/settings_file_parser"
|
|
18
18
|
|
|
19
|
-
SUPPORTED_LOCK_FILE_NAMES =
|
|
19
|
+
SUPPORTED_LOCK_FILE_NAMES = %w(gradle.lockfile).freeze
|
|
20
20
|
|
|
21
21
|
SUPPORTED_BUILD_FILE_NAMES =
|
|
22
|
-
|
|
22
|
+
%w(build.gradle build.gradle.kts).freeze
|
|
23
23
|
|
|
24
24
|
SUPPORTED_SETTINGS_FILE_NAMES =
|
|
25
|
-
|
|
25
|
+
%w(settings.gradle settings.gradle.kts).freeze
|
|
26
26
|
|
|
27
27
|
SUPPORTED_WRAPPER_FILES_PATH = %w(
|
|
28
28
|
gradlew
|
|
@@ -33,10 +33,10 @@ module Dependabot
|
|
|
33
33
|
|
|
34
34
|
# For now Gradle only supports library .toml files in the main gradle folder
|
|
35
35
|
SUPPORTED_VERSION_CATALOG_FILE_PATH =
|
|
36
|
-
|
|
36
|
+
%w(/gradle/libs.versions.toml).freeze
|
|
37
37
|
|
|
38
38
|
PLUGIN_SOURCE_SET_DIRS =
|
|
39
|
-
|
|
39
|
+
%w(src/main/java src/main/kotlin src/main/groovy src/main/resources).freeze
|
|
40
40
|
|
|
41
41
|
sig do
|
|
42
42
|
override
|
|
@@ -52,7 +52,7 @@ module Dependabot
|
|
|
52
52
|
def initialize(source:, credentials:, repo_contents_path: nil, options: {}, update_config: nil)
|
|
53
53
|
super
|
|
54
54
|
|
|
55
|
-
@lockfile_name = T.let(
|
|
55
|
+
@lockfile_name = T.let(SUPPORTED_LOCK_FILE_NAMES.first, String)
|
|
56
56
|
@buildfile_name = T.let(nil, T.nilable(String))
|
|
57
57
|
end
|
|
58
58
|
|
|
@@ -73,7 +73,7 @@ module Dependabot
|
|
|
73
73
|
|
|
74
74
|
sig { params(dependency_files: T::Array[Dependabot::DependencyFile]).void }
|
|
75
75
|
def initialize(dependency_files:)
|
|
76
|
-
@dependency_files =
|
|
76
|
+
@dependency_files = dependency_files
|
|
77
77
|
@properties = T.let({}, T::Hash[String, T::Hash[String, T::Hash[Symbol, String]]])
|
|
78
78
|
@top_level_buildfile = T.let(nil, T.nilable(Dependabot::DependencyFile))
|
|
79
79
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# typed:
|
|
1
|
+
# typed: strong
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
4
|
require "sorbet-runtime"
|
|
@@ -11,8 +11,8 @@ module Dependabot
|
|
|
11
11
|
class RepositoriesFinder
|
|
12
12
|
extend T::Sig
|
|
13
13
|
|
|
14
|
-
SUPPORTED_BUILD_FILE_NAMES =
|
|
15
|
-
SUPPORTED_SETTINGS_FILE_NAMES =
|
|
14
|
+
SUPPORTED_BUILD_FILE_NAMES = %w(build.gradle build.gradle.kts).freeze
|
|
15
|
+
SUPPORTED_SETTINGS_FILE_NAMES = %w(settings.gradle settings.gradle.kts).freeze
|
|
16
16
|
|
|
17
17
|
# The Central Repo doesn't have special status for Gradle, but until
|
|
18
18
|
# we're confident we're selecting repos correctly it's wise to include
|
|
@@ -37,8 +37,8 @@ module Dependabot
|
|
|
37
37
|
).void
|
|
38
38
|
end
|
|
39
39
|
def initialize(dependency_files:, target_dependency_file:, credentials: [])
|
|
40
|
-
@dependency_files =
|
|
41
|
-
@credentials =
|
|
40
|
+
@dependency_files = dependency_files
|
|
41
|
+
@credentials = credentials
|
|
42
42
|
raise "No target file!" unless target_dependency_file
|
|
43
43
|
|
|
44
44
|
@target_dependency_file = T.let(target_dependency_file, Dependabot::DependencyFile)
|
|
@@ -28,28 +28,22 @@ module Dependabot
|
|
|
28
28
|
require_relative "file_parser/distributions_finder"
|
|
29
29
|
require_relative "file_parser/property_value_finder"
|
|
30
30
|
|
|
31
|
-
SUPPORTED_BUILD_FILE_NAMES =
|
|
32
|
-
%w(build.gradle build.gradle.kts settings.gradle settings.gradle.kts).freeze,
|
|
33
|
-
T::Array[String]
|
|
34
|
-
)
|
|
31
|
+
SUPPORTED_BUILD_FILE_NAMES = %w(build.gradle build.gradle.kts settings.gradle settings.gradle.kts).freeze
|
|
35
32
|
|
|
36
|
-
PROPERTY_REGEX =
|
|
37
|
-
/
|
|
33
|
+
PROPERTY_REGEX = /
|
|
38
34
|
(?:\$\{property\((?<property_name>[^:\s]*?)\)\})|
|
|
39
35
|
(?:\$\{(?<property_name>[^:\s]*?)\})|
|
|
40
36
|
(?:\$(?<property_name>[^:\s"']*))
|
|
41
|
-
/x
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
PLUGIN_BLOCK_DECLARATION_REGEX = T.let(/(?:^|\s)plugins\s*\{/, Regexp)
|
|
52
|
-
PLUGIN_ID_REGEX = T.let(/['"](?<id>#{PART})['"]/o, Regexp)
|
|
37
|
+
/x
|
|
38
|
+
|
|
39
|
+
PART = %r{[^\s,@'":/\\]+}
|
|
40
|
+
VSN_PART = %r{[^\s,'":/\\]+}
|
|
41
|
+
DEPENDENCY_DECLARATION_REGEX = /(?:\(|\s)\s*['"](?<declaration>#{PART}:#{PART}:#{VSN_PART})['"]/o
|
|
42
|
+
|
|
43
|
+
DEPENDENCY_SET_DECLARATION_REGEX = /(?:^|\s)dependencySet\((?<arguments>[^\)]+)\)\s*\{/
|
|
44
|
+
DEPENDENCY_SET_ENTRY_REGEX = /entry\s+['"](?<name>#{PART})['"]/o
|
|
45
|
+
PLUGIN_BLOCK_DECLARATION_REGEX = /(?:^|\s)plugins\s*\{/
|
|
46
|
+
PLUGIN_ID_REGEX = /['"](?<id>#{PART})['"]/o
|
|
53
47
|
|
|
54
48
|
sig { override.returns(T::Array[Dependabot::Dependency]) }
|
|
55
49
|
def parse
|
|
@@ -15,14 +15,11 @@ module Dependabot
|
|
|
15
15
|
class LockfileUpdater
|
|
16
16
|
extend T::Sig
|
|
17
17
|
|
|
18
|
-
INIT_SCRIPT_TASK_NAME =
|
|
19
|
-
GRADLE_JVMARGS_ATTEMPTS =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
].freeze,
|
|
24
|
-
T::Array[String]
|
|
25
|
-
)
|
|
18
|
+
INIT_SCRIPT_TASK_NAME = "dependabotResolveAll"
|
|
19
|
+
GRADLE_JVMARGS_ATTEMPTS = [
|
|
20
|
+
"-Xmx1536m -Dfile.encoding=UTF-8",
|
|
21
|
+
"-Xmx2048m -Dfile.encoding=UTF-8"
|
|
22
|
+
].freeze
|
|
26
23
|
sig do
|
|
27
24
|
params(
|
|
28
25
|
dependency_files: T::Array[Dependabot::DependencyFile],
|
|
@@ -64,8 +61,7 @@ module Dependabot
|
|
|
64
61
|
"--init-script", init_script_path,
|
|
65
62
|
*lockfile_tasks_for(build_files),
|
|
66
63
|
"--write-locks",
|
|
67
|
-
"--no-daemon"
|
|
68
|
-
"--no-configuration-cache"
|
|
64
|
+
"--no-daemon"
|
|
69
65
|
]
|
|
70
66
|
command = Shellwords.join(command_parts)
|
|
71
67
|
run_lockfile_update_with_retry(
|
|
@@ -310,28 +306,74 @@ systemProp.https.proxyPort=#{https_proxy_port}"
|
|
|
310
306
|
|
|
311
307
|
sig { params(file_name: String).void }
|
|
312
308
|
def write_init_script(file_name)
|
|
313
|
-
# Resolve
|
|
314
|
-
#
|
|
309
|
+
# Resolve every lockable configuration in one invocation. Not from the task action: that
|
|
310
|
+
# needs the project, which the configuration cache forbids.
|
|
315
311
|
script_content = <<~GRADLE
|
|
316
312
|
allprojects {
|
|
317
313
|
if (tasks.findByName("#{INIT_SCRIPT_TASK_NAME}") == null) {
|
|
318
|
-
tasks.
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
314
|
+
tasks.create("#{INIT_SCRIPT_TASK_NAME}") { }
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
gradle.projectsEvaluated {
|
|
319
|
+
// Prepare every project before resolving anything: with a project dependency,
|
|
320
|
+
// resolving one project computes the other project's javaCompiler.
|
|
321
|
+
#{compiler_fallback_snippet}
|
|
322
|
+
|
|
323
|
+
gradle.rootProject.allprojects { target ->
|
|
324
|
+
target.configurations.findAll {
|
|
325
|
+
it.canBeResolved &&
|
|
326
|
+
it.resolutionStrategy.dependencyLockingEnabled &&
|
|
327
|
+
it.allDependencies.any { dependency ->
|
|
328
|
+
dependency instanceof org.gradle.api.artifacts.ModuleDependency
|
|
329
|
+
}
|
|
330
|
+
}.each { it.incoming.resolutionResult.allDependencies }
|
|
329
331
|
}
|
|
330
332
|
}
|
|
331
333
|
GRADLE
|
|
332
334
|
File.write(file_name, script_content)
|
|
333
335
|
end
|
|
334
336
|
|
|
337
|
+
# Resolving computes the compile task's javaCompiler, which fails when the toolchain is
|
|
338
|
+
# missing. Only the compiler is swapped, so resolution is unaffected.
|
|
339
|
+
sig { returns(String) }
|
|
340
|
+
def compiler_fallback_snippet
|
|
341
|
+
<<~GRADLE.gsub(/^/, " ")
|
|
342
|
+
gradle.rootProject.allprojects { target ->
|
|
343
|
+
// By name: JavaToolchainService only exists from 6.7, locking from 4.8.
|
|
344
|
+
def javaExtension = target.extensions.findByName("java")
|
|
345
|
+
def toolchainService = target.extensions.findByName("javaToolchains")
|
|
346
|
+
if (javaExtension != null && toolchainService != null) {
|
|
347
|
+
def toolchain = javaExtension.toolchain
|
|
348
|
+
// Toolchains landed in 6.7, vendor and implementation in 6.8, native image in 8.14.
|
|
349
|
+
def constraints = ["vendor", "implementation", "nativeImageCapable"].collectEntries { name ->
|
|
350
|
+
[(name): toolchain.hasProperty(name) ? toolchain."$name".getOrNull() : null]
|
|
351
|
+
}
|
|
352
|
+
if (toolchain.languageVersion.present) {
|
|
353
|
+
def requested = toolchain.languageVersion.get()
|
|
354
|
+
try {
|
|
355
|
+
// Throwaway spec: compilerFor finalizes whatever spec it is given.
|
|
356
|
+
toolchainService.compilerFor { spec ->
|
|
357
|
+
spec.languageVersion.set(requested)
|
|
358
|
+
constraints.each { name, value -> if (value != null) spec."$name".set(value) }
|
|
359
|
+
}.get()
|
|
360
|
+
} catch (Exception ignored) {
|
|
361
|
+
def fallback = JavaLanguageVersion.of(JavaVersion.current().majorVersion)
|
|
362
|
+
target.logger.lifecycle("Dependabot: Java toolchain " + requested +
|
|
363
|
+
" is not available, compiling with " + fallback + " to resolve dependencies.")
|
|
364
|
+
def c = toolchainService.compilerFor { s -> s.languageVersion.set(fallback) }
|
|
365
|
+
target.tasks.withType(JavaCompile).configureEach { t -> t.javaCompiler.set(c) }
|
|
366
|
+
// Kotlin asks for its own toolchain; convention plugins compile during config.
|
|
367
|
+
def l = toolchainService.launcherFor { s -> s.languageVersion.set(fallback) }
|
|
368
|
+
target.tasks.matching { it.hasProperty("kotlinJavaToolchain") }
|
|
369
|
+
.configureEach { t -> t.kotlinJavaToolchain.toolchain.use(l) }
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
GRADLE
|
|
375
|
+
end
|
|
376
|
+
|
|
335
377
|
sig { params(build_files: T::Array[Dependabot::DependencyFile]).returns(T::Array[String]) }
|
|
336
378
|
def lockfile_tasks_for(build_files)
|
|
337
379
|
build_files.filter_map { |build_file| dependency_task_for(build_file) }.uniq << INIT_SCRIPT_TASK_NAME
|
|
@@ -79,19 +79,19 @@ module Dependabot
|
|
|
79
79
|
|
|
80
80
|
sig { returns(String) }
|
|
81
81
|
def version
|
|
82
|
-
T.
|
|
82
|
+
T.must(T.must(@requirements[0]).requirement_string)
|
|
83
83
|
end
|
|
84
84
|
|
|
85
85
|
sig { returns(T.nilable(String)) }
|
|
86
86
|
def checksum
|
|
87
87
|
return nil unless @requirements.size > 1
|
|
88
88
|
|
|
89
|
-
T.
|
|
89
|
+
T.must(T.must(@requirements[1]).requirement_string)
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
sig { returns(T.nilable(String)) }
|
|
93
93
|
def distribution_type
|
|
94
|
-
url = T.
|
|
94
|
+
url = T.must(@requirements[0]).source_string("url")
|
|
95
95
|
# Anchor to the `-bin.zip` / `-all.zip` filename suffix so a path segment such as a
|
|
96
96
|
# mirror host (e.g. https://binaries.example.com/...) can't false-match `bin`/`all`.
|
|
97
97
|
url&.match(/-(bin|all)\.zip/)&.captures&.first
|
|
@@ -23,13 +23,10 @@ module Dependabot
|
|
|
23
23
|
# Anchored to the `gradle-<version>-(bin|all).zip` filename so host/port numbers in custom
|
|
24
24
|
# mirror URLs are never mistaken for the version. The captured token is validated with
|
|
25
25
|
# Version.correct? so non-version matches (and RC/milestone names) are handled safely.
|
|
26
|
-
DISTRIBUTION_URL_VERSION_REGEX =
|
|
27
|
-
/gradle-(?<version>.+?)-(?:bin|all)\.zip/,
|
|
28
|
-
Regexp
|
|
29
|
-
)
|
|
26
|
+
DISTRIBUTION_URL_VERSION_REGEX = /gradle-(?<version>.+?)-(?:bin|all)\.zip/
|
|
30
27
|
|
|
31
28
|
# Matches the version printed by `gradle --version`, e.g. "Gradle 9.2.1".
|
|
32
|
-
GRADLE_VERSION_OUTPUT_REGEX =
|
|
29
|
+
GRADLE_VERSION_OUTPUT_REGEX = /^Gradle\s+(?<version>\d+(?:\.\d+){1,2}(?:-[\w.]+)?)/
|
|
33
30
|
|
|
34
31
|
sig { params(distribution_url: T.nilable(String)).returns(T.nilable(Dependabot::Gradle::Version)) }
|
|
35
32
|
def self.from_distribution_url(distribution_url)
|
|
@@ -29,8 +29,8 @@ module Dependabot
|
|
|
29
29
|
|
|
30
30
|
# Properties files use `=`, `:` or whitespace as the key/value separator. Gradle always
|
|
31
31
|
# writes `=`, but we parse all three so user-authored files are handled faithfully.
|
|
32
|
-
KEY_VALUE_REGEX =
|
|
33
|
-
COMMENT_REGEX =
|
|
32
|
+
KEY_VALUE_REGEX = /\A(\s*)([^\s:=]+)(\s*[:=]\s*|\s+)(.*)\z/
|
|
33
|
+
COMMENT_REGEX = /\A\s*[#!]/
|
|
34
34
|
|
|
35
35
|
sig { params(content: String).returns(PropertiesDocument) }
|
|
36
36
|
def self.parse(content)
|
|
@@ -22,10 +22,7 @@ module Dependabot
|
|
|
22
22
|
|
|
23
23
|
# Keys whose value is owned by the update itself and therefore taken from the regenerated
|
|
24
24
|
# file. Everything not listed here is preserved verbatim from the user's original file.
|
|
25
|
-
MANAGED_KEYS =
|
|
26
|
-
%w(distributionUrl distributionSha256Sum).freeze,
|
|
27
|
-
T::Array[String]
|
|
28
|
-
)
|
|
25
|
+
MANAGED_KEYS = %w(distributionUrl distributionSha256Sum).freeze
|
|
29
26
|
|
|
30
27
|
# Reconciles the regenerated wrapper properties back onto the user's original file.
|
|
31
28
|
#
|
|
@@ -59,7 +59,7 @@ module Dependabot
|
|
|
59
59
|
|
|
60
60
|
# we only run this updater if the build file has a requirement for this dependency
|
|
61
61
|
target_requirements = dependency.requirements.select do |req|
|
|
62
|
-
|
|
62
|
+
req.file == build_file.name
|
|
63
63
|
end
|
|
64
64
|
return [] unless target_requirements.any?
|
|
65
65
|
|
|
@@ -74,10 +74,10 @@ module Dependabot
|
|
|
74
74
|
.reject { |new_req, old_req| new_req == old_req }
|
|
75
75
|
# Loop through each changed requirement and update the buildfiles
|
|
76
76
|
reqs.each do |new_req, old_req|
|
|
77
|
-
raise "Bad req match" if old_req.nil? ||
|
|
78
|
-
next if
|
|
77
|
+
raise "Bad req match" if old_req.nil? || new_req.file != old_req.file
|
|
78
|
+
next if new_req.requirement == old_req.requirement
|
|
79
79
|
|
|
80
|
-
buildfile = files.find { |f| f.name ==
|
|
80
|
+
buildfile = files.find { |f| f.name == new_req.file }
|
|
81
81
|
|
|
82
82
|
# Currently, Dependabot assumes that Gradle projects using Gradle submodules are all in a single
|
|
83
83
|
# repo. However, some projects are actually using git submodule references for the Gradle submodules.
|
|
@@ -88,10 +88,9 @@ module Dependabot
|
|
|
88
88
|
|
|
89
89
|
raise DependencyFileNotResolvable, "No build file found to update the dependency" if buildfile.nil?
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
if metadata && metadata[:property_name].is_a?(String)
|
|
91
|
+
if new_req.metadata_string("property_name")
|
|
93
92
|
files = update_files_for_property_change(files, old_req, new_req)
|
|
94
|
-
elsif
|
|
93
|
+
elsif new_req.metadata_string_hash("dependency_set")
|
|
95
94
|
files = update_files_for_dep_set_change(files, old_req, new_req)
|
|
96
95
|
else
|
|
97
96
|
files[T.must(files.index(buildfile))] = update_version_in_buildfile(dependency, buildfile, old_req, new_req)
|
|
@@ -170,47 +169,45 @@ module Dependabot
|
|
|
170
169
|
sig do
|
|
171
170
|
params(
|
|
172
171
|
buildfiles: T::Array[Dependabot::DependencyFile],
|
|
173
|
-
old_req:
|
|
174
|
-
new_req:
|
|
172
|
+
old_req: Dependabot::DependencyRequirement,
|
|
173
|
+
new_req: Dependabot::DependencyRequirement
|
|
175
174
|
)
|
|
176
175
|
.returns(T::Array[Dependabot::DependencyFile])
|
|
177
176
|
end
|
|
178
177
|
def update_files_for_property_change(buildfiles, old_req, new_req)
|
|
179
178
|
files = buildfiles.dup
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
file = string_value(new_req, :file)
|
|
179
|
+
property_name = T.must(new_req.metadata_string("property_name"))
|
|
180
|
+
file = T.must(new_req.file)
|
|
183
181
|
buildfile = T.must(files.find { |f| f.name == file })
|
|
184
182
|
|
|
185
183
|
PropertyValueUpdater.new(dependency_files: files)
|
|
186
184
|
.update_files_for_property_change(
|
|
187
185
|
property_name: property_name,
|
|
188
186
|
callsite_buildfile: buildfile,
|
|
189
|
-
previous_value:
|
|
190
|
-
updated_value:
|
|
187
|
+
previous_value: T.must(old_req.requirement_string),
|
|
188
|
+
updated_value: T.must(new_req.requirement_string)
|
|
191
189
|
)
|
|
192
190
|
end
|
|
193
191
|
|
|
194
192
|
sig do
|
|
195
193
|
params(
|
|
196
194
|
buildfiles: T::Array[Dependabot::DependencyFile],
|
|
197
|
-
old_req:
|
|
198
|
-
new_req:
|
|
195
|
+
old_req: Dependabot::DependencyRequirement,
|
|
196
|
+
new_req: Dependabot::DependencyRequirement
|
|
199
197
|
)
|
|
200
198
|
.returns(T::Array[Dependabot::DependencyFile])
|
|
201
199
|
end
|
|
202
200
|
def update_files_for_dep_set_change(buildfiles, old_req, new_req)
|
|
203
201
|
files = buildfiles.dup
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
buildfile = T.must(files.find { |f| f.name == string_value(new_req, :file) })
|
|
202
|
+
dependency_set = T.must(new_req.metadata_string_hash("dependency_set"))
|
|
203
|
+
buildfile = T.must(files.find { |f| f.name == new_req.file })
|
|
207
204
|
|
|
208
205
|
DependencySetUpdater.new(dependency_files: files)
|
|
209
206
|
.update_files_for_dep_set_change(
|
|
210
207
|
dependency_set: dependency_set,
|
|
211
208
|
buildfile: buildfile,
|
|
212
|
-
previous_requirement:
|
|
213
|
-
updated_requirement:
|
|
209
|
+
previous_requirement: T.must(old_req.requirement_string),
|
|
210
|
+
updated_requirement: T.must(new_req.requirement_string)
|
|
214
211
|
)
|
|
215
212
|
end
|
|
216
213
|
|
|
@@ -218,8 +215,8 @@ module Dependabot
|
|
|
218
215
|
params(
|
|
219
216
|
dependency: Dependabot::Dependency,
|
|
220
217
|
buildfile: Dependabot::DependencyFile,
|
|
221
|
-
previous_req:
|
|
222
|
-
requirement:
|
|
218
|
+
previous_req: Dependabot::DependencyRequirement,
|
|
219
|
+
requirement: Dependabot::DependencyRequirement
|
|
223
220
|
)
|
|
224
221
|
.returns(Dependabot::DependencyFile)
|
|
225
222
|
end
|
|
@@ -249,13 +246,13 @@ module Dependabot
|
|
|
249
246
|
sig do
|
|
250
247
|
params(
|
|
251
248
|
dependency: Dependabot::Dependency,
|
|
252
|
-
requirement:
|
|
249
|
+
requirement: Dependabot::DependencyRequirement
|
|
253
250
|
).returns(T::Array[String])
|
|
254
251
|
end
|
|
255
252
|
def original_buildfile_declarations(dependency, requirement)
|
|
256
253
|
# This implementation is limited to declarations that appear on a
|
|
257
254
|
# single line.
|
|
258
|
-
file =
|
|
255
|
+
file = T.must(requirement.file)
|
|
259
256
|
buildfile = T.must(buildfiles.find { |f| f.name == file })
|
|
260
257
|
|
|
261
258
|
T.must(buildfile.content).lines.select do |line|
|
|
@@ -266,11 +263,7 @@ module Dependabot
|
|
|
266
263
|
dep_parts = dependency.name.split(":")
|
|
267
264
|
next false unless line.include?(T.must(dep_parts.first)) || line.include?(T.must(dep_parts.last))
|
|
268
265
|
elsif file.end_with?(".properties")
|
|
269
|
-
|
|
270
|
-
property = T.let(nil, T.nilable(String))
|
|
271
|
-
source_hash = symbol_object_hash(source)
|
|
272
|
-
source_property = source_hash&.[](:property)
|
|
273
|
-
property = source_property if source_property.is_a?(String)
|
|
266
|
+
property = requirement.source_string("property")
|
|
274
267
|
next false unless property && line.start_with?(property)
|
|
275
268
|
elsif file.end_with?(".toml")
|
|
276
269
|
next false unless line.include?(dependency.name)
|
|
@@ -280,7 +273,7 @@ module Dependabot
|
|
|
280
273
|
next false unless line.match?(name_regex)
|
|
281
274
|
end
|
|
282
275
|
|
|
283
|
-
line.include?(
|
|
276
|
+
line.include?(T.must(requirement.requirement_string))
|
|
284
277
|
end
|
|
285
278
|
end
|
|
286
279
|
# rubocop:enable Metrics/AbcSize
|
|
@@ -315,57 +308,17 @@ module Dependabot
|
|
|
315
308
|
sig do
|
|
316
309
|
params(
|
|
317
310
|
original_buildfile_declaration: String,
|
|
318
|
-
previous_req:
|
|
319
|
-
requirement:
|
|
311
|
+
previous_req: Dependabot::DependencyRequirement,
|
|
312
|
+
requirement: Dependabot::DependencyRequirement
|
|
320
313
|
).returns(String)
|
|
321
314
|
end
|
|
322
315
|
def updated_buildfile_declaration(original_buildfile_declaration, previous_req, requirement)
|
|
323
|
-
original_req_string =
|
|
324
|
-
new_req_string =
|
|
316
|
+
original_req_string = T.must(previous_req.requirement_string)
|
|
317
|
+
new_req_string = T.must(requirement.requirement_string)
|
|
325
318
|
|
|
326
319
|
original_buildfile_declaration.gsub(original_req_string, new_req_string)
|
|
327
320
|
end
|
|
328
321
|
|
|
329
|
-
sig { params(hash: T::Hash[Symbol, Object], key: Symbol).returns(String) }
|
|
330
|
-
def string_value(hash, key)
|
|
331
|
-
value = hash.fetch(key)
|
|
332
|
-
raise TypeError, "Expected #{key} to be a String" unless value.is_a?(String)
|
|
333
|
-
|
|
334
|
-
value
|
|
335
|
-
end
|
|
336
|
-
|
|
337
|
-
sig { params(hash: T::Hash[Symbol, Object], key: Symbol).returns(T::Hash[Symbol, Object]) }
|
|
338
|
-
def symbol_object_hash_value(hash, key)
|
|
339
|
-
value = hash.fetch(key)
|
|
340
|
-
raise TypeError, "Expected #{key} to be a Hash" unless value.is_a?(Hash)
|
|
341
|
-
|
|
342
|
-
value
|
|
343
|
-
end
|
|
344
|
-
|
|
345
|
-
sig { params(hash: T::Hash[Symbol, Object], key: Symbol).returns(T::Hash[Symbol, String]) }
|
|
346
|
-
def symbol_string_hash_value(hash, key)
|
|
347
|
-
value = hash.fetch(key)
|
|
348
|
-
raise TypeError, "Expected #{key} to be a Hash" unless value.is_a?(Hash)
|
|
349
|
-
|
|
350
|
-
result = T.let({}, T::Hash[Symbol, String])
|
|
351
|
-
value.each_pair do |hash_key_object, hash_value_object|
|
|
352
|
-
hash_key = T.cast(hash_key_object, T.nilable(Object))
|
|
353
|
-
hash_value = T.cast(hash_value_object, T.nilable(Object))
|
|
354
|
-
raise TypeError, "Expected #{key} keys and values to be Symbols and Strings" unless hash_key.is_a?(Symbol) &&
|
|
355
|
-
hash_value.is_a?(String)
|
|
356
|
-
|
|
357
|
-
result[hash_key] = hash_value
|
|
358
|
-
end
|
|
359
|
-
result
|
|
360
|
-
end
|
|
361
|
-
|
|
362
|
-
sig { params(value: T.nilable(Object)).returns(T.nilable(T::Hash[Symbol, Object])) }
|
|
363
|
-
def symbol_object_hash(value)
|
|
364
|
-
return unless value.is_a?(Hash)
|
|
365
|
-
|
|
366
|
-
value
|
|
367
|
-
end
|
|
368
|
-
|
|
369
322
|
sig { returns(T::Array[Dependabot::DependencyFile]) }
|
|
370
323
|
def buildfiles
|
|
371
324
|
@buildfiles ||= T.let(dependency_files.reject(&:support_file?), T.nilable(T::Array[Dependabot::DependencyFile]))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# typed:
|
|
1
|
+
# typed: strong
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
4
|
require "sorbet-runtime"
|
|
@@ -66,11 +66,12 @@ module Dependabot
|
|
|
66
66
|
|
|
67
67
|
sig { override.returns(String) }
|
|
68
68
|
def maven_repo_url
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
requirement = dependency.requirements.find(&:source)
|
|
70
|
+
return Gradle::FileParser::RepositoriesFinder::CENTRAL_REPO_URL unless requirement
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
raise TypeError, "Gradle repository source must be a hash" if requirement.source_hash.nil?
|
|
73
|
+
|
|
74
|
+
requirement.source_string("url") ||
|
|
74
75
|
Gradle::FileParser::RepositoriesFinder::CENTRAL_REPO_URL
|
|
75
76
|
end
|
|
76
77
|
|
|
@@ -81,12 +82,12 @@ module Dependabot
|
|
|
81
82
|
|
|
82
83
|
sig { returns(T::Boolean) }
|
|
83
84
|
def plugin?
|
|
84
|
-
dependency.requirements.any? { |r| r.
|
|
85
|
+
dependency.requirements.any? { |r| r.groups&.include?("plugins") }
|
|
85
86
|
end
|
|
86
87
|
|
|
87
88
|
sig { returns(T::Boolean) }
|
|
88
89
|
def kotlin_plugin?
|
|
89
|
-
plugin? && dependency.requirements.any? { |r| r.
|
|
90
|
+
plugin? && dependency.requirements.any? { |r| r.groups&.include?("kotlin") }
|
|
90
91
|
end
|
|
91
92
|
end
|
|
92
93
|
end
|
|
@@ -86,7 +86,7 @@ module Dependabot
|
|
|
86
86
|
@dependency_files = dependency_files
|
|
87
87
|
@credentials = credentials
|
|
88
88
|
@forbidden_urls = forbidden_urls
|
|
89
|
-
@cooldown_options =
|
|
89
|
+
@cooldown_options = cooldown_options
|
|
90
90
|
@repositories = T.let(nil, T.nilable(T::Array[T::Hash[String, Object]]))
|
|
91
91
|
@google_version_details = T.let(nil, T.nilable(Nokogiri::XML::Document))
|
|
92
92
|
@dependency_repository_details = T.let(nil, T.nilable(T::Array[T::Hash[String, Object]]))
|
|
@@ -346,7 +346,7 @@ module Dependabot
|
|
|
346
346
|
def dependency_repository_details
|
|
347
347
|
requirement_files =
|
|
348
348
|
dependency.requirements
|
|
349
|
-
.
|
|
349
|
+
.filter_map(&:file)
|
|
350
350
|
.map { |nm| dependency_files.find { |f| f.name == nm } }
|
|
351
351
|
|
|
352
352
|
@dependency_repository_details ||=
|
|
@@ -396,7 +396,7 @@ module Dependabot
|
|
|
396
396
|
|
|
397
397
|
sig { returns(T.nilable(Dependabot::DependencyFile)) }
|
|
398
398
|
def pom
|
|
399
|
-
filename = T.must(dependency.requirements.first).
|
|
399
|
+
filename = T.must(dependency.requirements.first).file
|
|
400
400
|
dependency_files.find { |f| f.name == filename }
|
|
401
401
|
end
|
|
402
402
|
|
|
@@ -425,12 +425,12 @@ module Dependabot
|
|
|
425
425
|
|
|
426
426
|
sig { returns(T::Boolean) }
|
|
427
427
|
def plugin?
|
|
428
|
-
dependency.requirements.any? { |r| r.
|
|
428
|
+
dependency.requirements.any? { |r| r.groups&.include?("plugins") }
|
|
429
429
|
end
|
|
430
430
|
|
|
431
431
|
sig { returns(T.nilable(T::Boolean)) }
|
|
432
432
|
def kotlin_plugin?
|
|
433
|
-
plugin? && dependency.requirements.any? { |r| r.
|
|
433
|
+
plugin? && dependency.requirements.any? { |r| r.groups&.include?("kotlin") }
|
|
434
434
|
end
|
|
435
435
|
|
|
436
436
|
sig { returns(T::Boolean) }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# typed:
|
|
1
|
+
# typed: strong
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
4
|
require "sorbet-runtime"
|
|
@@ -32,9 +32,9 @@ module Dependabot
|
|
|
32
32
|
ignored_versions:,
|
|
33
33
|
raise_on_ignored: false
|
|
34
34
|
)
|
|
35
|
-
@dependency =
|
|
36
|
-
@dependency_files =
|
|
37
|
-
@credentials =
|
|
35
|
+
@dependency = dependency
|
|
36
|
+
@dependency_files = dependency_files
|
|
37
|
+
@credentials = credentials
|
|
38
38
|
@target_version = T.let(
|
|
39
39
|
version_from_details(target_version_details),
|
|
40
40
|
T.nilable(Dependabot::Gradle::Version)
|
|
@@ -43,14 +43,14 @@ module Dependabot
|
|
|
43
43
|
source_url_from_details(target_version_details),
|
|
44
44
|
T.nilable(String)
|
|
45
45
|
)
|
|
46
|
-
@ignored_versions =
|
|
47
|
-
@raise_on_ignored =
|
|
46
|
+
@ignored_versions = ignored_versions
|
|
47
|
+
@raise_on_ignored = raise_on_ignored
|
|
48
48
|
@update_possible = T.let(nil, T.nilable(T::Boolean))
|
|
49
49
|
@updated_dependencies = T.let(nil, T.nilable(T::Array[Dependabot::Dependency]))
|
|
50
50
|
@dependencies_to_update = T.let(nil, T.nilable(T::Array[Dependabot::Dependency]))
|
|
51
51
|
@property_name = T.let(nil, T.nilable(String))
|
|
52
52
|
@dependency_set = T.let(nil, T.nilable(T::Hash[Symbol, String]))
|
|
53
|
-
@updated_requirements = T.let({}, T::Hash[String, T::Array[
|
|
53
|
+
@updated_requirements = T.let({}, T::Hash[String, T::Array[Dependabot::DependencyRequirement]])
|
|
54
54
|
end
|
|
55
55
|
sig { returns(T::Boolean) }
|
|
56
56
|
def update_possible?
|
|
@@ -128,8 +128,8 @@ module Dependabot
|
|
|
128
128
|
source: nil
|
|
129
129
|
).parse.select do |dep|
|
|
130
130
|
dep.requirements.any? do |r|
|
|
131
|
-
tmp_p_name = r.
|
|
132
|
-
tmp_dep_set = r.
|
|
131
|
+
tmp_p_name = r.metadata_string("property_name")
|
|
132
|
+
tmp_dep_set = r.metadata_string_hash("dependency_set")
|
|
133
133
|
next true if property_name && tmp_p_name == property_name
|
|
134
134
|
|
|
135
135
|
dependency_set && tmp_dep_set == dependency_set
|
|
@@ -140,18 +140,18 @@ module Dependabot
|
|
|
140
140
|
sig { returns(T.nilable(String)) }
|
|
141
141
|
def property_name
|
|
142
142
|
@property_name ||= dependency.requirements
|
|
143
|
-
.find { |r| r.
|
|
144
|
-
&.
|
|
143
|
+
.find { |r| r.metadata_string("property_name") }
|
|
144
|
+
&.metadata_string("property_name")
|
|
145
145
|
end
|
|
146
146
|
|
|
147
147
|
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
148
148
|
def dependency_set
|
|
149
149
|
@dependency_set ||= dependency.requirements
|
|
150
|
-
.find { |r| r.
|
|
151
|
-
&.
|
|
150
|
+
.find { |r| r.metadata_string_hash("dependency_set") }
|
|
151
|
+
&.metadata_string_hash("dependency_set")
|
|
152
152
|
end
|
|
153
153
|
|
|
154
|
-
sig { params(dep: Dependabot::Dependency).returns(T::Array[
|
|
154
|
+
sig { params(dep: Dependabot::Dependency).returns(T::Array[Dependabot::DependencyRequirement]) }
|
|
155
155
|
def updated_requirements(dep)
|
|
156
156
|
@updated_requirements[dep.name] ||=
|
|
157
157
|
RequirementsUpdater.new(
|
|
@@ -61,13 +61,14 @@ module Dependabot
|
|
|
61
61
|
# requirement at index `i` to correspond to the previous requirement
|
|
62
62
|
# at the same index.
|
|
63
63
|
requirements.map do |req|
|
|
64
|
-
|
|
65
|
-
next req if
|
|
64
|
+
requirement = req.requirement_string
|
|
65
|
+
next req if requirement.nil?
|
|
66
|
+
next req if requirement.include?(",")
|
|
66
67
|
|
|
67
|
-
property_name = req.
|
|
68
|
+
property_name = req.metadata_string("property_name")
|
|
68
69
|
next req if property_name && !properties_to_update.include?(property_name)
|
|
69
70
|
|
|
70
|
-
new_req = update_requirement(
|
|
71
|
+
new_req = update_requirement(requirement)
|
|
71
72
|
Dependabot::DependencyRequirement.create(req.merge(requirement: new_req, source: updated_source))
|
|
72
73
|
end
|
|
73
74
|
end
|
|
@@ -124,27 +125,29 @@ module Dependabot
|
|
|
124
125
|
distribution_url = T.let(nil, T.nilable(String))
|
|
125
126
|
|
|
126
127
|
requirements.map do |req|
|
|
127
|
-
source = req
|
|
128
|
+
source = req.source_hash
|
|
128
129
|
next req unless source
|
|
129
130
|
|
|
130
|
-
case
|
|
131
|
+
case req.source_string("property")
|
|
131
132
|
when "distributionUrl"
|
|
132
|
-
requirement = req
|
|
133
|
+
requirement = T.must(req.requirement_string)
|
|
133
134
|
version = update_exact_requirement(requirement)
|
|
134
|
-
distribution_url =
|
|
135
|
+
distribution_url = T.must(req.source_string("url")).gsub(requirement, version)
|
|
136
|
+
updated_source = set_source_string(source.dup, "url", distribution_url)
|
|
135
137
|
|
|
136
138
|
Dependabot::DependencyRequirement.create(
|
|
137
139
|
req.merge(
|
|
138
140
|
requirement: version,
|
|
139
|
-
source:
|
|
141
|
+
source: updated_source
|
|
140
142
|
)
|
|
141
143
|
)
|
|
142
144
|
when "distributionSha256Sum"
|
|
143
145
|
checksum_url, checksum = Gradle::Package::DistributionsFetcher.resolve_checksum(T.must(distribution_url))
|
|
146
|
+
updated_source = set_source_string(source.dup, "url", checksum_url)
|
|
144
147
|
Dependabot::DependencyRequirement.create(
|
|
145
148
|
req.merge(
|
|
146
149
|
requirement: checksum,
|
|
147
|
-
source:
|
|
150
|
+
source: updated_source
|
|
148
151
|
)
|
|
149
152
|
)
|
|
150
153
|
else
|
|
@@ -153,6 +156,23 @@ module Dependabot
|
|
|
153
156
|
end
|
|
154
157
|
end
|
|
155
158
|
|
|
159
|
+
sig do
|
|
160
|
+
params(
|
|
161
|
+
source: Dependabot::DependencyRequirement::ObjectHash,
|
|
162
|
+
key: String,
|
|
163
|
+
value: T.nilable(String)
|
|
164
|
+
).returns(Dependabot::DependencyRequirement::ObjectHash)
|
|
165
|
+
end
|
|
166
|
+
def set_source_string(source, key, value)
|
|
167
|
+
symbol_key = key.to_sym
|
|
168
|
+
if source.key?(key) && !source.key?(symbol_key)
|
|
169
|
+
source[key] = value
|
|
170
|
+
else
|
|
171
|
+
source[symbol_key] = value
|
|
172
|
+
end
|
|
173
|
+
source
|
|
174
|
+
end
|
|
175
|
+
|
|
156
176
|
sig { override.returns(T::Class[Version]) }
|
|
157
177
|
def version_class
|
|
158
178
|
Gradle::Version
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# typed:
|
|
1
|
+
# typed: strong
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
4
|
require "sorbet-runtime"
|
|
@@ -206,34 +206,30 @@ module Dependabot
|
|
|
206
206
|
next false if dep.name == dependency.name
|
|
207
207
|
|
|
208
208
|
dep.requirements.any? do |req|
|
|
209
|
-
req.
|
|
209
|
+
req.metadata_string("property_name") == property_name
|
|
210
210
|
end
|
|
211
211
|
end
|
|
212
212
|
end
|
|
213
213
|
end
|
|
214
214
|
|
|
215
|
-
sig { params(requirement:
|
|
215
|
+
sig { params(requirement: Dependabot::DependencyRequirement).returns(T.nilable(String)) }
|
|
216
216
|
def property_name_from_requirement(requirement)
|
|
217
|
-
|
|
218
|
-
return unless metadata.is_a?(Hash)
|
|
219
|
-
|
|
220
|
-
property_name = metadata[:property_name]
|
|
221
|
-
property_name if property_name.is_a?(String)
|
|
217
|
+
requirement.metadata_string("property_name")
|
|
222
218
|
end
|
|
223
219
|
|
|
224
220
|
sig { returns(T::Boolean) }
|
|
225
221
|
def version_comes_from_dependency_set?
|
|
226
222
|
dependency.requirements.any? do |req|
|
|
227
|
-
req.
|
|
223
|
+
req.metadata_string_hash("dependency_set")
|
|
228
224
|
end
|
|
229
225
|
end
|
|
230
226
|
|
|
231
|
-
sig { returns(T::Array[
|
|
227
|
+
sig { returns(T::Array[Dependabot::DependencyRequirement]) }
|
|
232
228
|
def declarations_using_a_property
|
|
233
229
|
@declarations_using_a_property ||= T.let(
|
|
234
230
|
dependency.requirements
|
|
235
|
-
.select { |req| req.
|
|
236
|
-
T.nilable(T::Array[
|
|
231
|
+
.select { |req| req.metadata_string("property_name") },
|
|
232
|
+
T.nilable(T::Array[Dependabot::DependencyRequirement])
|
|
237
233
|
)
|
|
238
234
|
end
|
|
239
235
|
|
|
@@ -244,7 +240,7 @@ module Dependabot
|
|
|
244
240
|
dependency_files: dependency_files,
|
|
245
241
|
source: nil
|
|
246
242
|
).parse.select do |dep|
|
|
247
|
-
dep.requirements.any? { |req| req.
|
|
243
|
+
dep.requirements.any? { |req| req.metadata_string("property_name") }
|
|
248
244
|
end,
|
|
249
245
|
T.nilable(T::Array[Dependabot::Dependency])
|
|
250
246
|
)
|
|
@@ -15,7 +15,7 @@ module Dependabot
|
|
|
15
15
|
class Version < Dependabot::Version
|
|
16
16
|
extend T::Sig
|
|
17
17
|
|
|
18
|
-
NULL_VALUES =
|
|
18
|
+
NULL_VALUES = %w(0 final ga).freeze
|
|
19
19
|
PREFIXED_TOKEN_HIERARCHY = T.let(
|
|
20
20
|
{
|
|
21
21
|
"." => { qualifier: 1, number: 4 },
|
|
@@ -39,13 +39,10 @@ module Dependabot
|
|
|
39
39
|
}.freeze,
|
|
40
40
|
T::Hash[String, Integer]
|
|
41
41
|
)
|
|
42
|
-
VERSION_PATTERN =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
String
|
|
47
|
-
)
|
|
48
|
-
ANCHORED_VERSION_PATTERN = T.let(/\A\s*(#{VERSION_PATTERN})?\s*\z/, Regexp)
|
|
42
|
+
VERSION_PATTERN = "[0-9a-zA-Z]+" \
|
|
43
|
+
'(?>\.[0-9a-zA-Z]*)*' \
|
|
44
|
+
'([_\-\+][0-9A-Za-z_-]*(\.[0-9A-Za-z_-]*)*)?'
|
|
45
|
+
ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/
|
|
49
46
|
|
|
50
47
|
sig { override.params(version: Object).returns(T::Boolean) }
|
|
51
48
|
def self.correct?(version)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dependabot-gradle
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.391.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dependabot
|
|
@@ -15,28 +15,28 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - '='
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.
|
|
18
|
+
version: 0.391.0
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - '='
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.
|
|
25
|
+
version: 0.391.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: dependabot-maven
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
30
|
- - '='
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 0.
|
|
32
|
+
version: 0.391.0
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - '='
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: 0.
|
|
39
|
+
version: 0.391.0
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: debug
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -291,7 +291,7 @@ licenses:
|
|
|
291
291
|
- MIT
|
|
292
292
|
metadata:
|
|
293
293
|
bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
|
|
294
|
-
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.
|
|
294
|
+
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.391.0
|
|
295
295
|
rdoc_options: []
|
|
296
296
|
require_paths:
|
|
297
297
|
- lib
|