/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'org.jetbrains.dokka'

android {
    compileSdkVersion rootProject.compileSdkVersion
    buildToolsVersion rootProject.buildToolsVersion

    defaultConfig {
        minSdkVersion rootProject.minSdkVersion
    }


    testOptions {
        unitTests.all {
            forkEvery = 1
            maxParallelForks = Math.ceil(Runtime.runtime.availableProcessors() * 1.5)
        }

        unitTests.includeAndroidResources = true
    }
    namespace 'com.facebook.litho.testing'
    lint {
        disable 'InvalidPackage', 'NewApi'
    }
}

dependencies {
    compileOnly project(':litho-sections-annotations')
    implementation project(':litho-core')
    implementation project(':litho-widget')
    implementation project(':litho-widget-kotlin')
    implementation project(':litho-sections-core')
    implementation project(':litho-processor')
    implementation project(':litho-rendercore-text')
    kapt project(':litho-processor')
    kapt project(':litho-sections-processor')

    implementation deps.inferAnnotations
    implementation deps.javapoet
    implementation deps.assertjCore
    implementation deps.guava
    implementation deps.jsr305
    implementation deps.junit
    implementation deps.mockitoCore
    implementation deps.mockitokotlin
    implementation(deps.robolectric) {
        exclude group: "com.google.guava", module: "guava"
    }
    implementation deps.kotlinStandardLib
    implementation deps.supportAppCompat
    implementation deps.textlayoutbuilder
    implementation deps.supportRecyclerView
    implementation deps.supportCore
    implementation deps.supportTestCore
    implementation deps.supportTestRunner
    compileOnly deps.supportAnnotations

    kaptTest project(':litho-processor')
    testImplementation deps.supportTestJunit
}

tasks.withType(Javadoc).all {
    enabled = false
}

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