plugins {
    id("com.android.library")
    id("kotlin-multiplatform")
    id('com.vanniktech.maven.publish')
    id("org.jetbrains.compose")
    alias(libs.plugins.compose.compiler)
}

android {
    namespace 'com.dokar.chiptextfield.m3'

    compileSdk libs.versions.androidCompileSdk.get().toInteger()

    defaultConfig {
        minSdk 21
        targetSdkVersion  libs.versions.androidTargetSdk.get().toInteger()

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

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

kotlin {
    jvmToolchain(11)

    jvm()
//    iosX64()
//    macosX64()
    js(IR) {
        browser()
    }
    wasmJs {
        binaries.executable()
        binaries.library()
    }

    androidTarget {
        publishLibraryVariants("release")
    }

    sourceSets {
        commonMain {
            dependencies {
                api project(":chiptextfield-core")
                api(compose.ui)
                api(compose.foundation)
                api(compose.material3)
            }
        }
    }
}
