diff --git a/lib/modules/manager/sbt/__fixtures__/sample.sbt b/lib/modules/manager/sbt/__fixtures__/sample.sbt index 9c82f1186c60e9377fcdd0eec768f2e9676eb3c7..3d60943cf8471700ccae3430fa8af0fcd0ef0c45 100644 --- a/lib/modules/manager/sbt/__fixtures__/sample.sbt +++ b/lib/modules/manager/sbt/__fixtures__/sample.sbt @@ -19,6 +19,7 @@ dependencyOverrides ++= { Seq( groupIdExample %% "quuz" % "0.0.6" % "test", // comment + groupIdExample %%% "abc" % "0.0.42" % "test", // comment "org.example" % artifactIdExample % "0.0.7" % Provided // comment ,"org.example" % "grault" % versionExample % Test, // comment ) diff --git a/lib/modules/manager/sbt/__snapshots__/extract.spec.ts.snap b/lib/modules/manager/sbt/__snapshots__/extract.spec.ts.snap index fc4242ac8445e7f9ca826bce1b8eb132f260c0a1..da6fe243036e9ba89d45515d854ecacf1d55241f 100644 --- a/lib/modules/manager/sbt/__snapshots__/extract.spec.ts.snap +++ b/lib/modules/manager/sbt/__snapshots__/extract.spec.ts.snap @@ -222,6 +222,21 @@ exports[`modules/manager/sbt/extract extractPackageFile() extracts deps for gene "https://example.com/repos/5/", ], }, + { + "currentValue": "0.0.42", + "datasource": "sbt-package", + "depName": "org.example:abc", + "depType": "test", + "packageName": "org.example:abc_2.9.10", + "registryUrls": [ + "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/", + ], + }, { "currentValue": "0.0.7", "datasource": "sbt-package", diff --git a/lib/modules/manager/sbt/extract.spec.ts b/lib/modules/manager/sbt/extract.spec.ts index 72aa378bc1c6b128a5a76eede90395f403195dec..da3c83ae8c74ae40641f4698ce001f7885782edc 100644 --- a/lib/modules/manager/sbt/extract.spec.ts +++ b/lib/modules/manager/sbt/extract.spec.ts @@ -54,6 +54,7 @@ describe('modules/manager/sbt/extract', () => { }, { packageName: 'org.example:quux', currentValue: '0.0.5' }, { packageName: 'org.example:quuz_2.9.10', currentValue: '0.0.6' }, + { packageName: 'org.example:abc_2.9.10', currentValue: '0.0.42' }, { packageName: 'org.example:corge', currentValue: '0.0.7' }, { packageName: 'org.example:grault', currentValue: '0.0.8' }, { packageName: 'org.example:waldo', currentValue: '0.0.9' }, diff --git a/lib/modules/manager/sbt/extract.ts b/lib/modules/manager/sbt/extract.ts index 1996f299cb0aa6ed085d46e66d1391fa6e98abb7..bf4478d60c0c599b5a3a1eaf126ecbc9f3cb7739 100644 --- a/lib/modules/manager/sbt/extract.ts +++ b/lib/modules/manager/sbt/extract.ts @@ -149,6 +149,13 @@ const versionedDependencyMatch = groupIdMatch .op('%') .join(versionMatch); +const crossDependencyMatch = groupIdMatch + .op('%%%') + .join(artifactIdMatch) + .handler((ctx) => ({ ...ctx, useScalaVersion: true })) + .op('%') + .join(versionMatch); + function depHandler(ctx: Ctx): Ctx { const { scalaVersion, @@ -200,7 +207,7 @@ function depTypeHandler(ctx: Ctx, { value: depType }: { value: string }): Ctx { const sbtPackageMatch = q .opt<Ctx>(q.opt(q.sym<Ctx>('lazy')).sym('val').sym().op('=')) - .alt(simpleDependencyMatch, versionedDependencyMatch) + .alt(crossDependencyMatch, simpleDependencyMatch, versionedDependencyMatch) .opt( q.alt<Ctx>( q.sym<Ctx>('classifier').str(depTypeHandler),