include 'SubB'
rootProject.children.findAll { it.name in ['SubA', 'SubB'] }.each { project ->
project.projectDir = new File(settingsDir.parentFile, project.name)
}
Also, you should never use the ‘File’ constructor that accepts a single ‘String’ argument because the file it points at will depend on where you run Gradle from. You should always use ‘settingsDir’ variable as your reference point.