How to declare a "dependsOn" a task in another subproject?

Hi, I have a task in the root project that needs to dependOn a task in a subproject:

I tried this:


but I get this error:

Could not compile build file '/Users/philswenson/dev/sag/opt/build.gradle'.
> startup failed:
  build file '/Users/philswenson/dev/sag/opt/build.gradle': 80: illegal colon after argument expression;
     solution: a complex label expression before a colon must be parenthesized @ line 80, column 30.

I don’t really understand the error message… thoughts?

you have to declare the task path as a string and put it in quotes:


Just tried that, now I get this error:

* Where:
Build file '/Users/philswenson/dev/sag/opt/build.gradle' line: 80
  * What went wrong:
A problem occurred evaluating root project 'bam'.
> Could not find method dependsOn() for arguments [modules:bam-ae:copyPassman] on org.gradle.plugins.ide.idea.model.IdeaModel_Decorated@444e0b0c.

okay, then ‘idea’ is not a task. just tasks can depend on other tasks 

The problem here is that the idea plugin adds both a convention property and task named “Idea”. Change your script to:

tasks.idea.dependsOn ‘:modules:bam-ae:copyPassman’