How do I call a plugin task as a dependency of another?

(john) #1

I am using the native-artifacts plugin which defines a number of tasks that extract the Nar dependencies of dependencies that are built elsewhere (and stored in Nexus/Maven). I need to ensure these tasks are called before the build of a binary, otherwise the headers that these Nars include are not found.

My question is, how do I define a system/plugin-defined task as a dependency of one of my tasks?

I’d like something like:

binaries.all {binary ->
      dependencies {
        // this next line is now the same as the plugin-defined task I want to have called before
        // before the build takes place
        compile "extractNarDeps${}"

Sadly, this doesn’t build. How can I achieve this please?