I am using Android studio & using Gradle as build tool. In my build.gradle, I defined a custom task:
def myTask {
...
}
I would like to run the task right after the class.dex file is generated. I tried:
myTask.dependsOn(dex)
Gradle gives error: Could not find property 'dex'
Then, I tried:
myTask.dependsOn(dexDebug)
Gradle gives error: Could not find property 'dexDebug'
My questions are:
Why I got this error? I see at least there is a task named
dexDebug
in task list. Why I cannot depends my task on it?How to define my task to run right after class.dex file is generated then?
(I am using Gradle Android Plugin v1.0.0, Gradle v2.2.1)