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

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: "com.google.devtools.ksp"
apply plugin: 'dagger.hilt.android.plugin'

android {
    compileSdk 34

    defaultConfig {
        minSdk 21
        targetSdk 34
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = '17'
    }

    buildFeatures {
        // Determines whether to generate a BuildConfig class.
        buildConfig = false
        // Determines whether to support View Binding.
        // Note that the viewBinding.enabled property is now deprecated.
        viewBinding = false
        // Determines whether to support Data Binding.
        // Note that the dataBinding.enabled property is now deprecated.
        dataBinding = false
        // Determines whether to generate binder classes for your AIDL files.
        aidl = false
        // Determines whether to support RenderScript.
        renderScript = false
        // Determines whether to support injecting custom variables into the module's R class.
        resValues = true
        // Enable compose
        compose true
    }

    composeOptions {
        kotlinCompilerExtensionVersion libs.versions.composeCompiler.get()
    }
}

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

    // CASA dependencies for sample-modules
    implementation(project(":framework:base"))
    ksp(project(":framework:processor"))

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

    // Some common dependencies between samples
    implementation libs.androidx.core
    implementation libs.compose.foundation.foundation
    implementation libs.compose.ui.ui
    implementation libs.compose.material.material3

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