How can I build independent projects from one parent directory?

(Ben Klein) #1

I have two separate projects which aren’t interdependent but which I want to build at the same time. There isn’t a “parent” project, though I am keeping them in a single directory. Is there a way for me to build them side-by-side from that directory (maybe by creating a parent project)? I can do this in Maven with a POM using pom packaging and listing the projects as modules… is there an equivalent method in Gradle?

(Luke Daley) #2

You’ll want to have a look at Prezi Pride. It’s not exactly the same thing, but can be used to achieve what you want.

FYI: we are rolling this functionality into core over time.

(Ben Klein) #3

Thanks! It looks like I can also go with Rene Groeschke’s approach from

(Akshayraj Kore) #4

I have a bit different structure. proj1, proj2, proj3. But they are independent and I just want to build them in succession, say 1,2,3. All are stored in parent directory.

I create setting.gradle and build.gradle in the parent directory. But don’t know what to do after. @fifthposition Tried multiparallel approach. How did you tried that?

(Ben Klein) #5

Hi @AkshayRaj,

The one other thing I did that I think could be missing: Each of my subprojects has its own build.gradle file. With that and also the other two files you mentioned (the other two go in the parent directory), I can build both subprojects from the parent directory.

(Kathrina Richenkova) #6

@fifthposition But what if there are two independent projects but one of them (say project A) rely on the other (say project B) and can’t work without it. Project B, on the other hand, considered as a stand-alone application and works fine by itself. Each of these projects has settings.gradle file in a root directory which points to a source directory.

The structure of these projects is the same and looks like this:


settings.gradle has a line include :project_name'

And the problem is when I build the Project A using Project B as a module it throws the following error:

A problem occurred configuring project ':project-a'.
Could not resolve all dependencies for configuration ':project-a:_debugApk'.
Project :project-a declares a dependency from configuration 'compile' to configuration 'default' which is not declared in the descriptor for project :project-b.

Project A has settings.gradle which contains:

include ':project-a', ':project-b'
project(':project-b').projectDir = new File(settingsDir, '../project-b-java')