dependabot-gradle 0.98.3 → 0.98.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36705725a0d7b22ad378d1a7008b954b02c379f1daf560504e3ae2bd4efa4a56
|
4
|
+
data.tar.gz: 5d1373dd715ee86ab0fa62ea1e7120e5b5f232346fd1066e14f024ae7ec660c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82aa124e39fa06b329a7270e954c4a29b373e2d4a3c602189f644b526494076f639926e4bc234da591d2ebb5a6dd8695582f372f523f0b392df73a3bddf7c91b
|
7
|
+
data.tar.gz: 7c7bc116873a52b9cbfd05a5fa2e1e9ff641d86d4ccf38173bb8453f39a27a41165429d24643a18200d4c66f9e2c252a7dbb138e7097ac6500f769602792874b
|
@@ -53,7 +53,8 @@ module Dependabot
|
|
53
53
|
reject { |path| path.include?("://") }.
|
54
54
|
reject { |path| !path.include?("/") && path.split(".").count > 2 }.
|
55
55
|
select { |filename| filename.include?("dependencies") }.
|
56
|
-
map { |path| path.gsub("$rootDir", ".") }
|
56
|
+
map { |path| path.gsub("$rootDir", ".") }.
|
57
|
+
uniq
|
57
58
|
|
58
59
|
dependency_plugin_paths.map do |path|
|
59
60
|
fetch_file_from_host(path)
|
@@ -236,8 +236,10 @@ module Dependabot
|
|
236
236
|
buildfiles.flat_map do |buildfile|
|
237
237
|
buildfile.content.
|
238
238
|
scan(/apply from:\s+['"]([^'"]+)['"]/).flatten.
|
239
|
-
map { |f| dependency_files.find { |bf| bf.name == f } }.
|
240
|
-
|
239
|
+
map { |f| dependency_files.find { |bf| bf.name == f } }.
|
240
|
+
compact
|
241
|
+
end.
|
242
|
+
uniq
|
241
243
|
end
|
242
244
|
|
243
245
|
def check_required_files
|
@@ -6,10 +6,17 @@ module Dependabot
|
|
6
6
|
module Gradle
|
7
7
|
class FileParser
|
8
8
|
class PropertyValueFinder
|
9
|
-
|
9
|
+
SINGLE_PROPERTY_DECLARATION_REGEX =
|
10
10
|
/(?:^|\s+|ext.)(?<name>[^\s=]+)\s*=\s*['"](?<value>[^\s]+)['"]/.
|
11
11
|
freeze
|
12
12
|
|
13
|
+
MULTI_PROPERTY_DECLARATION_REGEX =
|
14
|
+
/(?:^|\s+|ext.)(?<namespace>[^\s=]+)\s*=\s*\[(?<values>[^\]]+)\]/m.
|
15
|
+
freeze
|
16
|
+
|
17
|
+
NAMESPACED_DECLARATION_REGEX =
|
18
|
+
/(?:^|\s+)(?<name>[^\s:]+)\s*:\s*['"](?<value>[^\s]+)['"]\s*/.freeze
|
19
|
+
|
13
20
|
def initialize(dependency_files:)
|
14
21
|
@dependency_files = dependency_files
|
15
22
|
end
|
@@ -57,18 +64,55 @@ module Dependabot
|
|
57
64
|
return @properties[buildfile.name] if @properties[buildfile.name]
|
58
65
|
|
59
66
|
@properties[buildfile.name] = {}
|
60
|
-
|
67
|
+
|
68
|
+
@properties[buildfile.name].
|
69
|
+
merge!(fetch_single_property_declarations(buildfile))
|
70
|
+
|
71
|
+
@properties[buildfile.name].
|
72
|
+
merge!(fetch_multi_property_declarations(buildfile))
|
73
|
+
|
74
|
+
@properties[buildfile.name]
|
75
|
+
end
|
76
|
+
|
77
|
+
def fetch_single_property_declarations(buildfile)
|
78
|
+
properties = {}
|
79
|
+
|
80
|
+
prepared_content(buildfile).scan(SINGLE_PROPERTY_DECLARATION_REGEX) do
|
61
81
|
declaration_string = Regexp.last_match.to_s.strip
|
62
82
|
captures = Regexp.last_match.named_captures
|
63
83
|
name = captures.fetch("name").sub(/^ext\./, "")
|
64
|
-
|
84
|
+
properties[name] = {
|
65
85
|
value: captures.fetch("value"),
|
66
86
|
declaration_string: declaration_string,
|
67
87
|
file: buildfile.name
|
68
88
|
}
|
69
89
|
end
|
70
90
|
|
71
|
-
|
91
|
+
properties
|
92
|
+
end
|
93
|
+
|
94
|
+
def fetch_multi_property_declarations(buildfile)
|
95
|
+
properties = {}
|
96
|
+
|
97
|
+
prepared_content(buildfile).scan(MULTI_PROPERTY_DECLARATION_REGEX) do
|
98
|
+
captures = Regexp.last_match.named_captures
|
99
|
+
namespace = captures.fetch("namespace").sub(/^ext\./, "")
|
100
|
+
|
101
|
+
captures.fetch("values").scan(NAMESPACED_DECLARATION_REGEX) do
|
102
|
+
declaration_string = Regexp.last_match.to_s.strip
|
103
|
+
sub_captures = Regexp.last_match.named_captures
|
104
|
+
name = sub_captures.fetch("name")
|
105
|
+
full_name = [namespace, name].join(".")
|
106
|
+
|
107
|
+
properties[full_name] = {
|
108
|
+
value: sub_captures.fetch("value"),
|
109
|
+
declaration_string: declaration_string,
|
110
|
+
file: buildfile.name
|
111
|
+
}
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
properties
|
72
116
|
end
|
73
117
|
|
74
118
|
def prepared_content(buildfile)
|
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.98.
|
4
|
+
version: 0.98.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-17 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.98.
|
19
|
+
version: 0.98.4
|
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.98.
|
26
|
+
version: 0.98.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: byebug
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|