Skip to content

Commit

Permalink
fix(manager/gradle): prefix version catalog aliases with "libs." (#18830
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Churro authored Nov 9, 2022
1 parent a820a8a commit fb56b1f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/modules/manager/gradle/parser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ describe('modules/manager/gradle/parser', () => {
${''} | ${'library("foo", "bar", "baz", "qux"]).version("1.2.3")'} | ${null}
${''} | ${'library("foo.bar", "foo", "bar").version("1.2.3", "4.5.6")'} | ${null}
${'group = "foo"; artifact="bar"'} | ${'library("foo.bar", group, artifact).version("1.2.3")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }}
${'library("foo-bar_baz-qux", "foo", "bar")'} | ${'"${foo.bar.baz.qux}:1.2.3"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }}
${'library("foo-bar_baz-qux", "foo", "bar")'} | ${'"${libs.foo.bar.baz.qux}:1.2.3"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }}
`('$def | $str', async ({ def, str, output }) => {
const input = [def, str].join('\n');
const { deps } = await parseGradle(input);
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/manager/gradle/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ function processLibraryDep(input: SyntaxHandlerInput): SyntaxHandlerOutput {
const { tokenMap } = input;

const varNameToken = tokenMap.varName;
const key = varNameToken.value.replace(regEx(/[-_]/g), '.');
const key = `libs.${varNameToken.value.replace(regEx(/[-_]/g), '.')}`;
const fileReplacePosition = varNameToken.offset;
const packageFile = input.packageFile;

Expand Down

0 comments on commit fb56b1f

Please sign in to comment.