plugins { id("com.android.application") id("org.jetbrains.kotlin.android") } android { namespace = "io.github.dovecoteescapee.byedpi" compileSdk = 34 defaultConfig { applicationId = "io.github.dovecoteescapee.byedpi" minSdk = 21 targetSdk = 34 versionCode = 10 versionName = "1.2.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" ndk { abiFilters.add("armeabi-v7a") abiFilters.add("arm64-v8a") abiFilters.add("x86") abiFilters.add("x86_64") } } buildFeatures { buildConfig = true } buildTypes { release { buildConfigField("String", "VERSION_NAME", "\"${defaultConfig.versionName}\"") isMinifyEnabled = false proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") } debug { buildConfigField("String", "VERSION_NAME", "\"${defaultConfig.versionName}-debug\"") } } compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = "1.8" } externalNativeBuild { cmake { path = file("src/main/cpp/CMakeLists.txt") version = "3.22.1" } } buildFeatures { viewBinding = true } // https://android.izzysoft.de/articles/named/iod-scan-apkchecks?lang=en#blobs dependenciesInfo { // Disables dependency metadata when building APKs. includeInApk = false // Disables dependency metadata when building Android App Bundles. includeInBundle = false } } dependencies { implementation("androidx.fragment:fragment-ktx:1.8.2") implementation("androidx.core:core-ktx:1.13.1") implementation("androidx.appcompat:appcompat:1.7.0") implementation("androidx.preference:preference-ktx:1.2.1") implementation("com.takisoft.preferencex:preferencex:1.1.0") implementation("com.google.android.material:material:1.12.0") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.4") implementation("androidx.lifecycle:lifecycle-service:2.8.4") testImplementation("junit:junit:4.13.2") androidTestImplementation("androidx.test.ext:junit:1.2.1") androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1") } tasks.register("runNdkBuild") { group = "build" val ndkDir = android.ndkDirectory executable = if (System.getProperty("os.name").startsWith("Windows", ignoreCase = true)) { "$ndkDir\\ndk-build.cmd" } else { "$ndkDir/ndk-build" } setArgs(listOf( "NDK_PROJECT_PATH=build/intermediates/ndkBuild", "NDK_LIBS_OUT=src/main/jniLibs", "APP_BUILD_SCRIPT=src/main/jni/Android.mk", "NDK_APPLICATION_MK=src/main/jni/Application.mk" )) println("Command: $commandLine") } tasks.preBuild { dependsOn("runNdkBuild") }