/*
 * 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.LibraryType

plugins {
    id("AndroidXPlugin")
    id("com.android.library")
    id("androidx.stableaidl")
    id("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-alpha02")
    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.robolectric)
    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.junit)
    androidTestImplementation(libs.mockitoCore)
    androidTestImplementation(libs.dexmakerMockito)
    androidTestImplementation(libs.truth)
    androidTestImplementation(libs.espressoCore)
    androidTestImplementation(libs.kotlinCoroutinesTest)
    androidTestImplementation(libs.mockitoKotlin4)
    androidTestImplementation(libs.espressoIntents)
}

android {
    namespace = "androidx.pdf"

    defaultConfig {
        minSdk = 31
        compileSdk = 35
        targetSdk = 31
    }

    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 = LibraryType.PUBLISHED_LIBRARY
    inceptionYear = "2023"
    description = "add pdf viewing to their apps."
}
