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

android {

    compileSdkVersion versions.androidCompileSdk

    defaultConfig {
        applicationId "com.folioreader.android.sample"
        minSdkVersion versions.androidMinSdk
        targetSdkVersion versions.androidTargetSdk
        versionCode versions.projectVersionCode
        versionName versions.projectVersionName
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }

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

    dexOptions {
        javaMaxHeapSize "4G"
    }

    packagingOptions {
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/services/javax.annotation.processing.Processor'
    }

    lintOptions {
        abortOnError false
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "androidx.appcompat:appcompat:$versions.appcompat"
    implementation "androidx.constraintlayout:constraintlayout:$versions.constraintLayout"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation "androidx.test.ext:junit:1.1.1"
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    implementation project(':folioreader')
    //implementation "com.folioreader:folioreader:$versions.folioreaderSdk"

    implementation "com.fasterxml.jackson.core:jackson-core:$versions.jackson"
    implementation "com.fasterxml.jackson.core:jackson-annotations:$versions.jackson"
    implementation "com.fasterxml.jackson.core:jackson-databind:$versions.jackson"
    implementation "com.fasterxml.jackson.module:jackson-module-kotlin:$versions.jackson"

    //progressBar error solve
    configurations.matching { it.name == '_internal_aapt2_binary' }.all { config ->
        config.resolutionStrategy.eachDependency { details ->
            details.useVersion("3.3.2-5309881")
        }
    }

}
