Skip to content

Commit

Permalink
fix(manager/gradle): preserve next token for parsing in case dependen…
Browse files Browse the repository at this point in the history
…cy interpolation fails (#18330)
  • Loading branch information
Churro authored Oct 27, 2022
1 parent bd73e03 commit 8279be4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/modules/manager/gradle/parser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ describe('modules/manager/gradle/parser', () => {
${'foo.bar = "1.2.3"'} | ${'"foo:bar:$foo.bar"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3', groupName: 'foo.bar' }}
${'foo = "1.2.3"'} | ${'"foo:bar_$foo:4.5.6"'} | ${{ depName: 'foo:bar_1.2.3', managerData: { fileReplacePosition: 28 } }}
${'baz = "1.2.3"'} | ${'foobar = "foo:bar:$baz"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3', groupName: 'baz' }}
${'foo = "${bar}"; baz = "1.2.3"'} | ${'"foo:bar:${baz}"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }}
`('$def | $str', async ({ def, str, output }) => {
const { deps } = await parseGradle([def, str].join('\n'));
expect(deps).toMatchObject([output].filter(Boolean));
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 @@ -200,7 +200,7 @@ function processDepInterpolation({
return { deps: [dep] };
}
}
return null;
return {};
}

function processPlugin({
Expand Down

0 comments on commit 8279be4

Please sign in to comment.