hi folks, i’m trying to wrap my head around the or...
# gradle
t
hi folks, i’m trying to wrap my head around the order of gradle scripts in a multi-project build with a buildSrc for convention plugins. I’ve placed printlns across my *.gradle.kts files so I have a sense of the order from that: 1. ./settings.gradle.kts 2. ./buildSrc/settings.gradle.kts 3. ./buildSrc/build.gradle.kts 4. /build.gradle.kts 5. buildSrc convention plugins 6. project build.gradle.kts From that I see that I cannot define say the kotlin jvm plugin version in /build.gradle.kts if it is also defined in buildSrc/build.gradle.kts because gradle seems to only want the version declared once and as early as possible. So my question is, where can i find more information on this ordering and details about when/where versions can be defined?
c
I think what you want is not exactly what you asked
buildSrc/build.gradle[.kts] dependencies are added to the classpath for all the projects, and they o override any classpath you defined in them
Does that answer your question?
t
I think so … whatever is in buildSrc/build.gradle.kts takes priority?
e
buildSrc runtime dependencies are inserted before the root project's buildscript classpath, which takes precedence over whatever any subprojects add
includeBuild removes the special-ness and acts like any other buildscript classpath or plugin
t
makes sense 🙏
i assume i’d need to dig into gradle’s source to understand this?