4ntoine
4ntoine

Reputation: 20432

How to make gradle modules to be in the same directory?

I'm using maven and i'd like to move to gradle. The problem is that i have module "lib" and module "app", app uses lib. I have to create settings.gradle file in 'app' folder with include :lib content to make 'app' use 'lib'. I want them to be in the same folder 'project' like this:

project
|-lib
|-app

instead of:

project
|-app
  |-lib

I've tried using include ./lib but no luck.

How can i do it?

Upvotes: 1

Views: 498

Answers (1)

Peter Niederwieser
Peter Niederwieser

Reputation: 123960

project/settings.gradle:

include "app", "lib"

project/app/build.gradle:

...
dependencies {
    compile project(":lib")
}

For further details, see the "multi-project builds" chapter in the Gradle User Guide.

Upvotes: 2

Related Questions