Gradle Dependency Management - settings.gradle

Is it possible to define the order of build in multi-module project. I know the order in which the modules needs to be build but not their dependencies.

include 'c'
include 'd'
include 'a'

Need order of build as c d and a. But it is building a c and d

Please advice.

Execution order is solely determined by task dependencies. Often, a Gradle build will execute some tasks of project A, then some tasks of project B, and then again some tasks of project A. The order of ‘include’ declarations has no significance.

Is there any other way to have the sequence in which the modules need to be build.

Again, there is no such sequence. It’s a sequence of tasks, not a sequence of projects. What bigger problem are you trying to solve?

Thanks Peter.

I have a project with 60+ modules and it is in maven. I need to convert it into gradle

root-module
                |______ module-1
                |______ module-2
                |______ module-3
                |______ module-4
                .
                .
                .

As maven resolves its own dependencies and build the modules in its own order. How can i do it in gradle and also it is tough to calculate the dependencies between modules. Please advise.

What you need to do is to convert the multi-module Maven build to a multi-project Gradle build. The Bootstrap plugin will get you started on this. Also check out the multi-project build chapter in the Gradle User Guide.

Thanks Peter. I tried Bootstrap plugin and it was good.