import io.github.droidkaigi.feeder.Dep
import io.github.droidkaigi.feeder.Versions
// TODO: make this library Kotlin MPP
plugins {
    id 'com.android.library'
    id 'kotlin-android'
    id 'app.cash.exhaustive'
}

apply from: rootProject.file("gradle/android.gradle")
apply from: rootProject.file("gradle/compose.gradle")

android {
    defaultConfig {
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    compileOptions {
        coreLibraryDesugaringEnabled true // need for test. https://github.com/DroidKaigi/conference-app-2021/issues/373
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    packagingOptions {
        // https://github.com/Kotlin/kotlinx.coroutines/issues/2023
        exclude 'META-INF/AL2.0'
        exclude 'META-INF/LGPL2.1'
    }
}

dependencies {
    api projects.uicomponentCompose.core
    api projects.model
    lintChecks project(":checks")

    // Java 8+ API desugaring support
    coreLibraryDesugaring Dep.desugarJdkLibs

    implementation Dep.Jetpack.appcompat
    implementation Dep.coil
    implementation Dep.Accompanist.insets
    implementation Dep.Accompanist.pager
    implementation Dep.Accompanist.pagerIndicators

    implementation (Dep.Coroutines.core) {
        version {
            strictly Versions.coroutines
        }
    }

    // Write here to get from JetNews
    // https://github.com/android/compose-samples/blob/master/JetNews/app/build.gradle#L66
    implementation Dep.Compose.constraintLayout
    implementation Dep.Compose.navigation
    implementation Dep.Compose.hiltNavigationCompose
    implementation Dep.Compose.runtime
    implementation Dep.Compose.livedata
    implementation Dep.Compose.foundation
    implementation Dep.Compose.layout
    implementation Dep.Compose.ui
    implementation Dep.Compose.tooling
    implementation Dep.Compose.material
    implementation Dep.Compose.iconsExtended
    implementation Dep.Compose.animation
    androidTestImplementation Dep.Compose.test

    // Android
    implementation Dep.Jetpack.browser
}
