/*
 * Copyright (c) 2021 DuckDuckGo
 *
 * 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.
 */

plugins {
    id 'com.android.library'
    id 'kotlin-android'
    id 'com.squareup.anvil'
}

apply from: "$rootProject.projectDir/gradle/android-library.gradle"

dependencies {
    anvil project(':anvil-compiler')
    implementation project(':anvil-annotations')

    implementation project(':app-build-config-api')
    implementation project(':anrs-api')
    implementation project(':anrs-store')
    implementation project(':common-utils')
    implementation project(':di')
    implementation project(':browser-api')
    implementation project(':custom-tabs-api')
    implementation project(':statistics-api')
    implementation project(':verified-installation-api')
    implementation project(':library-loader-api')
    implementation project(':feature-toggles-api')
    implementation project(':data-store-api')

    implementation AndroidX.core.ktx
    implementation KotlinX.coroutines.core
    implementation Google.dagger
    implementation "com.squareup.logcat:logcat:_"
    implementation Square.okio
    implementation AndroidX.room.runtime
    implementation AndroidX.room.rxJava2
    implementation AndroidX.room.ktx
    implementation AndroidX.room.rxJava2

    testImplementation project(':common-test')
    implementation project(':data-store-test')
    testImplementation Testing.junit4
    testImplementation AndroidX.archCore.testing
    testImplementation AndroidX.test.ext.junit
    testImplementation "org.mockito.kotlin:mockito-kotlin:_"
    testImplementation Testing.robolectric

    coreLibraryDesugaring Android.tools.desugarJdkLibs
}

android {
    lint {
        baseline = file("lint-baseline.xml")
        abortOnError = !project.hasProperty("abortOnError") || project.property("abortOnError") != "false"
    }
    anvil {
        generateDaggerFactories = true // default is false
    }

    ndkVersion '21.4.7075529'
    namespace 'com.duckduckgo.app.anr'
    compileOptions {
        coreLibraryDesugaringEnabled = true
    }

    externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
        }
    }
}
