Open zharinov opened 3 years ago
Do we need to discover these files using fileMatch
or will the build.gradle
reference them?
Also, is this the same as #8692 ?
Oh, I forgot about it. Yes, it is.
Maybe close this as a duplicate and copy over the links from here
Duplicate of #8692
Desired functionality turned to be a part of another feature
Probably should be done before #8692
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$"]
}
}
It looks like all the functionality requested here is addressed via other released modifications - is that correct?
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.
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?
[a-zA-Z][a-zA-Z0-9]([vV]ersions|[dD]eps|...)\.kt
gradle.properties
, but beforebuild.gradle.kts
Versions.Plugins.NODEJS
"foo:bar:1.2.3"
) should be extracted as well, though evaluation should occur in thebuild.gradle.kts
contextregistryUrl
sequence)Versions.kt
files, this mechanism should be applied for deps defined ingradle.properties
as wellExample files:
More examples:
radikushch/GAlertButton:
dependencies/src/main/java/com/example/dependencies/GlobalVersions.ktsquare/okhttp:
buildSrc/src/main/kotlin/deps.ktPokerAlpaka/kunde:
buildSrc/src/main/kotlin/Versions.ktthewca/tnoodle:
buildSrc/src/main/kotlin/dependencies/Versions.kt