plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
    id 'com.chaquo.python'
}

android {
    compileSdkVersion 31
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.example.eketha"
        minSdkVersion 21
        targetSdkVersion 31
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"


        ndk {
            abiFilters "armeabi-v7a", "x86"
        }

        python {
            buildPython "C:/python/python.exe"
            pip {
                install "opencv-contrib-python-headless"
                install "pillow"
                install "numpy"
                install "fastapi"
                install "matplotlib"
                install "dlib"
                install "imutils"
                install "argparse"
                install "scipy"

            }
        }

        sourceSets {
            main {
                python.srcDir "src/main/python"
            }
        }
    }

    lintOptions {
        checkReleaseBuilds false
    }

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

    aaptOptions {
        noCompress "tflite"
        //noCompress "lite"
    }
    buildFeatures {
        mlModelBinding true
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'com.android.support:support-annotations:27.1.1'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
    implementation 'com.google.firebase:firebase-firestore:23.0.3'
    implementation 'com.google.firebase:firebase-auth:21.0.1'
    implementation 'org.tensorflow:tensorflow-lite-support:0.1.0'
    implementation 'org.tensorflow:tensorflow-lite-metadata:0.1.0'
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.google.android.gms:play-services-location:20.0.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation('org.tensorflow:tensorflow-lite:0.0.0-nightly') { changing = true }
    implementation('org.tensorflow:tensorflow-lite-gpu:0.0.0-nightly') { changing = true }
    implementation('org.tensorflow:tensorflow-lite-support:0.0.0-nightly') { changing = true }
    //Tensorflow Lite Dependencies
    implementation 'org.tensorflow:tensorflow-lite:+'

    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}