Renovate: Renovate updates versions in build.gradle rather than gradle.properties

Created on 20 Nov 2019  路  5Comments  路  Source: renovatebot/renovate

What Renovate type are you using?
Hosted app on GitHub
Gradle 5.1.1

Describe the bug
Renovate overwrites the variables referenced in build.gradle with the updated version numbers instead of updating the variables declared in gradle.properties.

To Reproduce
Configure Renovate with the following renovate.json

{
  "extends": [
    "config:base"
  ]
}

build.gradle

dependencies {
    compile group: 'com.google.api-client', name: 'google-api-client', version: "${googleApiClientVersion}"
}

gradle.properties

googleApiClientVersion=1.23.0

Renovate opens a PR with the "${googleApiClientVersion}"in build.gradle replaced with 1.30.5:
https://github.com/Wagan8r/essentials-kit/pull/37

See repo:
https://github.com/Wagan8r/essentials-kit/commit/b26808f92be4b57772d5d5e9ac7ffb69fcc3f352

Additional context

This was previously reported and fixed about a year ago in this issue:
https://github.com/renovatebot/renovate/issues/2758

Additionally, it seems to _partially_ work. I am also using the io.spring.dependency-management plugin which has a configuration like such:

dependencyManagement {
    imports {
        mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
    }
}

The above springBootVersion is also declared in the gradle.properties, yet Renovate is able to recognize this and make a PR to update the gradle.properties as I would expect:

https://github.com/Wagan8r/essentials-kit/pull/39

gradle bug

All 5 comments

@corecanarias @ikesyo any idea about this?

Looks like version: "${googleApiClientVersion}" is the problem; we only support version: googleApiClientVersion syntax which is not wrapped in string interpolation.

Refs:

@ikesyo @rarkins I updated my repo and confirmed that using the variable directly and not relying on the string interpolation works as expected. If this is not a feature that you wish to support, I can close it as I am no longer blocked.

I think we should support it. Should just be a few extra characters in the regex, right?

:tada: This issue has been resolved in version 19.103.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Was this page helpful?
0 / 5 - 0 ratings