import org.apache.tools.ant.taskdefs.condition.Os plugins { id 'com.android.library' id "com.google.devtools.ksp" id "com.diffplug.spotless" id "kotlin-parcelize" id "org.jetbrains.dokka" } android { namespace 'org.oxycblt.musikr' compileSdk target_sdk ndkVersion "$ndk_version" defaultConfig { minSdk min_sdk testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" externalNativeBuild { cmake { cppFlags "" } } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } externalNativeBuild { cmake { path "src/main/cpp/CMakeLists.txt" version "3.22.1" } } compileOptions { coreLibraryDesugaringEnabled true sourceCompatibility JavaVersion.VERSION_21 targetCompatibility JavaVersion.VERSION_21 } buildFeatures { buildConfig true } lint { targetSdk target_sdk } testOptions { targetSdk target_sdk } } dependencies { // Kotlin implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" // AndroidX implementation "androidx.core:core-ktx:$core_version" // Database implementation "androidx.room:room-runtime:$room_version" ksp "androidx.room:room-compiler:$room_version" implementation "androidx.room:room-ktx:$room_version" // Build coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:$desugaring_version" // Testing testImplementation "junit:junit:4.13.2" testImplementation "io.mockk:mockk:1.14.11" testImplementation "org.robolectric:robolectric:4.16.1" testImplementation 'androidx.test:core-ktx:1.7.0' testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlin_coroutines_version" androidTestImplementation 'androidx.test.ext:junit:1.3.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0' } tasks.register("assembleTaglib", Exec, { def jniDir = "$projectDir/src/main/cpp" def libs = new File("$jniDir/taglib/pkg") if (libs.exists()) { commandLine "true" return } def ndkDir = androidComponents.sdkComponents.ndkDirectory.get().asFile commandLine "sh", "-c", "$jniDir/build_taglib.sh $jniDir $ndkDir" }) afterEvaluate { preDebugBuild.dependsOn assembleTaglib preReleaseBuild.dependsOn assembleTaglib } clean { delete "$projectDir/src/main/cpp/taglib/pkg" delete "$projectDir/src/main/cpp/taglib/build" }