Slackbot
06/30/2022, 7:49 AMVampire
06/30/2022, 9:05 AMJendrik Johannes
06/30/2022, 10:07 AMEugen Mayer
06/30/2022, 10:55 AM-Dorg.gradle.project.buildDir=/tmp/foo (which is fairly interesting when running builds in the container, but this is a other story), and this build ends up having composite builds, all composite builds are relocated, but without any namespacing. This leads to issues that the buildDir is shared. Without composite builds, this works without any issues. Odd that buildDir is not namespaced by default in this cases, but yes, all composites usually have there own dedicated build folder, so there is no need for that usuallyEugen Mayer
06/30/2022, 10:55 AMJendrik Johannes
06/30/2022, 12:08 PMorg.gradle.project.buildDir was added as a thing (Gradle 0.1 probably 😄) included builds where not invented yet. In general, I would not modify it the build directory through this built-in property. If you pass any property via command line, it is passed to all builds of the composite.
I didn’t know that this works at all with several subprojects. This is old Gradle functionality I think that is not maintained to work well with composites.
To change the the build dir via a command line parameter, I would use my own and add something like this to the build for all projects:
layout.buildDirectory.set(layout.dir(providers.gradleProperty("my-own-property").map { File("$it/${project.name}") }))
In the map { } part you may also use “project.path” or something like this if names are not unique. Building your own namespacing.Eugen Mayer
06/30/2022, 5:21 PMEugen Mayer
06/30/2022, 5:24 PMEugen Mayer
06/30/2022, 5:25 PM