are convention plugins generally recommended over ...
# gradle
l
are convention plugins generally recommended over custom logic applied inside
afterEvaluate {}
? I wonder mostly in terms of correctness and performance
c
Convention plugins and
afterEvaluate
are two different, orthogonal concepts. Convention plugins are the idiomatic approach to applying reusable logic to projects.
afterEvaluate
can be used within scripts or plugins to force configuration to be applied at a loosely-specified point in the Gradle lifecycle.
afterEvaluate
is not a recommended approach - it’s a code smell, resulting in fragile build logic, and is almost always unnecessary.
l
Thanks for pointing it out, indeed thinking it through they’re not similar, just that our usage of it could be translated quite well to convention plugins.
v
Then by any means do it. 🙂