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

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -