plugins { id 'com.android.library' } def targetAbi = "" if (!gradle.startParameter.taskNames.isEmpty()) { if (gradle.startParameter.taskNames.size == 1) { def targetTask = gradle.startParameter.taskNames[0].toLowerCase() if (targetTask.contains("arm64")) { targetAbi = "arm64" } else if (targetTask.contains("arm")) { targetAbi = "arm" } } else { targetAbi = "~" } } android { compileSdkVersion 30 buildToolsVersion '30.0.3' ndkVersion rootProject.ext.ndkVersion defaultConfig { minSdkVersion 19 targetSdkVersion 30 externalNativeBuild { ndkBuild { if (!targetAbi.isBlank()) { if (targetAbi == "arm64") { abiFilters 'arm64-v8a' } else if (targetAbi == "arm") { abiFilters 'armeabi-v7a' } else { abiFilters 'armeabi-v7a', 'arm64-v8a' } } else { abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' } arguments "NDK_APPLICATION_MK:=src/main/jni/Application.mk", "APP_PLATFORM:=android-21", "--jobs=${Runtime.getRuntime().availableProcessors()}" } } } externalNativeBuild { ndkBuild { path 'src/main/jni/Android.mk' } } namespace 'io.nekohasekai.ssr_libev' }