bibliothecary 8.3.9 → 8.4.0

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: 5447f8ff7067f7eb7c0f1bfbd13f0ba6da33335dd31cee7b319587a09260308a
4
- data.tar.gz: b23abc3e66340a26345db527803dcb7d7d8a3f9418297bff161deb72dd778aa5
3
+ metadata.gz: 65f4910198d30819544a51adff24b14ce2214631dc0adf958d264dd89800f1ab
4
+ data.tar.gz: 362bea1f8f48122e28253491c281e2a25bdf6d14c831e988435da4bc02b3da52
5
5
  SHA512:
6
- metadata.gz: 79159794155d5ea5c18978f4e6a57eba72bd78699fcee008e66fbf0bb83a5c737893ee369d7cb4d3f8afe2758b1029c4a87a526344ea8d7a2aa2ba38a2ab3729
7
- data.tar.gz: 01ec2a377345cc804c1fac8149f27fc40a7e34c45db27ae0f9b6eb0cea1ebdece6b64b23c5da6f96354d1440102bc3854dcf2b4297d9cf915e89c920d3de3f25
6
+ metadata.gz: 51e6c14e963753db57341b241356a323dcc55e31b9593444aca6d2cc5882af26fe52d06b36b1382f11367f301bd817f82a35ab7ff8dd5d7d1e065ec52775e06f
7
+ data.tar.gz: bdfcc8fbb046095031c39619955eef933bfe4a59e7d59558e621e7bd6ab391fda2559b10a85640abf181505dfce0bd21ec7103325595a2dfa0cbeb2da828e437
@@ -12,6 +12,11 @@ module Bibliothecary
12
12
  # "| \\--- com.google.guava:guava:23.5-jre (*)"
13
13
  GRADLE_DEP_REGEX = /(\+---|\\---){1}/
14
14
 
15
+ # Dependencies that are on-disk projects, eg:
16
+ # \--- project :api:my-internal-project
17
+ # +--- my-group:my-alias:1.2.3 -> project :client (*)
18
+ GRADLE_PROJECT_REGEX = /project :(\S+)/
19
+
15
20
  # Builtin methods: https://docs.gradle.org/current/userguide/java_plugin.html#tab:configurations
16
21
  # Deprecated methods: https://docs.gradle.org/current/userguide/upgrading_version_6.html#sec:configuration_removal
17
22
  GRADLE_DEPENDENCY_METHODS = %w(api compile compileClasspath compileOnly compileOnlyApi implementation runtime runtimeClasspath runtimeOnly testCompile testCompileOnly testImplementation testRuntime testRuntimeOnly)
@@ -148,11 +153,27 @@ module Bibliothecary
148
153
 
149
154
  split = gradle_dep_match.captures[0]
150
155
 
156
+ # gradle can import on-disk projects and deps will be listed under them, e.g. `+--- project :pie2-testing`,
157
+ # so we treat these projects as internal deps themselves (["internal:foo","0.0.0"])
158
+ if (project_match = line.match(GRADLE_PROJECT_REGEX))
159
+ project_name = project_match[1]
160
+ line = line.sub(GRADLE_PROJECT_REGEX, "__PROJECT_GROUP__:__PROJECT_NAME__:__PROJECT_REQUIREMENT__") # project names can have colons, which breaks our split(":") below, so sub it out until after we've parsed the line.
161
+ else
162
+ project_name = ""
163
+ end
164
+
151
165
  dep = line
152
166
  .split(split)[1].sub(/(\((c|n|\*)\))$/, "") # line ending legend: (c) means a dependency constraint, (n) means not resolved, or (*) means resolved previously, e.g. org.springframework.boot:spring-boot-starter-web:2.1.0.M3 (*)
153
167
  .sub(/ FAILED$/, "") # dependency could not be resolved (but still may have a version)
154
168
  .sub(" -> ", ":") # handle version arrow syntax
155
- .strip.split(":")
169
+ .strip
170
+ .split(":")
171
+ .map do |part|
172
+ part
173
+ .sub(/__PROJECT_GROUP__/, "internal")# give all projects a group namespace of "internal"
174
+ .sub(/__PROJECT_NAME__/, project_name)
175
+ .sub(/__PROJECT_REQUIREMENT__/, "1.0.0") # give all projects a requirement of "1.0.0".
176
+ end # replace placeholders after we've parsed the line
156
177
 
157
178
  # A testImplementation line can look like this so just skip those
158
179
  # \--- org.springframework.security:spring-security-test (n)
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "8.3.9"
2
+ VERSION = "8.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bibliothecary
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.3.9
4
+ version: 8.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-11 00:00:00.000000000 Z
11
+ date: 2022-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tomlrb