Slackbot
12/29/2023, 3:30 PMEric Haag
12/29/2023, 3:40 PMbuildDirectory actually returns a DirectoryProperty, meaning it can actually be set to a different location. It uses the provider API so that it can be lazily.
But, it's a good question why projectDirectory does not return a Provider but since it's read-only it doesn't need to be read lazily.Jendrik Johannes
12/29/2023, 6:44 PMprojectDirectory is not a Provider by design, because:
• It always has a value (not optional)
• It is set during the initialization phase (settings.gradle). So at the point you access it through projectDirectory, the value is already final.