I'm developing an Android app and I'm using greendao to model my database. I wanted to run the daogenerator everytime I rebuild a project but it is on another module.
How can I do this using gradle?
This is, how can I run the application in a module before building another module.
Thank you.
Sure you can do that!
Create a task that runs your generation. For my case the module with greendao is next to the app module. It is an java module.
task generateDao(type: GradleBuild) {
dir = "../greendaogenerator"
tasks = ["run"]
}
Configure that this task will run before every compile task
tasks.whenTaskAdded { task ->
if (task.name.startsWith('compile')) {
task.dependsOn generateDao
task.mustRunAfter generateDao
}
}