/*
 * Copyright 2022 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.application'
    id 'org.jetbrains.kotlin.android'
    alias(libs.plugins.roborazzi)
    alias(libs.plugins.compose.compiler)
}

android {
    namespace 'com.google.android.glance.tools.sample'
    compileSdk 35

    defaultConfig {
        applicationId "com.google.android.glance.tools.sample"
        minSdk 26
        targetSdk 35
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables {
            useSupportLibrary 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 {
        compose true
    }

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

dependencies {
    implementation project(':appwidget-configuration')
    debugImplementation project(':appwidget-viewer')
    debugImplementation project(':appwidget-testing')

    implementation platform(libs.androidx.compose.bom)
    implementation libs.androidx.core
    implementation libs.androidx.core.remoteviews
    implementation libs.glance.appwidget
    implementation libs.google.material

    implementation libs.androidx.activity.compose
    implementation libs.compose.ui.ui
    implementation libs.compose.ui.tooling.preview
    implementation libs.compose.material.material3
    implementation libs.compose.material.iconsext

    debugImplementation libs.compose.ui.tooling
    implementation libs.compose.ui.tooling.preview

    testImplementation libs.junit
    testImplementation libs.androidx.test.core
    testImplementation libs.androidx.test.runner
    testImplementation libs.androidx.test.espressoCore
    testImplementation libs.androidx.test.rules
    testImplementation libs.androidx.test.ext.junit
    testImplementation libs.robolectric
    testImplementation libs.roborazzi
}
