diff --git a/lib/modules/manager/sbt/extract.spec.ts b/lib/modules/manager/sbt/extract.spec.ts index 7bc496d9719714..12b766a5d25ff0 100644 --- a/lib/modules/manager/sbt/extract.spec.ts +++ b/lib/modules/manager/sbt/extract.spec.ts @@ -298,5 +298,21 @@ describe('modules/manager/sbt/extract', () => { packageFileVersion: undefined, }); }); + + it('extract addCompilerPlugin', () => { + expect( + extractPackageFile(` + addCompilerPlugin("org.scala-tools.sxr" %% "sxr" % "0.3.0") + `) + ).toMatchObject({ + deps: [ + { + packageName: 'org.scala-tools.sxr:sxr', + currentValue: '0.3.0', + }, + ], + packageFileVersion: undefined, + }); + }); }); }); diff --git a/lib/modules/manager/sbt/extract.ts b/lib/modules/manager/sbt/extract.ts index c0348282649d34..42227df4c0542f 100644 --- a/lib/modules/manager/sbt/extract.ts +++ b/lib/modules/manager/sbt/extract.ts @@ -21,7 +21,7 @@ const isDepsBegin = (str: string): boolean => regEx(/^\s*(libraryDependencies|dependencyOverrides)\s*\+\+=\s*/).test(str); const isPluginDep = (str: string): boolean => - regEx(/^\s*addSbtPlugin\s*\(.*\)\s*$/).test(str); + regEx(/^\s*(addSbtPlugin|addCompilerPlugin)\s*\(.*\)\s*$/).test(str); const isStringLiteral = (str: string): boolean => regEx(/^"[^"]*"$/).test(str); @@ -292,7 +292,10 @@ function parseSbtLine( }); } else if (isPluginDep(line)) { isMultiDeps = false; - const rightPart = line.replace(regEx(/^\s*addSbtPlugin\s*\(/), ''); + const rightPart = line.replace( + regEx(/^\s*(addSbtPlugin|addCompilerPlugin)\s*\(/), + '' + ); const depExpr = rightPart.replace(regEx(/\)\s*$/), ''); dep = parseDepExpr(depExpr, { ...ctx,