diff --git a/lib/modules/manager/gradle/parser.spec.ts b/lib/modules/manager/gradle/parser.spec.ts index 0c7cb2e0752c5b6bf556d0c7a278d357d2018f7a..5b1a99bcf741af15aae1b3a7b67ce7df85a40127 100644 --- a/lib/modules/manager/gradle/parser.spec.ts +++ b/lib/modules/manager/gradle/parser.spec.ts @@ -898,7 +898,11 @@ describe('modules/manager/gradle/parser', () => { ${'baz = "1.2.3"'} | ${'jacoco { toolVersion = baz }'} | ${{ depName: 'jacoco', packageName: GRADLE_PLUGINS['jacoco'], currentValue: '1.2.3', groupName: 'baz' }} ${'baz = "1.2.3"'} | ${'jacoco { toolVersion = property("baz") }'} | ${{ depName: 'jacoco', packageName: GRADLE_PLUGINS['jacoco'], currentValue: '1.2.3' }} ${''} | ${'lombok { version = "1.2.3" }'} | ${{ depName: 'lombok', packageName: GRADLE_PLUGINS['lombok'], currentValue: '1.2.3' }} + ${''} | ${'lombok { version.set("1.2.3") }'} | ${{ depName: 'lombok', packageName: GRADLE_PLUGINS['lombok'], currentValue: '1.2.3' }} + ${''} | ${'lombok { version.value("1.2.3") }'} | ${{ depName: 'lombok', packageName: GRADLE_PLUGINS['lombok'], currentValue: '1.2.3' }} ${''} | ${'pmd { toolVersion = "1.2.3" }'} | ${{ depName: 'pmd', packageName: GRADLE_PLUGINS['pmd'], currentValue: '1.2.3' }} + ${''} | ${'pmd { toolVersion.set("1.2.3") }'} | ${{ depName: 'pmd', packageName: GRADLE_PLUGINS['pmd'], currentValue: '1.2.3' }} + ${''} | ${'pmd { toolVersion.value("1.2.3") }'} | ${{ depName: 'pmd', packageName: GRADLE_PLUGINS['pmd'], currentValue: '1.2.3' }} ${''} | ${'pmd { foo = "bar"; toolVersion = "1.2.3" }'} | ${{ depName: 'pmd', packageName: GRADLE_PLUGINS['pmd'], currentValue: '1.2.3' }} ${''} | ${'spotbugs { toolVersion = "1.2.3" }'} | ${{ depName: 'spotbugs', packageName: GRADLE_PLUGINS['spotbugs'], currentValue: '1.2.3' }} ${''} | ${'pmd { toolVersion = "@@@" }'} | ${null} diff --git a/lib/modules/manager/gradle/parser/dependencies.ts b/lib/modules/manager/gradle/parser/dependencies.ts index 6f233035bf0079f8bf432d990674856e8c32ab69..098a2367e0e79d23c333b366961faede0c542502 100644 --- a/lib/modules/manager/gradle/parser/dependencies.ts +++ b/lib/modules/manager/gradle/parser/dependencies.ts @@ -170,10 +170,20 @@ const qImplicitGradlePlugin = q maxMatches: 1, startsWith: '{', endsWith: '}', - search: q - .sym<Ctx>(regEx(/^(?:toolVersion|version)$/)) - .op('=') - .join(qVersion), + search: q.sym<Ctx>(regEx(/^(?:toolVersion|version)$/)).alt( + // toolVersion = "1.2.3" + q.op<Ctx>('=').join(qVersion), + // toolVersion.set("1.2.3"), toolVersion.value("1.2.3") + q + .op<Ctx>('.') + .sym(regEx(/^(?:set|value)$/)) + .tree({ + maxDepth: 1, + startsWith: '(', + endsWith: ')', + search: q.begin<Ctx>().join(qVersion).end(), + }) + ), }) .handler(handleImplicitGradlePlugin) .handler(cleanupTempVars);