How to invoke tasks of subprojects from root project and ensure their execution in correct order

Hi all,

I would like to execute a subtaks in a subproject before an other rootProject task.

My project structure is quite simple:

rootProject
     -> subproject

My settings files looks like this:
include 'subproject'

In my root project I have the following task:

task doSomething(dependsOn: [':subproject:checkBefore', rootProjectTask2]){}

Unfortunatelly when I execute doSomething, the second task in the dependsOn (rootProjectTask2) list is always executed first.

Any idea how I could ':subproject:checkBefore'?

Thanks in advance

Similar to your requirement that doSomething depends on :subproject:checkBefore, you’re describing an additional requirement that rootProjectTask2 depends on :subproject:checkBefore. Is that additional requirement being configured in the build script?