the-mews/app/android/build.gradle.kts

44 lines
1.4 KiB
Text
Raw Normal View History

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<Delete>("clean") {
delete(rootProject.layout.buildDirectory)
}