apply plugin: 'com.android.application'

dependencies {
    implementation files('../../../lib/facerec.jar')
    implementation files('openni/libs/org.openni.jar')
    implementation "androidx.core:core:1.0.0"
    implementation files('libs/telpo_temperature_v1.0.5.jar')
}

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"

    defaultConfig {
        applicationId "com.vdt.face_recognition.telpo_liveness_video_recognition"
        minSdkVersion 14
        targetSdkVersion 29
        versionCode 2
        versionName '2.0'
    }

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

    sourceSets {
        main {
            jniLibs.srcDirs = ["../../../lib", "openni/libs"]
        }
    }

//Insert unique string into asest to avoid copy assets to data folder every time on load app.
//Checking this unique string in UnpackAssetsActivity
    task computeAssetsHash() {
        doLast {
            new File(  "$projectDir/src/main/assets/", "assets-hash.txt").text = 
                """Buildtime: ${new Date().format("YYYY:MM:dd:HH:mm:ss", TimeZone.getTimeZone("GMT"))}"""
        }
    }

    task copyFiles(type: Copy) {
        description = 'Copy files'
        from("$projectDir/../../.."){
            include (
                "conf/**",
                "share/fda/**",
                "share/processing_block/face_detector/ssyv_light/**",
                "share/face_quality/**",
                "share/facerec/depth_liveness/**",
                "share/ir_liveness/**",
                "share/facerec/recognizers/method12v30/**",
                "license/**"
            )
        }
        into "$projectDir/src/main/assets/"
    }

    preBuild.dependsOn computeAssetsHash, copyFiles

}
