// 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 'spectrum'
            }
        }

        consumerProguardFiles 'proguard-spectrum.pro'
    }

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

    dependencies {
        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'

task sourcesJar(type: Jar) {
    from android.sourceSets.main.java.srcDirs
    classifier = 'sources'
}

artifacts.add('archives', sourcesJar)
