So I have Android Project using Gradle that uses library A with Task MPManifestTask
that run every time I build.
The issue is I’m trying to improve my build performance using gradle configuration cache. But when I run it the Gradle log some issues with the task registered.
task:app:mpProcessItDebugit-debugManifest of type com.alipay.mpaas.easy.config.MPManifestTask
invocation of Task.project at execution time is unsupported. invocation of Task.project at execution time is unsupported.
Here is what I see from the task mentioned:
@TaskAction
public void executeTask() throws Exception {
Logger logger = this.getProject().getLogger();
logger.info("======================ANDROIDMANIFEST CONVERTER START================================");
logger.info(" start to convert" + this.appAndroidManifestFile);
}
Based on this link, I understand that I need to change this.getProjects().getLogger()
into this.getTask().getLogger()
to resolve the configuration cache issue.
But how do I change task execution from a dependency? If the task is source from my own project I can just change it but the task is from dependency and the code that I quoted is read-only.
Is it possible to change the implementation of task from a dependency? And if it possible how do I do that?