import io.getstream.avatarview.Configuration
import io.getstream.avatarview.Dependencies

plugins {
    id 'com.android.library'
    id 'org.jetbrains.kotlin.android'
    id 'org.jetbrains.dokka'
    id 'binary-compatibility-validator'
    id 'kotlin-kapt'
}

ext {
    PUBLISH_GROUP_ID = Configuration.artifactGroup
    if (snapshot) {
        PUBLISH_VERSION = Configuration.snapshotVersionName
    } else {
        PUBLISH_VERSION = Configuration.versionName
    }
    PUBLISH_ARTIFACT_ID = 'avatarview-glide'
}

apply from: "${rootDir}/scripts/publish-module.gradle"

android {
    compileSdkVersion Configuration.compileSdk
    defaultConfig {
        minSdkVersion Configuration.minSdk
        targetSdkVersion Configuration.targetSdk
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    lintOptions {
        abortOnError false
    }
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
    kotlinOptions.freeCompilerArgs += [
            "-Xexplicit-api=strict",
            "-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
            "-Xopt-in=io.getstream.avatarview.internal.InternalAvatarViewApi",
    ]
}

apiValidation {
    nonPublicMarkers += ["kotlin.PublishedApi"]
}

dependencies {
    api project(":avatarview")
    api Dependencies.glide

    implementation Dependencies.androidxAppcompat
    implementation Dependencies.coroutines
}

