/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

import com.facebook.fresco.buildsrc.Deps
import com.facebook.fresco.buildsrc.GradleDeps
import com.facebook.fresco.buildsrc.TestDeps

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

kotlin {
    jvmToolchain(11)
}

dependencies {
    compileOnly Deps.AndroidX.androidxAnnotation
    compileOnly Deps.AndroidX.legacySupportCoreUtils
    compileOnly Deps.jsr305
    compileOnly Deps.inferAnnotation
    compileOnly Deps.javaxAnnotation

    api project(':imagepipeline-base')
    implementation Deps.SoLoader.nativeloader
    implementation Deps.SoLoader.soloaderAnnotation

    implementation Deps.Bolts.tasks
    implementation project(':fbcore')
    implementation project(':middleware')
    implementation project(':urimod')

    implementation GradleDeps.Kotlin.stdlib

    testImplementation Deps.AndroidX.legacySupportCoreUtils
    testImplementation Deps.jsr305
    testImplementation project(':imagepipeline-test')
    testImplementation project(':imagepipeline-base-test')
    testImplementation project(':native-imagetranscoder')
    testImplementation TestDeps.assertjCore
    testImplementation TestDeps.junit
    testImplementation TestDeps.festAssertCore
    testImplementation TestDeps.mockitoCore3
    testImplementation TestDeps.mockitoInline3
    testImplementation(TestDeps.Powermock.apiMockito) {
        exclude group: 'org.mockito', module: 'mockito-all'
    }
    testImplementation TestDeps.Powermock.moduleJunit4
    testImplementation TestDeps.Powermock.moduleJunit4Rule
    testImplementation TestDeps.Powermock.classloadingXstream
    testImplementation(TestDeps.robolectric) {
        exclude group: 'commons-logging', module: 'commons-logging'
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    }
    testImplementation TestDeps.truth
}

android {
    buildToolsVersion FrescoConfig.buildToolsVersion
    compileSdkVersion FrescoConfig.compileSdkVersion

    namespace "com.facebook.imagepipeline"

    defaultConfig {
        minSdkVersion FrescoConfig.minSdkVersion
        targetSdkVersion FrescoConfig.targetSdkVersion
    }
    sourceSets {
        test {
            java {
                exclude '**/LocalVideoThumbnailProducerTest.java'
                exclude '**/DecodeProducerTest.java'
                exclude '**/HttpUrlConnectionNetworkFetcherTest.java'
            }
        }
    }
}

apply plugin: "com.vanniktech.maven.publish"
repositories {
    mavenCentral()
}
