/*
 * Copyright 2023 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
 *
 *      https://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 'org.jetbrains.dokka'
    alias(libs.plugins.compose.compiler)
}

kotlin {
    explicitApi()
}

android {
    namespace 'com.google.android.glance.appwidget.testing'
    compileSdk 35

    defaultConfig {
        minSdk 26
        targetSdk 35

        consumerProguardFiles "consumer-rules.pro"

        vectorDrawables {
            useSupportLibrary true
        }

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        // The following argument makes the Android Test Orchestrator run its
        // "pm clear" command after each test invocation. This command ensures
        // that the app's state is completely cleared between tests.
        testInstrumentationRunnerArguments clearPackageData: 'true'
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = '17'
    }
    buildFeatures {
        buildConfig false
        compose true
    }

    testOptions {
        unitTests {
            includeAndroidResources = true
        }
        animationsDisabled true
        execution 'ANDROIDX_TEST_ORCHESTRATOR'
    }
    packagingOptions {
        resources {
            excludes += [
                '/META-INF/AL2.0',
                '/META-INF/LGPL2.1'
            ]
        }
    }

    publishing {
        multipleVariants {
            allVariants()
        }
    }
    lint {
        checkReleaseBuilds false
        textOutput file('stdout')
        textReport true
    }
}

dependencies {
    implementation platform(libs.androidx.compose.bom)
    implementation libs.compose.ui.ui

    implementation libs.glance.appwidget
}

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