import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

apply plugin: "com.android.library"
apply plugin: "kotlin-android"
apply plugin: "kotlin-parcelize"
apply plugin: "com.vanniktech.maven.publish"

tasks.withType(KotlinCompile).all {
    kotlinOptions {
        freeCompilerArgs += [
                '-opt-in=kotlin.RequiresOptIn',
                '-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi',
                '-opt-in=com.airbnb.mvrx.InternalMavericksApi',
                '-opt-in=com.airbnb.mvrx.ExperimentalMavericksApi',
        ]
    }
}

android {
    resourcePrefix "mvrx_"

    defaultConfig {
        consumerProguardFiles "proguard-rules.pro"
    }

    testOptions {
        unitTests {
            includeAndroidResources = true
            all {
                jacoco {
                    includeNoLocationClasses = true
                    jacoco.excludes = ['jdk.internal.*']
                }
            }
        }
    }
    namespace 'com.airbnb.mvrx'
}

dependencies {
    api project(':mvrx-common')
    api libs.kotlinCoroutines
    api libs.activity

    implementation libs.activity
    implementation libs.appcompat
    implementation libs.fragment
    implementation libs.viewModelSavedState
    implementation libs.lifecycleCommon
    implementation libs.viewModelKtx
    implementation libs.runtimeKtx

    testImplementation libs.junit
    testImplementation libs.kotlinCoroutinesTest
    testImplementation libs.mockito
    testImplementation libs.roboeletric
    testImplementation libs.lifecycleTest
}
