mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 23:16:26 +00:00
fix(manager/gradle): prefix version catalog aliases with "libs." (#18830)
This commit is contained in:
parent
a820a8a8b9
commit
fb56b1fe85
2 changed files with 2 additions and 2 deletions
|
@ -184,7 +184,7 @@ describe('modules/manager/gradle/parser', () => {
|
||||||
${''} | ${'library("foo", "bar", "baz", "qux"]).version("1.2.3")'} | ${null}
|
${''} | ${'library("foo", "bar", "baz", "qux"]).version("1.2.3")'} | ${null}
|
||||||
${''} | ${'library("foo.bar", "foo", "bar").version("1.2.3", "4.5.6")'} | ${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' }}
|
${'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 }) => {
|
`('$def | $str', async ({ def, str, output }) => {
|
||||||
const input = [def, str].join('\n');
|
const input = [def, str].join('\n');
|
||||||
const { deps } = await parseGradle(input);
|
const { deps } = await parseGradle(input);
|
||||||
|
|
|
@ -377,7 +377,7 @@ function processLibraryDep(input: SyntaxHandlerInput): SyntaxHandlerOutput {
|
||||||
const { tokenMap } = input;
|
const { tokenMap } = input;
|
||||||
|
|
||||||
const varNameToken = tokenMap.varName;
|
const varNameToken = tokenMap.varName;
|
||||||
const key = varNameToken.value.replace(regEx(/[-_]/g), '.');
|
const key = `libs.${varNameToken.value.replace(regEx(/[-_]/g), '.')}`;
|
||||||
const fileReplacePosition = varNameToken.offset;
|
const fileReplacePosition = varNameToken.offset;
|
||||||
const packageFile = input.packageFile;
|
const packageFile = input.packageFile;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue