Can't Get Tasks In Dependent Projects To Run

I’m working on a multi-project build, and I can’t quite grasp how to use dependencies and artifacts to accomplish what I want.

I have a set of projects which depend on each other; one example: Application-A which depends on Framework-B which in turn depends on Framework-C. I’d like to do is declare a new task ‘pkg’ for all of my projects such that if I call pkg on Application-A, pkg is automatically executed on the dependency projects ‘Framework-B’ and ‘Framework-C’. As an additional bit of complexity the pkg task uses the artifacts that are created by running pkg on any dependency projects.

I’ve read all the online documentation I can find, and the ‘Gradle Effective Implementation Guide’ but still don’t have a clear idea of how I tie the artifacts of one dependent project to another.

Thanks in advance for any help,