allprojects { repositories { google() mavenCentral() } } 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 { project.evaluationDependsOn(":app") } // The devbox-managed SDK ships one NDK and is read-only, so Gradle can never // install another beside it. Plugin build scripts ask for Flutter's default // NDK, which the SDK does not carry; every project is therefore pinned to // the one it does. Matches the app's own pin in app/build.gradle.kts. gradle.afterProject { // The devbox-managed SDK ships one NDK and is read-only, so Gradle can // never install another beside it. Plugin build scripts ask for // Flutter's default NDK, which the SDK does not carry; every project // is therefore pinned to the one it does, as the app itself is. val android = extensions.findByName("android") ?: return@afterProject try { android::class.java .getMethod("setNdkVersion", String::class.java) .invoke(android, "27.0.12077973") } catch (_: NoSuchMethodException) { // Nothing to pin. } } tasks.register("clean") { delete(rootProject.layout.buildDirectory) }