allprojects { repositories { maven { url = uri("https://archive.ito.gov.ir/gradle/maven_central") } } } val newBuildDir: Directory = rootProject.layout.buildDirectory .dir("../../build") .get() rootProject.layout.buildDirectory.value(newBuildDir) subprojects { val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) project.layout.buildDirectory.value(newSubprojectBuildDir) } subprojects { val setupNamespace = Action { if (hasProperty("android")) { val android = property("android") as? com.android.build.gradle.BaseExtension if (android?.namespace == null) { android?.namespace = "com.github.twyatt.${name.replace("-", ".")}" } } } if (state.executed) { setupNamespace.execute(this) } else { afterEvaluate(setupNamespace) } } tasks.register("clean") { delete(rootProject.layout.buildDirectory) }