Allow specifying which cargo-ndk targets are built, inside local.properties

This commit is contained in:
Nathan Adams 2024-03-22 22:30:58 +01:00 committed by TÖRÖK Attila
parent 3b4bd0db6f
commit 918df5fc78

View File

@ -1,6 +1,9 @@
@file:Suppress("UnstableApiUsage")
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
import com.github.willir.rust.CargoNdkBuildTask
import org.jetbrains.kotlin.konan.properties.hasProperty
import org.jetbrains.kotlin.konan.properties.propertyList
plugins {
alias(libs.plugins.androidApplication)
@ -135,4 +138,10 @@ cargoNdk {
module = "."
apiLevel = 26
buildType = "release"
val localProperties = gradleLocalProperties(rootDir, providers)
if (localProperties.hasProperty("ndkTargets")) {
targets = ArrayList(localProperties.propertyList("ndkTargets"))
}
}