Multi-module project with relative paths to sub projects

The Settings.include method accepts a Gradle project path - this is different than a filesystem path - it uses the ‘’:’’ character as a path separator. With this method you are building the Gradle project hierarchy, while if the actual filesystem hierarchy is different than that, then you must use ProjectDescriptor.projectDir to set the actual directory for each project:

include ':A'
project(':A').projectDir = new File('../A')
include ':B'
project(':B').projectDir = new File('../B')
3 Likes