dependabot-gradle 0.162.2 → 0.165.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dependabot/gradle/file_fetcher.rb +19 -13
- data/lib/dependabot/gradle/file_parser/repositories_finder.rb +6 -2
- data/lib/dependabot/gradle/file_parser.rb +1 -1
- data/lib/dependabot/gradle/file_updater.rb +1 -1
- data/lib/dependabot/gradle/update_checker/version_finder.rb +4 -6
- 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: 3da5284760eb9fd01b31c5d460b24c01a2437dc9aae06b1b30de18a3c2c64ffa
|
4
|
+
data.tar.gz: f5dacc19d4ae2aa3d494e0e8fe1c7ac2863f937d4877ef86d30c7fb21dde5f07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60bede8805665c8e7bdd10dec1a58f7d94f8b623554ff3a993ad763d9bc0e1f668167eb6bddfcf7d23efcddba1cec11f81c47db377fd8898b9cb39ec7976c69a
|
7
|
+
data.tar.gz: 51f4346b45c0352863dd0600405077c38f68e802c3d8cd1771c6ecc75e669934c7c057cc8fb671e55f6e307089cb5cc9ca999e25ddbc0f808e6e53888ac5e2be
|
@@ -28,7 +28,7 @@ module Dependabot
|
|
28
28
|
|
29
29
|
def fetch_files
|
30
30
|
fetched_files = []
|
31
|
-
fetched_files << buildfile
|
31
|
+
fetched_files << buildfile if buildfile
|
32
32
|
fetched_files += subproject_buildfiles
|
33
33
|
fetched_files += dependency_script_plugins
|
34
34
|
check_required_files_present
|
@@ -46,17 +46,23 @@ module Dependabot
|
|
46
46
|
def subproject_buildfiles
|
47
47
|
return [] unless settings_file
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
49
|
+
@subproject_buildfiles ||= begin
|
50
|
+
subproject_paths =
|
51
|
+
SettingsFileParser.
|
52
|
+
new(settings_file: settings_file).
|
53
|
+
subproject_paths
|
54
|
+
|
55
|
+
subproject_paths.map do |path|
|
56
|
+
if @buildfile_name
|
57
|
+
fetch_file_from_host(File.join(path, @buildfile_name))
|
58
|
+
else
|
59
|
+
supported_file(SUPPORTED_BUILD_FILE_NAMES.map { |f| File.join(path, f) })
|
60
|
+
end
|
61
|
+
rescue Dependabot::DependencyFileNotFound
|
62
|
+
# Gradle itself doesn't worry about missing subprojects, so we don't
|
63
|
+
nil
|
64
|
+
end.compact
|
65
|
+
end
|
60
66
|
end
|
61
67
|
|
62
68
|
# rubocop:disable Metrics/PerceivedComplexity
|
@@ -83,7 +89,7 @@ module Dependabot
|
|
83
89
|
# rubocop:enable Metrics/PerceivedComplexity
|
84
90
|
|
85
91
|
def check_required_files_present
|
86
|
-
return if buildfile
|
92
|
+
return if buildfile || (subproject_buildfiles && !subproject_buildfiles.empty?)
|
87
93
|
|
88
94
|
path = Pathname.new(File.join(directory, "build.gradle")).cleanpath.to_path
|
89
95
|
path += "(.kts)?"
|
@@ -12,6 +12,8 @@ module Dependabot
|
|
12
12
|
# we're confident we're selecting repos correctly it's wise to include
|
13
13
|
# it as a default.
|
14
14
|
CENTRAL_REPO_URL = "https://repo.maven.apache.org/maven2"
|
15
|
+
GOOGLE_MAVEN_REPO = "https://maven.google.com"
|
16
|
+
GRADLE_PLUGINS_REPO = "https://plugins.gradle.org/m2"
|
15
17
|
|
16
18
|
REPOSITORIES_BLOCK_START = /(?:^|\s)repositories\s*\{/.freeze
|
17
19
|
|
@@ -96,12 +98,14 @@ module Dependabot
|
|
96
98
|
end
|
97
99
|
|
98
100
|
repository_blocks.each do |block|
|
99
|
-
repository_urls <<
|
101
|
+
repository_urls << GOOGLE_MAVEN_REPO if block.match?(/\sgoogle\(/)
|
100
102
|
|
101
|
-
repository_urls <<
|
103
|
+
repository_urls << CENTRAL_REPO_URL if block.match?(/\smavenCentral\(/)
|
102
104
|
|
103
105
|
repository_urls << "https://jcenter.bintray.com/" if block.match?(/\sjcenter\(/)
|
104
106
|
|
107
|
+
repository_urls << GRADLE_PLUGINS_REPO if block.match?(/\sgradlePluginPortal\(/)
|
108
|
+
|
105
109
|
block.scan(MAVEN_REPO_REGEX) do
|
106
110
|
repository_urls << Regexp.last_match.named_captures.fetch("url")
|
107
111
|
end
|
@@ -13,8 +13,6 @@ module Dependabot
|
|
13
13
|
module Gradle
|
14
14
|
class UpdateChecker
|
15
15
|
class VersionFinder
|
16
|
-
GOOGLE_MAVEN_REPO = "https://maven.google.com"
|
17
|
-
GRADLE_PLUGINS_REPO = "https://plugins.gradle.org/m2"
|
18
16
|
KOTLIN_PLUGIN_REPO_PREFIX = "org.jetbrains.kotlin"
|
19
17
|
TYPE_SUFFICES = %w(jre android java native_mt agp).freeze
|
20
18
|
|
@@ -59,7 +57,7 @@ module Dependabot
|
|
59
57
|
version_details =
|
60
58
|
repositories.map do |repository_details|
|
61
59
|
url = repository_details.fetch("url")
|
62
|
-
next google_version_details if url == GOOGLE_MAVEN_REPO
|
60
|
+
next google_version_details if url == Gradle::FileParser::RepositoriesFinder::GOOGLE_MAVEN_REPO
|
63
61
|
|
64
62
|
dependency_metadata(repository_details).css("versions > version").
|
65
63
|
select { |node| version_class.correct?(node.content) }.
|
@@ -136,10 +134,10 @@ module Dependabot
|
|
136
134
|
end
|
137
135
|
|
138
136
|
def google_version_details
|
139
|
-
url = GOOGLE_MAVEN_REPO
|
137
|
+
url = Gradle::FileParser::RepositoriesFinder::GOOGLE_MAVEN_REPO
|
140
138
|
group_id, artifact_id = group_and_artifact_ids
|
141
139
|
|
142
|
-
dependency_metadata_url = "#{GOOGLE_MAVEN_REPO}/"\
|
140
|
+
dependency_metadata_url = "#{Gradle::FileParser::RepositoriesFinder::GOOGLE_MAVEN_REPO}/"\
|
143
141
|
"#{group_id.tr('.', '/')}/"\
|
144
142
|
"group-index.xml"
|
145
143
|
|
@@ -250,7 +248,7 @@ module Dependabot
|
|
250
248
|
|
251
249
|
def plugin_repository_details
|
252
250
|
[{
|
253
|
-
"url" => GRADLE_PLUGINS_REPO,
|
251
|
+
"url" => Gradle::FileParser::RepositoriesFinder::GRADLE_PLUGINS_REPO,
|
254
252
|
"auth_headers" => {}
|
255
253
|
}] + dependency_repository_details
|
256
254
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dependabot-gradle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.165.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dependabot-common
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.165.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.165.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: dependabot-maven
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.165.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.165.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: byebug
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|