dependabot-gradle 0.129.4 → 0.130.3

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: 283f64fb68fc043f62ea93e7e7e258618aa1070c51524c135615e95f2c7121f5
4
- data.tar.gz: f2d87711658001261ae0004bd90f8a09af9462385e0d8b5ffdc07f2886dc1fed
3
+ metadata.gz: 43febb12d9d4ec7859350f114234f9c3df9c272177c27227c711cae7e6fb2367
4
+ data.tar.gz: b194a01066622865329c012d21bda3719381dad446527739a77af8d2de8ccb3d
5
5
  SHA512:
6
- metadata.gz: db85ba4de343e84e936983580dfe35ea967b11c05288026df4ff7d3e0bccf3899ad7297f1fa81e12dd55eea7e9297060ba9926e34a198523d7c617cb92128d9f
7
- data.tar.gz: abe297b3bc2cbe8a279fc35d23493cee6acf311c94353abce92cb83a10c4b0f342fe3777677ba7c9f281844408772620c957cc710a762b65d533ee4a5894434b
6
+ metadata.gz: 697507b99763e2e86bc840ddd25c72cc36a2467497e877311c9245445359b1e2a7d77b55ae704e1c15f6af630f6d3507d66ba4d304964253ee2b97dae1ed4ad2
7
+ data.tar.gz: fe389eae8fd6dc26fbec49d07f22ce2f296fb03c9b759bb3bd44d2b478d6c858259563f24167b1422f43677cd1a9862a136e5afe531be22821117318368b9ec5
@@ -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.4
4
+ version: 0.130.3
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-06 00:00:00.000000000 Z
11
+ date: 2021-01-26 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.4
19
+ version: 0.130.3
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.4
26
+ version: 0.130.3
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