-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect dependencies in Gradle included builds #5028
Detect dependencies in Gradle included builds #5028
Conversation
Hey @jakecoffman, maybe you can take look at this? :) |
Hey guys! |
Any news about with this PR ? Waiting for such changes |
e022f50
to
c9f526f
Compare
Detect includeBuild statements used to configure composite builds in the Gradle SettingsFileParser. https://docs.gradle.org/current/userguide/composite_builds.html https://docs.gradle.org/current/javadoc/org/gradle/api/initialization/Settings.html#includeBuild-java.lang.Object https://docs.gradle.org/current/javadoc/org/gradle/plugin/management/PluginManagementSpec.html#includeBuild-java.lang.String-
Fetch build files recursively for included builds in the Gradle FileFetcher.
Support all already accepted files for buildSrc directories. A buildSrc directory is an implicitly included build if present. https://docs.gradle.org/current/userguide/organizing_gradle_projects.html#sec:build_sources
c9f526f
to
4cd5677
Compare
Hi @gabrielfeo, we really apologize for the delays here. There is no reason this could't have been deployed earlier. Since this is now in production, it would be great if you could check that this is working as intended since you have familiarity with the standard. Thank you for the contribution! |
Working as intended, @Nishnha! E.g. gabrielfeo/50-72#61. Thank you for reviewing. We might be able to close #2180 also, but that wasn't the goal. I can test it further, not sure OP and latest comments are talking about the same thing. |
Detect already supported Gradle dependency files inside included builds and
buildSrc
.Goal
Dependabot currently supports dependencies in
build.gradle
and other buildscripts in the main build. However, these files can be present in the same format in other builds part of the main one: included builds. They can be easily supported by the current file parsing and updating implementation, since they're in the same format, most changes being in fetching files in the additional folders.build.gradle
build.gradle
in an included build (currently not fetched by Dependabot)Closes #4375
What are included builds?
In Gradle, a single build is composed of one root project with zero or more subprojects. A single build can also include other independent builds, each with its own settings file and root project (and maybe their own included builds):
An included build is declared explicitly in
settings.gradle
:buildSrc
is a special case. It's "treated as an included build". It's included in the build if the directory is namedbuildSrc
regardless of being declared insettings.gradle
. Not to be confused with the common pattern of declaring dependencies in code such as Kotlin classes inside buildSrc (#2180, example). That pattern is not supported and not a goal of this PR.Changes
Dry run examples
In regards to finding the update of Kotlin 1.6.10 -> 1.6.21 in this build.gradle.kts, which is inside an included build directory.
Current behavior: doesn't detect the Kotlin update because it doesn't detect and fetch files of included builds (test branch)
New behavior: detects the Kotlin update because it parses included build paths and fetches supported files inside (test branch 1 and 2)