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

apply plugin: 'com.android.library'

android {
    compileSdkVersion rootProject.compileSdkVersion
    buildToolsVersion rootProject.buildToolsVersion

    defaultConfig {
        minSdkVersion rootProject.minSdkVersion
        targetSdkVersion rootProject.targetSdkVersion
        buildConfigField "boolean", "IS_INTERNAL_BUILD", 'true'

        ndk {
            abiFilters 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
        }

        externalNativeBuild {
            cmake {
                arguments '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=c++_shared'
                targets 'spectrumpluginpng'
            }
        }
    }

    externalNativeBuild {
        cmake {
            path './CMakeLists.txt'
        }
    }

    packagingOptions {
            // provided by the main spectrum target
            exclude "**/libc++_shared.so"
            exclude "**/libspectrumcpp.so"
            exclude "**/libspectrumfbjni.so"
    }
}

dependencies {
    implementation project(':android')
    implementation project(':fbjni')
    compileOnly deps.jsr305
    implementation deps.soloader

    testImplementation deps.festAssert
    testImplementation deps.junit
    testImplementation deps.mockitoCore
    testImplementation deps.robolectric
}

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