Skip to content
Snippets Groups Projects
Unverified Commit 773eb7ce authored by Sergei Zharinov's avatar Sergei Zharinov Committed by GitHub
Browse files

fix(gradle): Group long-form dependencies by varname (#12659)

parent 49c39f98
No related branches found
No related tags found
No related merge requests found
...@@ -52,7 +52,7 @@ describe('manager/gradle/shallow/parser', () => { ...@@ -52,7 +52,7 @@ describe('manager/gradle/shallow/parser', () => {
${'foo.bar = "1.2.3"'} | ${'"foo:bar:$foo.bar"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3', groupName: 'foo.bar' }} ${'foo.bar = "1.2.3"'} | ${'"foo:bar:$foo.bar"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3', groupName: 'foo.bar' }}
${''} | ${'foo.bar = "foo:bar:1.2.3"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }} ${''} | ${'foo.bar = "foo:bar:1.2.3"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }}
${'baz = "1.2.3"'} | ${'foobar = "foo:bar:$baz"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3', groupName: 'baz' }} ${'baz = "1.2.3"'} | ${'foobar = "foo:bar:$baz"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3', groupName: 'baz' }}
${'baz = "1.2.3"'} | ${'group: "foo", name: "bar", version: baz'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }} ${'baz = "1.2.3"'} | ${'group: "foo", name: "bar", version: baz'} | ${{ depName: 'foo:bar', currentValue: '1.2.3', groupName: 'baz' }}
`('$def | $str', ({ def, str, output }) => { `('$def | $str', ({ def, str, output }) => {
const input = [def, str].join('\n'); const input = [def, str].join('\n');
const { deps } = parseGradle(input); const { deps } = parseGradle(input);
......
...@@ -263,6 +263,7 @@ function processLongFormDep({ ...@@ -263,6 +263,7 @@ function processLongFormDep({
const versionToken: Token = tokenMap.version; const versionToken: Token = tokenMap.version;
if (versionToken.type === TokenType.Word) { if (versionToken.type === TokenType.Word) {
const variable = variables[versionToken.value]; const variable = variables[versionToken.value];
dep.groupName = variable.key;
dep.managerData = { dep.managerData = {
fileReplacePosition: variable.fileReplacePosition, fileReplacePosition: variable.fileReplacePosition,
packageFile: variable.packageFile, packageFile: variable.packageFile,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment