Slackbot
08/15/2023, 4:18 PMChris Lee
08/15/2023, 4:23 PMlazy. Generally values like that would be provided at task registration time (by a plugin or build script author). Besides, findProperty is trivial and not worth making lazy (Gradle implicitly does that for you via providers.gradleProperty wired into task properties)
• lazy on a private class val is likely OK. This gets problematic for static /singleton items (companion objects, etc), as the Gradle Daemon remains running serving multiple builds (which may not play well with static state)Kelvin Chung
08/15/2023, 4:24 PMproject.findProperty() where they probably mean project.extra[], fwiw.Chris Lee
08/15/2023, 4:25 PMChris Lee
08/15/2023, 4:29 PMlazy directly in a task. For a very few, very complicated, heavyweight processing plugins/tasks have collaborating objects that use lazy during execution.Kelvin Chung
08/15/2023, 4:29 PMLeakingThis warnings when I have derived read-only properties.Chris Lee
08/15/2023, 4:30 PMLeakingThis , though its worth reading up on the risks to ensure you don’t stray into problematic areas.Vampire
08/15/2023, 4:41 PMI see a lot ofIf they mean that, then they are following bad practices. 😉 Extra properties are almost always just a quick-and-dirty work-around for not doing it the proper way. In most cases is is for example better to register an extension with fields, that are then also properly typed and can be accessed by accessors.where they probably meanproject.findProperty(), fwiw.project.extra[]
Kelvin Chung
08/15/2023, 4:41 PM