dependabot-gradle 0.129.3 → 0.130.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52304dd1ce847db147408d7c059e277e5e9ac378791b83ae6541f93773f84639
4
- data.tar.gz: 6b63e2f958a895e903841215ba951b269f7e15f10c1005e94e2a235285eb7e41
3
+ metadata.gz: c552c89e6de7aba43235b5cd4ca47ee99b48c47f4c7e0d8c553d68c2c7ab62f9
4
+ data.tar.gz: 569e642bc246241b0c467afb7ed39c56dc8430b5055d37d76a96e65b8361a7b3
5
5
  SHA512:
6
- metadata.gz: 0e281b5edbedc64f7a96486c377837e8504df3688b18af0b163357a3554cd90f9fad02f1bd18ed31f43b2b169c128fadb4c5d1334d46c74048c4b556b67f035b
7
- data.tar.gz: e7274c38d3a6255f14df0eafbccd8b3a5a66b69ca4991dd9b0b1628380c44fd35e0f20a1a83aae93d7941f2af593ba6e3d750126173bc5e6b8cace8dcd57a292
6
+ metadata.gz: 33258f243e39c378b0f37936287ccd6ecb8545dfd0ee60ab67fdf3ce1cb9a19009101376a670193d0c0e85439bdbf88f7fb17c19aa8dfdd733f2d83dd5d7fed7
7
+ data.tar.gz: 2eaf67f2a0ed5b5f4a00168f6f2af9924bfb026e3976682708e802f550664e05aa3efc8bf1a0f98565f0dae1c72ae65db6c26e8ef1a887c7811e3241f65650a8
@@ -36,8 +36,6 @@ module Dependabot
36
36
  /(?:^|\s)dependencySet\((?<arguments>[^\)]+)\)\s*\{/.freeze
37
37
  DEPENDENCY_SET_ENTRY_REGEX = /entry\s+['"](?<name>#{PART})['"]/.freeze
38
38
  PLUGIN_BLOCK_DECLARATION_REGEX = /(?:^|\s)plugins\s*\{/.freeze
39
- PLUGIN_BLOCK_ENTRY_REGEX =
40
- /id\s+"(?<id>#{PART})"\s+version\s+"(?<version>#{VSN_PART})"/.freeze
41
39
  PLUGIN_ID_REGEX = /['"](?<id>#{PART})['"]/.freeze
42
40
 
43
41
  def parse
@@ -149,14 +147,14 @@ module Dependabot
149
147
 
150
148
  plugin_blocks.each do |blk|
151
149
  blk.lines.each do |line|
152
- name_regex = /id(\s+#{PLUGIN_ID_REGEX}|\(#{PLUGIN_ID_REGEX}\))/
150
+ name_regex = /(id|kotlin)(\s+#{PLUGIN_ID_REGEX}|\(#{PLUGIN_ID_REGEX}\))/
153
151
  name = line.match(name_regex)&.named_captures&.fetch("id")
154
152
  version_regex = /version\s+['"](?<version>#{VSN_PART})['"]/
155
153
  version = line.match(version_regex)&.named_captures&.
156
154
  fetch("version")
157
155
  next unless name && version
158
156
 
159
- details = { name: name, group: "plugins", version: version }
157
+ details = { name: name, group: "plugins", extra_groups: extra_groups(line), version: version }
160
158
  dep = dependency_from(details_hash: details, buildfile: buildfile)
161
159
  dependency_set << dep if dep
162
160
  end
@@ -165,6 +163,10 @@ module Dependabot
165
163
  dependency_set
166
164
  end
167
165
 
166
+ def extra_groups(line)
167
+ line.match(/kotlin(\s+#{PLUGIN_ID_REGEX}|\(#{PLUGIN_ID_REGEX}\))/) ? ["kotlin"] : []
168
+ end
169
+
168
170
  def argument_from_string(string, arg_name)
169
171
  string.
170
172
  match(map_value_regex(arg_name))&.
@@ -176,13 +178,14 @@ module Dependabot
176
178
  group = evaluated_value(details_hash[:group], buildfile)
177
179
  name = evaluated_value(details_hash[:name], buildfile)
178
180
  version = evaluated_value(details_hash[:version], buildfile)
181
+ extra_groups = details_hash[:extra_groups] || []
179
182
 
180
183
  dependency_name =
181
184
  if group == "plugins" then name
182
185
  else "#{group}:#{name}"
183
186
  end
184
187
  groups =
185
- if group == "plugins" then ["plugins"]
188
+ if group == "plugins" then ["plugins"] + extra_groups
186
189
  else []
187
190
  end
188
191
  source =
@@ -16,7 +16,7 @@ module Dependabot
16
16
  REPOSITORIES_BLOCK_START = /(?:^|\s)repositories\s*\{/.freeze
17
17
 
18
18
  GROOVY_MAVEN_REPO_REGEX =
19
- /maven\s*\{[^\}]*\surl[\s\(]\s*['"](?<url>[^'"]+)['"]/.freeze
19
+ /maven\s*\{[^\}]*\surl[\s\(]=?\s*['"](?<url>[^'"]+)['"]/.freeze
20
20
 
21
21
  KOTLIN_MAVEN_REPO_REGEX =
22
22
  /maven\(['"](?<url>[^'"]+)['"]\)/.freeze
@@ -140,7 +140,7 @@ module Dependabot
140
140
  next false unless line.include?(dependency.name.split(":").last)
141
141
  else
142
142
  name_regex_value = /['"]#{Regexp.quote(dependency.name)}['"]/
143
- name_regex = /id(\s+#{name_regex_value}|\(#{name_regex_value}\))/
143
+ name_regex = /(id|kotlin)(\s+#{name_regex_value}|\(#{name_regex_value}\))/
144
144
  next false unless line.match?(name_regex)
145
145
  end
146
146
 
@@ -11,6 +11,7 @@ module Dependabot
11
11
  class MetadataFinder < Dependabot::MetadataFinders::Base
12
12
  DOT_SEPARATOR_REGEX = %r{\.(?!\d+([.\/_\-]|$)+)}.freeze
13
13
  PROPERTY_REGEX = /\$\{(?<property>.*?)\}/.freeze
14
+ KOTLIN_PLUGIN_REPO_PREFIX = "org.jetbrains.kotlin"
14
15
 
15
16
  private
16
17
 
@@ -101,7 +102,8 @@ module Dependabot
101
102
  return @dependency_pom_file unless @dependency_pom_file.nil?
102
103
 
103
104
  artifact_id =
104
- if plugin? then "#{dependency.name}.gradle.plugin"
105
+ if kotlin_plugin? then "#{KOTLIN_PLUGIN_REPO_PREFIX}.#{dependency.name}.gradle.plugin"
106
+ elsif plugin? then "#{dependency.name}.gradle.plugin"
105
107
  else dependency.name.split(":").last
106
108
  end
107
109
 
@@ -150,7 +152,10 @@ module Dependabot
150
152
 
151
153
  def maven_repo_dependency_url
152
154
  group_id, artifact_id =
153
- if plugin? then [dependency.name, "#{dependency.name}.gradle.plugin"]
155
+ if kotlin_plugin?
156
+ ["#{KOTLIN_PLUGIN_REPO_PREFIX}.#{dependency.name}",
157
+ "#{KOTLIN_PLUGIN_REPO_PREFIX}.#{dependency.name}.gradle.plugin"]
158
+ elsif plugin? then [dependency.name, "#{dependency.name}.gradle.plugin"]
154
159
  else dependency.name.split(":")
155
160
  end
156
161
 
@@ -158,7 +163,11 @@ module Dependabot
158
163
  end
159
164
 
160
165
  def plugin?
161
- dependency.requirements.any? { |r| r.fetch(:groups) == ["plugins"] }
166
+ dependency.requirements.any? { |r| r.fetch(:groups).include? "plugins" }
167
+ end
168
+
169
+ def kotlin_plugin?
170
+ plugin? && dependency.requirements.any? { |r| r.fetch(:groups).include? "kotlin" }
162
171
  end
163
172
 
164
173
  def auth_details
@@ -13,6 +13,7 @@ module Dependabot
13
13
  class VersionFinder
14
14
  GOOGLE_MAVEN_REPO = "https://maven.google.com"
15
15
  GRADLE_PLUGINS_REPO = "https://plugins.gradle.org/m2"
16
+ KOTLIN_PLUGIN_REPO_PREFIX = "org.jetbrains.kotlin"
16
17
  TYPE_SUFFICES = %w(jre android java).freeze
17
18
 
18
19
  GRADLE_RANGE_REGEX = /[\(\[].*,.*[\)\]]/.freeze
@@ -295,6 +296,7 @@ module Dependabot
295
296
 
296
297
  def dependency_metadata_url(repository_url)
297
298
  group_id, artifact_id = group_and_artifact_ids
299
+ group_id = "#{KOTLIN_PLUGIN_REPO_PREFIX}.#{group_id}" if kotlin_plugin?
298
300
 
299
301
  "#{repository_url}/"\
300
302
  "#{group_id.tr('.', '/')}/"\
@@ -303,7 +305,9 @@ module Dependabot
303
305
  end
304
306
 
305
307
  def group_and_artifact_ids
306
- if plugin?
308
+ if kotlin_plugin?
309
+ [dependency.name, "#{KOTLIN_PLUGIN_REPO_PREFIX}.#{dependency.name}.gradle.plugin"]
310
+ elsif plugin?
307
311
  [dependency.name, "#{dependency.name}.gradle.plugin"]
308
312
  else
309
313
  dependency.name.split(":")
@@ -311,7 +315,11 @@ module Dependabot
311
315
  end
312
316
 
313
317
  def plugin?
314
- dependency.requirements.any? { |r| r.fetch(:groups) == ["plugins"] }
318
+ dependency.requirements.any? { |r| r.fetch(:groups).include? "plugins" }
319
+ end
320
+
321
+ def kotlin_plugin?
322
+ plugin? && dependency.requirements.any? { |r| r.fetch(:groups).include? "kotlin" }
315
323
  end
316
324
 
317
325
  def central_repo_urls
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.129.3
4
+ version: 0.130.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-05 00:00:00.000000000 Z
11
+ date: 2021-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dependabot-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.129.3
19
+ version: 0.130.2
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.129.3
26
+ version: 0.130.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.7.0
103
+ version: 1.8.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 1.7.0
110
+ version: 1.8.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: simplecov
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  - !ruby/object:Gem::Version
207
207
  version: 2.5.0
208
208
  requirements: []
209
- rubygems_version: 3.1.4
209
+ rubygems_version: 3.2.3
210
210
  signing_key:
211
211
  specification_version: 4
212
212
  summary: Gradle support for dependabot