How to find where a specific task is created in code?

I have a complex, multi-repository legacy android build at work and I’m trying to track down what’s doing what. Unfortunately, I’m more of a Bazel guy and I’m a bit lost in Gradle.

There are some custom transformation tasks being used to perform bytecode manipulations and I want to find where those tasks are added, what code they’re running, and where that code is.

I’ve tried help --task <task> but that doesn’t tell me anything useful. I’ve tried scanning the dependencies of the task but that also didn’t help much. Searching for the task name didn’t help since the name seems to be generated rather than hard coded.

Any help or tips would be very appreciated.