renovatebot / renovate

Home of the Renovate CLI: Cross-platform Dependency Automation by Mend.io
https://mend.io/renovate
GNU Affero General Public License v3.0
17.18k stars 2.24k forks source link

Support for Gradle composite builds #9410

Open zharinov opened 3 years ago

zharinov commented 3 years ago

What would you like Renovate to be able to do?

https://docs.gradle.org/current/userguide/composite_builds.html#composite_build_intro

Did you already have any implementation ideas?

Example files:

More examples:

rarkins commented 3 years ago

Do we need to discover these files using fileMatch or will the build.gradle reference them?

rarkins commented 3 years ago

Also, is this the same as #8692 ?

zharinov commented 3 years ago

Oh, I forgot about it. Yes, it is.

rarkins commented 3 years ago

Maybe close this as a duplicate and copy over the links from here

HonkingGoose commented 3 years ago

Duplicate of #8692

zharinov commented 3 years ago

Desired functionality turned to be a part of another feature

zharinov commented 3 years ago

Probably should be done before #8692

Churro commented 1 year ago

PR #21892 introduces parsing support for Kotlin source files with object declarations like object X { ... } and single variable assignments, such as val dep = "..."

As of now, renovate doesn't recognize composite plugins explicitly and if you place e.g. a Deps.kt into a composite plugin outside of buildSrc, renovate wouldn't capture it. However, with the parsing support added with #21892, .kt files of composite plugins can be parsed in an opt-in fashion.

E.g., the following renovate config would match a file like includedBuild/dependencies/src/main/kotlin/com/badoo/reaktive/dependencies/Deps.kt (ex. here):

  {
    "gradle": {
      "fileMatch": ["^includedBuild/.+\\.kt$"]
    }
  }
mlschechter commented 4 months ago

It looks like all the functionality requested here is addressed via other released modifications - is that correct?

Churro commented 4 months ago

It looks like all the functionality requested here is addressed via other released modifications - is that correct?

Yes and no. Everything that's mentioned in the examples above can already be matched by renovate. Matching .kt files works as described here (probably it would make sense to add this to the public docs btw).

What's currently not supported are actual composite builds, as illustrated here. So if you have a project that declares a binary dependency on a library that is included from a composite build, e.g., some:internal:1.0.0, you'll see a warning in the dependency dashboard if this dep is not yet present in one of the listed registries. In other words, there is no detection of composite builds per se.

To add real support for composite builds, it might be necessary to parse includeBuild directives from gradle settings. However, this info alone would be too imprecise to match composite builds, as you also need to know the current group and version, which are often only resolved at build time.