I think you’re trying to call https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html#exec-org.gradle.api.Action-, but your method is static def
, so there’s no instance of project
is available on that level of your build script.
Potential solutions:
- inline your method so that the
processMailTemplates
configuration closure provides you withTask#project
- make
def
non-static, so you getProject#project
from the buildscript’s context - modify the signature to
static def inlineCss(Project project, src, dest)
and useproject.exec ...
;
simply pass inproject
inside youreach
that will accessTask#project
from the configuration closure.
Note: to access Project#project
or Task#project
in the script you just say project
there’s no need for qualification the Groovy compiler will figure out which closure can resolve it, but it’s helpful to know what you’re actually accessing, for example so you can look up the docs.