Gradle- Multi-project with outside projects?

前端 未结 1 1211
谎友^
谎友^ 2021-01-07 05:25

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

相关标签:
1条回答
  • 2021-01-07 05:46

    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.

    0 讨论(0)
提交回复
热议问题