How to move a gradle function from build.gradle into a plugin? -
currently, have few utility functions defined in top level build.gradle in multi-project setup, example this:
def utilitymethod() { dosomethingwith(project) // project magically defined }
i move code plugin, make utilitymethod available within project applies plugin. how do that? project.extension?
plugins not meant provide common methods tasks.
when comes extensions should used gather input applied plugins:
most plugins need obtain configuration build script. 1 method doing use extension objects.
more details here.
have @ peter's answer, using closures carried via ext
might looking for.
Comments
Post a Comment