A new method in Settings: Settings.includePath

This is a feature request.

There should be a method of Settings to include a gradle project based on its path. This would allow easy configuration of multi-project builds where there the projects are not all residing in the same folder. In that case you could have a settings.gradle containing (eg.:slight_smile: " includePath ‘…/…/RandomFolder/ProjectB’ ".

I agree that having a conventional gradle folder structure for multi-project builds is a good thing, but in my case it is not really possible. I am reading 2 different projects from 2 different git repository (I wish the project owner would merge the repositories) and trying to put one as a dependency of the other.

‘Settings.include()’ takes a project path as an argument, which is completely independent of file path. However the default behavior is to interpret it as a file path relative to the root project directory. The project path can be completely arbitrary, and the subproject’s directory can be anywhere. This can be modified in your settings.gradle via ‘ProjectDescriptor.setProjectDir()’.

Perhaps a better idea would be to extend the ‘include()’ method to take additional arguments (or a ‘Map’ that configures a ‘ProjectDescriptor’) allowing the user to do something like this:

include(path: ‘:projectB’, projectDir: ‘…/…/RandomFolder/ProjectB’)

1 Like