plugins {
    id 'com.android.library'
    id 'org.jetbrains.kotlin.android'
}

android {
    compileSdk 31

    defaultConfig {
        minSdk 21
        targetSdk 31

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

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
    buildFeatures {
        compose = true
    }
    composeOptions {
        kotlinCompilerExtensionVersion = "1.4.1"
    }
    kotlinOptions {
        freeCompilerArgs += ['-Xexplicit-api=strict', '-Xopt-in=kotlin.RequiresOptIn']
        freeCompilerArgs += ['-Xopt-in=kotlin.RequiresOptIn']
        jvmTarget = '11'
    }
    namespace 'com.adapty.ui'
}

def composeBom = '2024.09.02'

dependencies {

    compileOnly project(':adapty')
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

    implementation platform("androidx.compose:compose-bom:$composeBom")
    api 'androidx.compose.ui:ui'
    implementation 'androidx.compose.material3:material3'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.8.0'

    implementation 'androidx.webkit:webkit:1.5.0'

    debugCompileOnly 'androidx.compose.ui:ui-tooling'
    debugCompileOnly 'androidx.compose.ui:ui-test-manifest'
}