Skip to content

Commit

Permalink
feat(gradle-lite): Recognize platform dependencies (#8322)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Jan 16, 2021
1 parent bc0bc71 commit af35a32
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/manager/gradle-lite/parser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ describe('manager/gradle-lite/parser', () => {
},
]);

({ deps } = parseGradle(
"implementation platform(group: 'foo', name: 'bar', version: '1.2.3')"
));
expect(deps).toMatchObject([
{
depName: 'foo:bar',
currentValue: '1.2.3',
},
]);

({ deps } = parseGradle(
'group: "com.example", name: "my.dependency", version: depVersion'
));
Expand Down
20 changes: 20 additions & 0 deletions lib/manager/gradle-lite/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,26 @@ const matcherConfigs: SyntaxMatchConfig[] = [
],
handler: processLongFormDep,
},
{
// (group: "com.example", name: "my.dependency", version: "1.2.3")
matchers: [
{ matchType: TokenType.LeftParen },
{ matchType: TokenType.Word, matchValue: 'group' },
{ matchType: TokenType.Colon },
{ matchType: potentialStringTypes, tokenMapKey: 'groupId' },
{ matchType: TokenType.Comma },
{ matchType: TokenType.Word, matchValue: 'name' },
{ matchType: TokenType.Colon },
{ matchType: potentialStringTypes, tokenMapKey: 'artifactId' },
{ matchType: TokenType.Comma },
{ matchType: TokenType.Word, matchValue: 'version' },
{ matchType: TokenType.Colon },
{ matchType: potentialStringTypes, tokenMapKey: 'version' },
{ matchType: TokenType.RightParen },
endOfInstruction,
],
handler: processLongFormDep,
},
{
// ("com.example", "my.dependency", "1.2.3")
matchers: [
Expand Down

0 comments on commit af35a32

Please sign in to comment.