plugins {
    alias(libs.plugins.android.application)
    alias(libs.plugins.kotlin.android)
}

android {
    namespace = "com.sd.hmct_small_model"
    compileSdk = 35

    defaultConfig {
        applicationId = "com.sd.hmct_small_model"
        minSdk = 29
        targetSdk = 34
        versionCode = 1
        versionName = "1.0"

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

        ndk {
            abiFilters.addAll(listOf("arm64-v8a"))
        }
    }

    buildTypes {
        release {
            isMinifyEnabled = false
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_11
        targetCompatibility = JavaVersion.VERSION_11
    }
    kotlinOptions {
        jvmTarget = "11"
    }

//    lint {
//        abortOnError = false
//        checkReleaseBuilds = false
//    }
    buildFeatures {
        viewBinding = true
    }

    packaging {
        jniLibs {
            excludes.add("META-INF/*******")
        }
        resources {
            excludes.addAll(
                listOf(
                    "META-INF/*******",
                    "META-INF/INDEX.LIST",
                    "META-INF/androidx.localbroadcastmanager_localbroadcastmanager.version"
                )
            )
        }
    }
}

dependencies {
    implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))
    implementation(libs.androidx.core.ktx)
    implementation(libs.androidx.appcompat)
    implementation(libs.material)
    implementation(libs.androidx.activity)
    implementation(libs.androidx.constraintlayout)


    implementation("org.tensorflow:tensorflow-lite:2.17.0")
//    implementation("org.tensorflow:tensorflow-lite-task-text:0.4.0") {
//        exclude(group = "org.tensorflow",module="litert-support-api-1.0.1.aar")
//    }
//    implementation("org.tensorflow:tensorflow-lite-gpu-delegate-plugin:0.4.0")
//    implementation("org.tensorflow:tensorflow-lite-gpu:2.17.0")
    implementation(libs.tensorflow.lite.support)
    //pytorch_android
//    implementation("org.pytorch:pytorch_android_lite:2.1.0")
    implementation("org.pytorch:pytorch_android:2.1.0")
    implementation("org.pytorch:pytorch_android_torchvision:2.1.0")
//    implementation("org.pytorch:executorch-android:0.6.0")

//    implementation("org.pytorch:pytorch_android_torchvision:2.1.0")
//    implementation("com.github.huggingface:tokenizers:0.13.3")

    //协程
    implementation(libs.androidx.lifecycle.viewmodel.ktx)
    implementation(libs.androidx.lifecycle.runtime.ktx)




    testImplementation(libs.junit)
    androidTestImplementation(libs.androidx.junit)
    androidTestImplementation(libs.androidx.espresso.core)


}