2

Typically, a multi project Gradle build would be setup something like this:

root
   subproject1
   subproject2

And in root's settings.gradle file, I'd have something like:

rootProject.name = 'root'
include 'subproject1'
include 'subproject2'

This kind of multi-project setup is straightforward. However, what if subproject1 or subproject2 aren't contained within root? For example, I might have an existing subproject on my machine that is stored somewhere far away from root. How do I configure the setting.gradle file to account for this "non-standard" structure? Is it just a matter of providing an absolute path to the subproject folder in the settings.gradle file?

Adam
  • 8,752
  • 12
  • 54
  • 96
  • Possible duplicate of [Require Gradle project from another directory](https://stackoverflow.com/questions/19299316/require-gradle-project-from-another-directory) – beetstra Sep 06 '18 at 10:09

1 Answers1

0

This post covers it: https://discuss.gradle.org/t/how-to-include-sub-projects-in-settings-gradle-file/5096

Basically, you have to overwrite the project.projectDir attribute of your subproject so that it points to the location of the subproject on your machine.

Adam
  • 8,752
  • 12
  • 54
  • 96