bdawg.io
09/06/2018, 1:27 AMgildor
09/06/2018, 2:08 AMnapperley
09/06/2018, 2:24 AMgildor
09/06/2018, 2:30 AMnapperley
09/06/2018, 2:49 AMgildor
09/06/2018, 2:52 AMThere are two key best practices that make it easier to work within the static context of the Kotlin DSL:
- Using the plugins {} block
- Putting local build logic in the build’s buildSrc directory
Use buildSrc to abstract imperative logic
Complex build logic is usually a good candidate for being encapsulated either as custom task or binary plugin. Custom task and plugin implementations should not live in the build script. It is very convenient to use buildSrc for that purpose as long as the code does not need to be shared among multiple, independent projects.