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:

idea.dependsOn(:modules:ae:copyPassman)

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.
     idea.dependsOn(modules:bam-ae:copyPassman)

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

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

<code>
idea.dependsOn(“modules:bam-ae:copyPassman”) 
</code>

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’