Skip to content

Commit

Permalink
fix(sbt): Parse version lines with classifier keyword (#6780)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Jul 18, 2020
1 parent e3da371 commit 1d33e20
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/manager/sbt/__fixtures__/sample.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ libraryDependencies ++= Seq(
"org.example" %% "baz" % "0.0.3",
"org.example" % "qux" % "0.0.4"
)
libraryDependencies += ("org.scala-lang" % "scala-library" % "2.13.3" classifier "sources") % Test

dependencyOverrides += "org.example" % "quux" % "0.0.5"
dependencyOverrides ++= {
Expand Down
15 changes: 15 additions & 0 deletions lib/manager/sbt/__snapshots__/extract.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,21 @@ Object {
"https://example.com/repos/5/",
],
},
Object {
"currentValue": "2.13.3",
"datasource": "sbt-package",
"depName": "org.scala-lang:scala-library",
"depType": "sources",
"lookupName": "org.scala-lang:scala-library",
"registryUrls": Array [
"https://repo.maven.apache.org/maven2",
"https://example.com/repos/1/",
"https://example.com/repos/2/",
"https://example.com/repos/3/",
"https://example.com/repos/4/",
"https://example.com/repos/5/",
],
},
Object {
"currentValue": "0.0.5",
"datasource": "sbt-package",
Expand Down
6 changes: 5 additions & 1 deletion lib/manager/sbt/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ function parseDepExpr(
? str.replace(/^"/, '').replace(/"$/, '')
: variables[str].val;

const tokens = expr.trim().split(/\s*(%%?)\s*/);
const tokens = expr
.trim()
.replace(/[()]/g, '')
.split(/\s*(%%?)\s*|\s*classifier\s*/);

const [
rawGroupId,
groupOp,
Expand Down

0 comments on commit 1d33e20

Please sign in to comment.