Slackbot
11/09/2022, 8:21 PMChris Lee
11/09/2022, 8:28 PMlayout
for directory locations.tony
11/09/2022, 8:29 PMProject
instance. I was just wondering about the getRootDir()
partChris Lee
11/09/2022, 8:31 PMChris Lee
11/09/2022, 8:32 PMMartin
11/09/2022, 8:43 PMrootDir
so looks like it's not cc-safeMartin
11/09/2022, 8:43 PMMartin
11/09/2022, 8:44 PMChris Lee
11/09/2022, 8:44 PMChris Lee
11/09/2022, 8:45 PMtony
11/09/2022, 9:08 PMChris Lee
11/09/2022, 9:09 PMtony
11/09/2022, 9:09 PMMartin
11/09/2022, 9:09 PMMartin
11/09/2022, 9:11 PMtony
11/09/2022, 9:16 PMMartin
11/09/2022, 9:16 PMChris Lee
11/09/2022, 9:16 PMMartin
11/09/2022, 9:16 PMA task input or output property or a script variable to capture the result of using project.rootDir to calculate the actual parameter
would be kind of misleadingtony
11/09/2022, 9:17 PMFile
referencetony
11/09/2022, 9:17 PMtony
11/09/2022, 9:18 PMJendrik Johannes
11/09/2022, 9:44 PMProject.getRootDir()
during config time.
FTR layout.projectDirectory
is immutable and for reaching the root dir I would nowadays do rootProject.layout.projectDirectory
. Although that feels even more "dirty" due to the "rootProject" in there. That's why there is https://github.com/gradle/gradle/issues/13654 which unfortunately no one ever added yet.
(something to follow and give a 👍 )Paul Merlin
11/10/2022, 7:54 AMproject.rootDir
at configuration time is not a problem for CC at all.
If you use it to create a File input for a task, no need for a value source.