apply plugin: 'com.android.application'
apply plugin: 'de.undercouch.download'

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId "org.tensorflow.lite.examples.detection"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"

//        ndk {
//            abiFilters 'armeabi-v7a', 'arm64-v8a'
//        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    aaptOptions {
        noCompress "tflite"
    }
    compileOptions {
        sourceCompatibility = '1.8'
        targetCompatibility = '1.8'
    }
    lintOptions {
        abortOnError false
    }
}

// import DownloadModels task
project.ext.ASSET_DIR = projectDir.toString() + '/src/main/assets'
project.ext.TMP_DIR = project.buildDir.toString() + '/downloads'

// Download default models; if you wish to use your own models then
// place them in the "assets" directory and comment out this line.
//apply from: "download_model.gradle"

apply from: 'download_model.gradle'

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
    implementation 'com.google.android.material:material:1.1.0'
//    implementation 'org.tensorflow:tensorflow-lite:0.0.0-nightly'
//    implementation 'org.tensorflow:tensorflow-lite-gpu:0.0.0-nightly'
    implementation 'org.tensorflow:tensorflow-lite:2.2.0'
    implementation 'org.tensorflow:tensorflow-lite-gpu:2.2.0'
//    implementation 'org.tensorflow:tensorflow-lite:0.0.0-gpu-experimental'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.code.gson:gson:2.8.6'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'com.android.support.test:rules:1.0.2'
    androidTestImplementation 'com.google.truth:truth:1.0.1'
}
