/*
 * Copyright (c) 2025 Adyen N.V.
 *
 * This file is open source and available under the MIT license. See the LICENSE file for more info.
 *
 * Created by ozgur on 8/4/2025.
 */
plugins {
    alias libs.plugins.android.library
    alias libs.plugins.kotlin.android
    alias libs.plugins.kotlin.parcelize
    alias libs.plugins.kotlin.compose
    alias libs.plugins.dokka.convention
}

// Maven artifact
ext.mavenArtifactId = "core"
ext.mavenArtifactName = "Adyen Checkout Core"
ext.mavenArtifactDescription = "Adyen Checkout Core module."

apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
    // TODO fix the namespace since we're already using this
    namespace 'com.adyen.checkout.core'
    compileSdk libs.versions.compile.sdk.get().toInteger()

    defaultConfig {
        minSdk libs.versions.min.sdk.get().toInteger()
        targetSdk libs.versions.target.sdk.get().toInteger()

        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
        consumerProguardFiles "consumer-rules.pro"
    }

    testFixtures {
        enable = true
    }

    buildFeatures {
        compose true
    }
}

dependencies {
    api project(":ui")

    api libs.bundles.androidx.lifecycle

    implementation platform(libs.compose.bom)
    implementation libs.bundles.compose.ui
    implementation libs.compose.viewmodel
    implementation libs.okhttp
    implementation libs.androidx.browser

    testImplementation libs.json
    testImplementation libs.bundles.junit
    testImplementation libs.bundles.kotlin.coroutines.test
    testImplementation libs.bundles.mockito
    testImplementation libs.robolectric

    testFixturesImplementation libs.bundles.androidx.lifecycle
    testFixturesImplementation libs.bundles.junit
    testFixturesImplementation libs.bundles.kotlin.coroutines.test
}
