Skip to content

Commit

Permalink
fix(gradle-lite): Allow for methods named "uri" to define the registr…
Browse files Browse the repository at this point in the history
…y URLs (#8120)
  • Loading branch information
zharinov committed Dec 22, 2020
1 parent f7d4dd2 commit 6506584
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lib/manager/gradle-lite/parser.spec.ts
Expand Up @@ -41,6 +41,12 @@ describe('manager/gradle-lite/parser', () => {

({ urls } = parseGradle('url("https://example.com")'));
expect(urls).toStrictEqual(['https://example.com']);

({ urls } = parseGradle('uri "https://example.com"'));
expect(urls).toStrictEqual(['https://example.com']);

({ urls } = parseGradle('uri("https://example.com")'));
expect(urls).toStrictEqual(['https://example.com']);
});
it('parses long form deps', () => {
let deps;
Expand Down
4 changes: 2 additions & 2 deletions lib/manager/gradle-lite/parser.ts
Expand Up @@ -299,7 +299,7 @@ const matcherConfigs: SyntaxMatchConfig[] = [
{
// url 'https://repo.spring.io/snapshot/'
matchers: [
{ matchType: TokenType.Word, matchValue: 'url' },
{ matchType: TokenType.Word, matchValue: ['uri', 'url'] },
{ matchType: TokenType.String, tokenMapKey: 'registryUrl' },
endOfInstruction,
],
Expand All @@ -308,7 +308,7 @@ const matcherConfigs: SyntaxMatchConfig[] = [
{
// url('https://repo.spring.io/snapshot/')
matchers: [
{ matchType: TokenType.Word, matchValue: 'url' },
{ matchType: TokenType.Word, matchValue: ['uri', 'url'] },
{ matchType: TokenType.LeftParen },
{ matchType: TokenType.String, tokenMapKey: 'registryUrl' },
{ matchType: TokenType.RightParen },
Expand Down

0 comments on commit 6506584

Please sign in to comment.