tmn
tmn

Reputation: 11559

Gradle- Multi-project with outside projects?

Is it not possible in a Gradle multi-project setup to use external dependencies outside the main project folder?

Like in the settings.gradle file, can I not have something like

include 'C:\some\path\to\dependent\project\ChildA','ChildB'

or do I have to always include the dependent projects in the parent project folder?

Upvotes: 2

Views: 989

Answers (1)

Martin Konecny
Martin Konecny

Reputation: 59601

Assuming the following filesystem hierarchy:

|
 \ workspace
     |
      \
       MyProject
     |
      \
       DependencyA

Add the following into your settings.gradle in MyProject:

include '..:DependencyA'

and inside your inner build.gradle of MyProject

dependencies {
    compile project(':..:DependencyA')
}

Repeat for as many projects as you have that depend on DependencyA.

Upvotes: 3

Related Questions