apply plugin: 'com.android.library'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'org.jetbrains.kotlin.plugin.parcelize'

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}"

    api project(":mail:common")
    api project(":backend:api")

    implementation project(':plugins:openpgp-api-lib:openpgp-api')

    api "org.koin:koin-androidx-viewmodel:${versions.koin}"

    api "androidx.annotation:annotation:${versions.androidxAnnotation}"

    implementation "com.squareup.okio:okio:${versions.okio}"
    implementation "commons-io:commons-io:${versions.commonsIo}"
    implementation "androidx.core:core-ktx:${versions.androidxCore}"
    implementation "androidx.work:work-runtime-ktx:${versions.androidxWorkManager}"
    implementation "androidx.fragment:fragment:${versions.androidxFragment}"
    implementation "androidx.localbroadcastmanager:localbroadcastmanager:${versions.androidxLocalBroadcastManager}"
    implementation "org.jsoup:jsoup:1.13.1"
    implementation "com.squareup.moshi:moshi:${versions.moshi}"
    implementation "com.jakewharton.timber:timber:${versions.timber}"
    implementation "org.apache.james:apache-mime4j-core:${versions.mime4j}"

    testImplementation project(':mail:testing')
    testImplementation project(":backend:imap")
    testImplementation project(":mail:protocols:smtp")
    testImplementation project(":app:storage")
    testImplementation project(":app:testing")
    testImplementation "org.jetbrains.kotlin:kotlin-reflect:${versions.kotlin}"
    testImplementation "org.robolectric:robolectric:${versions.robolectric}"
    testImplementation "junit:junit:${versions.junit}"
    testImplementation "com.google.truth:truth:${versions.truth}"
    testImplementation "org.mockito:mockito-core:${versions.mockito}"
    testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:${versions.mockitoKotlin}"
    testImplementation "org.jdom:jdom2:2.0.6"
    testImplementation "org.koin:koin-test:${versions.koin}"
}

android {
    compileSdkVersion buildConfig.compileSdk
    buildToolsVersion buildConfig.buildTools

    defaultConfig {
        minSdkVersion buildConfig.minSdk
        targetSdkVersion buildConfig.robolectricSdk
    }

    lintOptions {
        abortOnError false
        lintConfig file("$rootProject.projectDir/config/lint/lint.xml")
    }

    compileOptions {
        sourceCompatibility javaVersion
        targetCompatibility javaVersion
    }

    kotlinOptions {
        jvmTarget = kotlinJvmVersion
    }

    testOptions {
        unitTests {
            includeAndroidResources = true
        }
    }
}
