plugins {
    id 'com.android.library'
    id 'org.jetbrains.kotlin.android'
}

android {
    namespace 'com.shockwave.pdfium'
    compileSdk 34

    defaultConfig {
        minSdk 24

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        consumerProguardFiles "consumer-rules.pro"
        ndk {
            abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64'
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = "1.8"
    }

//    defaultConfig {
//        externalNativeBuild {
//            ndkBuild {
//                arguments "-DANDROID_ABI=${defaultConfig.ndkAbbi}"
//            }
//        }
//    }

    externalNativeBuild {
        ndkBuild {
            path "src/main/jni/Android.mk"
        }
    }
//    sourceSets {
//        main {
//            jni.srcDirs = []
//            jniLibs.srcDirs = ['src/main/jniLibs']
//        }
//    }
    sourceSets {
        main {
            jni.srcDirs = ['src/main/jni']
            jniLibs.srcDirs = ['src/main/jni/lib']
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation("androidx.appcompat:appcompat:1.7.0")
    implementation "androidx.core:core-ktx:$kotlin_version"
}