allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

// 🔥 atur build folder global
val newBuildDir = rootProject.layout.buildDirectory.dir("../../build").get()
rootProject.layout.buildDirectory.value(newBuildDir)

// 🔥 atur build folder tiap module
subprojects {
    project.layout.buildDirectory.value(newBuildDir.dir(project.name))
}

// 🔥 pastikan app dieksekusi dulu
subprojects {
    project.evaluationDependsOn(":app")
}

// 🔥 clean project
tasks.register<Delete>("clean") {
    delete(rootProject.layout.buildDirectory)
}