Gradle Dependency Management - settings.gradle


(kavinks) #1

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.


(Peter Niederwieser) #2

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.


(kavinks) #3

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


(Peter Niederwieser) #4

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?


(kavinks) #5

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.


(Peter Niederwieser) #6

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.


(kavinks) #7

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