void (@NotNull GradleExecutionSettings buildSrcProjectSettings, @Nullable CompositeBuildData compositeBuildData, @NotNull String mainBuildPath) { if (compositeBuildData == null) return; String projectGradleVersion = myResolverContext.getProjectGradleVersion(); GradleVersion gradleBaseVersion = projectGradleVersion == null ? null : GradleVersion.version(projectGradleVersion).getBaseVersion(); if (gradleBaseVersion == null) return; // since 6.7 included builds become "visible" for `buildSrc` project https://docs.gradle.org/6.7-rc-1/release-notes.html#build-src // !!! Note, this is true only for builds included from the "root" build and it becomes visible also for "nested" `buildSrc` projects !!! // Transitive included builds are not visible even for related "transitive" `buildSrc` projects // due to limitation caused by specific ordering requirement: "include order is important if an included build provides a plugin which should be discovered very very early". // It can be improved in the future Gradle releases. if (gradleBaseVersion.compareTo(GradleVersion.version("6.7")) < 0) return; // since 7.2 including builds that transitively include current buildSrc will produce errors: https://github.com/gradle/gradle/issues/20898 for (BuildParticipant buildParticipant : excludeTransitiveParentsOf(mainBuildPath, compositeBuildData.getCompositeParticipants())) { buildSrcProjectSettings.withArguments(GradleConstants.INCLUDE_BUILD_CMD_OPTION, buildParticipant.getRootPath()); } }