include ("project-a", "project-b")

// tag::lookup-project[]
println(rootProject.name)
println(project(":project-a").name)
// end::lookup-project[]

// tag::change-project[]
rootProject.name = "main"
project(":project-a").projectDir = file("../my-project-a")
project(":project-a").buildFileName = "project-a.gradle"
// end::change-project[]

// tag::change-project[]
rootProject.name = "main"
// tag::lookup-project[]
include("project-a")
// end::change-project[]
println(rootProject.name)
println(project(":project-a").name)
// end::lookup-project[]

// tag::change-project[]
project(":project-a").projectDir = file("../my-project-a")
project(":project-a").buildFileName = "project-a.gradle"
// end::change-project[]

Align Kotlin snippet multiproject/customLayout with Groovy
Align Kotlin snippet multiproject/customLayout with Groovy

gradle/gradle,gradle/gradle,gradle/gradle,gradle/gradle,gradle/gradle,gradle/gradle,gradle/gradle,gradle/gradle,gradle/gradle,gradle/gradle