buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.1.4'
    }
}

apply plugin: 'com.android.library'

android {
    namespace 'kr.pe.bab2min.kiwi'
    compileSdk 34

    defaultConfig {
        minSdk 21
        targetSdk 34

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles "consumer-rules.pro"

        ndk {
            abiFilters 'arm64-v8a', 'x86_64'
        }

        externalNativeBuild {
            cmake {
                arguments '-DKIWI_BUILD_DYNAMIC=OFF', '-DKIWI_USE_MIMALLOC=OFF', '-DKIWI_USE_CPUINFO=OFF', '-DKIWI_BUILD_CLI=OFF', '-DKIWI_BUILD_EVALUATOR=OFF', '-DKIWI_BUILD_MODEL_BUILDER=OFF', '-DKIWI_BUILD_TEST=OFF', '-DKIWI_JAVA_BINDING=ON'
            }
        }
    }

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

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    externalNativeBuild {
        cmake {
            path file('../../CMakeLists.txt')
            version '3.22.1'
        }
    }

    sourceSets {
        main {
            java.srcDirs = ['src']
            jni.srcDirs = []
            jniLibs.srcDirs = []
        }
    }
}

dependencies {
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}