apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
    compileSdkVersion buildConfig.compileSdk
    buildToolsVersion buildConfig.buildTools
    defaultConfig {
        applicationId "com.edvard.poseestimation"
        minSdkVersion buildConfig.minSdk
        targetSdkVersion buildConfig.targetSdk
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

        externalNativeBuild {
            cmake {
                arguments  '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=gnustl_static'
                cppFlags "-std=c++11","-frtti", "-fexceptions"
            }
        }
        ndk {
            abiFilters 'armeabi-v7a'
        }
    }

    externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
        }
    }

    lintOptions {
        abortOnError false
    }

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

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

    aaptOptions {
        noCompress "tflite"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }
}

repositories {
    maven {
        url 'https://google.bintray.com/tensorflow'
    }
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation project(':openCVLibrary341')
    implementation deps.kotlin.stdlib.jdk
    implementation(name:'tensorflow-lite', ext:'aar')
    implementation deps.android.support.appcompatV7
    implementation deps.android.support.constraintLayout
    implementation deps.android.support.design
    implementation deps.android.support.annotations
    implementation deps.android.support.supportV13
    implementation deps.timber

    testImplementation deps.junit

    androidTestImplementation(deps.android.test.espresso, {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
}
