apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "co.huggingface.android_transformers.bert"
        minSdkVersion 26
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    aaptOptions {
        noCompress "tflite"
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    // If you find lint problem like:
    // * What went wrong:
    // A problem was found with the configuration of task ':app:lint'.
    // > No value has been specified for property 'lintClassPath'.
    //
    // Probably you haven't set ANDROID_HOME. To fix:
    // export ANDROID_HOME=$HOME/Android/Sdk   # Your Android SDK path.
    lintOptions {
        abortOnError false
    }
}

// Download TF Lite model.
apply from: 'download.gradle'

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.annotation:annotation:1.1.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'com.google.android.material:material:1.0.0'

    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.google.guava:guava:28.1-android'
//    implementation 'org.tensorflow:tensorflow-lite:2.0.0'
//    implementation 'org.tensorflow:tensorflow-lite-select-tf-ops:0.0.0-nightly'
    compile(name: 'tensorflow-lite-with-select-tf-ops-0.0.0-nightly', ext: 'aar')

    testImplementation 'junit:junit:4.12'
    testImplementation 'androidx.test:core:1.2.0'
    testImplementation 'com.google.truth:truth:1.0'
    testImplementation 'org.robolectric:robolectric:4.3.1'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

repositories {
    flatDir {
        dirs 'libs'
    }
    mavenCentral()
}
