import com.vanniktech.maven.publish.AndroidMultiVariantLibrary

plugins {
    id 'com.android.library'
    id 'kotlin-android'
    id 'org.jetbrains.kotlin.plugin.compose'
    id 'com.vanniktech.maven.publish'
}

android {
    namespace "com.airbnb.android.showkase"

    defaultConfig {
        minSdkVersion 21
        compileSdk 36
        targetSdkVersion 33

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

    buildTypes {
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    kotlinOptions {
        freeCompilerArgs += [
                '-Xopt-in=kotlin.RequiresOptIn',
        ]
    }
    buildFeatures {
        compose true
    }
    // Added to avoid this error -
    // Execution failed for task ':app:mergeDebugAndroidTestJavaResource'.
    // > A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
    // > 2 files found with path 'META-INF/AL2.0' from inputs:
    packagingOptions {
        exclude 'META-INF/AL2.0'
        exclude 'META-INF/LGPL2.1'
    }
}

kotlin {
    jvmToolchain(17)
}

dependencies {
    // Showkase
    api project(':showkase-annotation')

    // Support Libraries
    implementation deps.support.appCompat
    implementation deps.support.ktx

    // Compose
    implementation deps.compose.activityCompose
    implementation deps.compose.composeRuntime
    implementation deps.compose.composeNavigation
    implementation deps.compose.core
    implementation deps.compose.foundation
    implementation deps.compose.tooling
    implementation deps.compose.layout
    implementation deps.compose.material
}

mavenPublishing {
    configure(new AndroidMultiVariantLibrary(true, true))
}
