/*
 * 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.TestDeps

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

kotlin {
    jvmToolchain(11)
}

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

    implementation Deps.AndroidX.core

    testImplementation Deps.inferAnnotation
    testImplementation project(':mockito-config')
    testImplementation Deps.jsr305
    testImplementation TestDeps.assertjCore
    testImplementation TestDeps.junit
    testImplementation TestDeps.festAssertCore
    testImplementation TestDeps.mockitoCore
    testImplementation TestDeps.Powermock.apiMockito
    testImplementation TestDeps.Powermock.moduleJunit4Rule
    testImplementation TestDeps.Powermock.classloadingXstream
    testImplementation(TestDeps.robolectric) {
        exclude group: 'com.android.support', module: 'support-v4'
        exclude group: 'commons-logging', module: 'commons-logging'
        exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    }
}

android {
    buildToolsVersion FrescoConfig.buildToolsVersion
    compileSdkVersion FrescoConfig.compileSdkVersion

    useLibrary 'org.apache.http.legacy'

    namespace "com.facebook.fbcore"

    defaultConfig {
        consumerProguardFiles 'proguard-fresco.pro'
        minSdkVersion FrescoConfig.minSdkVersion
        targetSdkVersion FrescoConfig.targetSdkVersion
    }

    packagingOptions {
      exclude 'LICENSE'
      exclude 'LICENSE.txt'
      exclude 'META-INF/LICENSE'
      exclude 'META-INF/LICENSE.txt'
      exclude 'META-INF/NOTICE'
      exclude 'META-INF/NOTICE.txt'
    }

    sourceSets {
        test {
            resources {
                exclude '**/BUCK'
            }
        }
    }
}

apply plugin: "com.vanniktech.maven.publish"
