r02
r02

Reputation: 301

Gradle: using tasks from other files

I have a multi-project gradle setup. As one would imagine, some projects need to use the same custom tasks. I looked around for a way to use tasks located in another build.gradle file, to avoid code reproduction, but couldn't find any info. Is there a way to do this? If not, is there an elegant workaround?

Thanks!

Upvotes: 0

Views: 1226

Answers (1)

The End
The End

Reputation: 709

There are several ways to do this. The easiest way would be to define it in the root project with subprojects { ... }. You also can write it in a separate file and add it with apply from: yourfile.gradle.

If you want a more specific answer, you have to give more information about your projects and the task.

Upvotes: 3

Related Questions