/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * 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.
 */

import androidx.build.SoftwareType

plugins {
    id("AndroidXPlugin")
    id("com.android.library")
    id("androidx.stableaidl")
    id("org.jetbrains.kotlin.android")
}

dependencies {
    api(libs.jspecify)
    api(libs.kotlinCoroutinesCore)

    implementation(libs.kotlinStdlib)
    implementation("androidx.exifinterface:exifinterface:1.3.2")
    implementation("androidx.core:core:1.13.0")
    implementation("androidx.customview:customview:1.2.0")
    implementation("androidx.annotation:annotation:1.7.0")
    implementation("com.google.android.material:material:1.11.0")
    implementation("com.google.errorprone:error_prone_annotations:2.30.0")

    testImplementation(project(":pdf:pdf-viewer-fragment"))
    testImplementation(libs.junit)
    testImplementation(libs.testCore)
    testImplementation(libs.testRunner)
    testImplementation(libs.mockitoCore4)
    testImplementation(libs.mockitoKotlin4)
    testImplementation(libs.truth)
    testImplementation(libs.testExtTruth)
    testImplementation(libs.testExtJunitKtx)
    testImplementation("androidx.fragment:fragment-testing:1.7.1")
    testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")

    androidTestImplementation(libs.testExtJunit)
    androidTestImplementation(libs.junit)
    androidTestImplementation(libs.testCore)
    androidTestImplementation(libs.testRules)
    androidTestImplementation(libs.testRunner)
    androidTestImplementation(libs.mockitoCore)
    androidTestImplementation(libs.dexmakerMockito)
    androidTestImplementation(libs.truth)
    androidTestImplementation(libs.espressoCore)
    androidTestImplementation(libs.kotlinCoroutinesTest)
    androidTestImplementation(libs.mockitoKotlin4)
    androidTestImplementation(libs.espressoIntents)
    androidTestImplementation(project(":test:screenshot:screenshot"))
}

android {
    namespace = "androidx.pdf"

    defaultConfig {
        minSdk = 31
        compileSdk = 36
        compileSdkExtension = 18
    }

    buildFeatures {
        aidl = true
    }

    buildTypes.configureEach {
        stableAidl {
            version = 1
        }
    }

    sourceSets {
        test {
            assets {
                srcDirs += ["src/test/assets"]
            }
            resources {
                srcDirs += ["src/test/res"]
            }
        }
    }
}

androidx {
    name = "androidx.pdf:pdf-viewer"
    type = SoftwareType.PUBLISHED_LIBRARY
    inceptionYear = "2023"
    description = "add pdf viewing to their apps."
    addGoldenImageAssets()
    enableRobolectric()
}
