Kelvin Chung
06/06/2024, 3:50 PMSettings object (or BuildLayout), on what occasion would the root directory be different from the settings directory? I have an unusual Gradle project that symlinks its settings file, and I have a feeling it's compensating for something, and learning such distinction would prove useful.Vampire
06/06/2024, 4:00 PMThomas Broyer
06/06/2024, 4:09 PM--settings-file command-line argument which I suppose could change things tooKelvin Chung
06/06/2024, 4:16 PM--settings-file is deprecated to discourage people from fiddling around with it, or are there concrete plans to strongly associate the settings directory with "the directory where the gradlew script is located" or the "current working directory" or somesuch?
Again, I ask because I have an unusual project that symlinks gradlew, symlinks settings.gradle, symlinks build.gradle, and symlinks other directories like buildSrc.Vampire
06/06/2024, 4:44 PMAnd while it's deprecated, there's also still theIt should not change much. The root project by default has the settings dir as project dir. So if you specify a settings script from another location, that location is the settings dir and thus the root project dir. So again it depends on whether that settings script reconfigures the root project build script or not.command-line argument which I suppose could change things too--settings-file
Is the reasonPretty much, because you would always need to give this and / oris deprecated to discourage people from fiddling around with it--settings-file
--build-file on each invocation and also from IDE and other tools to get the build right.
See https://github.com/gradle/gradle/issues/16402 for the full reasoning.
with "the directory where theSurely not, where this script is located is totally irrelevant. You can also put it in a subdirectory and call it likescript is located"gradlew
subdirectory/gradlew if you prefer, this is just non-standard and will confuse everyone else 😄
If you meant "with the root project directory", I don't think so, as you can still customize the build layout / root project directory from within the settings script.
or the "current working directory" or somesuch?This basically is the case. Not in the sense that the settings script has to be in the current working directory, as it is also searched upwards unless you disable it, so that you can invoke Gradle from a subproject directory.
Kelvin Chung
06/06/2024, 5:29 PMbuildSrc, or even gradlew. Does that sound right?Vampire
06/06/2024, 5:52 PMKelvin Chung
06/06/2024, 5:54 PMmainProject and subProject, for which the symlinks point to mainProject - ie. there is a symlink from settings.gradle.kts to mainProject/settings.gradle.kts and so on, and subProject is just added as a plain old include(":subProject") therein.Vampire
06/06/2024, 5:56 PMKelvin Chung
06/06/2024, 5:58 PM./gradlew :subProject:build looks like it would make sense. But at an abstract level, it could probably be reworked.Vampire
06/06/2024, 6:09 PMKelvin Chung
06/06/2024, 7:41 PM