Renovate: Gradle properties not resolved

Created on 4 Nov 2018  路  4Comments  路  Source: renovatebot/renovate

What Renovate type are you using?
Renovate CLI
version 13.119.1

Describe the bug

Gradle does not resolve values from gradle.properties file in project folder.

Did you see anything helpful in debug logs?

       Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

       FAILURE: Build failed with an exception.

       * Where:
       Build file '/tmp/renovate/github/ChristianMurphy/uPortal/build.gradle' line: 27

       * What went wrong:
       A problem occurred evaluating root project 'uPortal'.
       > Could not get unknown property 'nodejsVersion' for object of type com.moowork.gradle.node.NodeExtension.

       * Try:
       Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

       * Get more help at https://help.gradle.org

To Reproduce

Configure renovate with

{
  "extends": [
    "config:base"
  ],
  "gradle": {
    "enabled": true
  },
  "renovateFork": true
}

Include a build.gradle and a settings.gradle.
Leverage a property in the build.gradle file.

Expected behavior
Properties set in gradle.properties should be applied to build.gradle
https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties

Additional context

A copy of the full project setup is on https://github.com/ChristianMurphy/uPortal/tree/error-example

priority-3-normal bug

All 4 comments

Thanks for the bug report @ChristianMurphy. I have a refactor of this code to land today that hopefully makes it simple to fix this, if all we need is to copy over the gradle.properties field. Cc @corecanarias

Probably would be enough updating the fileMatch to include that file, something like this:

{
    name: 'gradle',
    description: 'Configuration object for build.gradle files',
    stage: 'package',
    type: 'json',
    default: {
      enabled: false,
      fileMatch: ['(^|/)*\\.gradle$', '(^|/)*\\gradle.properties$'],
      timeout: 300,
    },
    mergeable: true,
    cli: false,
  },

Can a user override the fileMatch configuration from their own configuration? That would help as a workaround until we include this change

Thanks, I have solved it that way.

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

The release is available on:

Your semantic-release bot :package::rocket:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

Flydiverny picture Flydiverny  路  4Comments

OmgImAlexis picture OmgImAlexis  路  4Comments

jgarec picture jgarec  路  3Comments

Siilwyn picture Siilwyn  路  4Comments