rootProject.name='postssystem' String[] includes = [ ':core:api', ':core:exposed', ':core:ktor', ':core:ktor:common', ':core:ktor:client', ':core:ktor:server', ':publishing:api', ':publishing:exposed', ':publishing:ktor:common', ':publishing:ktor:client', ':publishing:ktor:server', ':business_cases:post_creating:server', ':business_cases:post_creating:common', ':business_cases:post_creating:client', ] includes.each { originalName -> String projectDirectory = "${rootProject.projectDir.getAbsolutePath()}${originalName.replaceAll(":", File.separator)}" String projectName = "${rootProject.name}${originalName.replaceAll(":", ".")}" String projectIdentifier = ":${projectName}" include projectIdentifier ProjectDescriptor project = project(projectIdentifier) project.name = projectName project.projectDir = new File(projectDirectory) println(project) }