/*
 * Copyright 2022 Google LLC
 *
 * 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'
    id 'com.google.devtools.ksp'
    id 'dagger.hilt.android.plugin'
}

android {
    namespace 'com.google.android.catalog.app'
    compileSdk 34

    defaultConfig {
        applicationId "com.google.android.catalog.app"
        minSdk 21
        targetSdk 34
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    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
    }

    composeOptions {
        kotlinCompilerExtensionVersion libs.versions.composeCompiler.get()
    }
    lint {
        checkReleaseBuilds false
        textOutput file('stdout')
        textReport true
    }
}

dependencies {
    def composeBom = platform(libs.compose.bom)
    implementation composeBom
    androidTestImplementation composeBom
    implementation libs.mdc

    // CASA UI dependency for the app-module
    implementation(project(":framework:ui"))

    // Required by CASA to generate the wiring logic
    implementation libs.hilt.android
    ksp libs.hilt.compiler

    // Include all available samples dynamically imported in settings.gradle
    gradle.ext.samples.each {
        implementation project("$it")
    }

    androidTestImplementation libs.androidx.test.runner
    testImplementation libs.androidx.test.runner
}
