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

android {
    compileSdk = rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion

        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_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }

    buildFeatures {
        viewBinding = true
    }

}

dependencies {
    api 'androidx.core:core-ktx:1.8.0'
    api 'androidx.appcompat:appcompat:1.4.2'
    api 'com.google.android.material:material:1.6.1'
    api 'androidx.recyclerview:recyclerview:1.2.1'

    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

    def kotlin_version = '1.7.0'
    def lifecycle_version = '2.5.1'
    api "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

    // ViewModel
    api("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version")
    // LiveData
    api("androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version")
    // Lifecycles only (without ViewModel or LiveData)
    api("androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version")
    // Saved state module for ViewModel
    api("androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle_version")
    // alternately - if using Java8, use the following instead of lifecycle-compiler
    api("androidx.lifecycle:lifecycle-common-java8:$lifecycle_version")
    // optional - helpers for implementing LifecycleOwner in a Service
    api("androidx.lifecycle:lifecycle-service:$lifecycle_version")
    // optional - ProcessLifecycleOwner provides a lifecycle for the whole application process
    api("androidx.lifecycle:lifecycle-process:$lifecycle_version")
    // optional - ReactiveStreams support for LiveData
    api("androidx.lifecycle:lifecycle-reactivestreams-ktx:$lifecycle_version")

    //jetpack navigation
    api 'androidx.navigation:navigation-fragment-ktx:2.5.1'
    api 'androidx.navigation:navigation-ui-ktx:2.5.1'

    /*Kotlin*/
    api "androidx.core:core-ktx:1.8.0"
    api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    api 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.3'
    api 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.3'

    /*google GA分析*/
    api 'com.google.android.gms:play-services-analytics:18.0.1'

    /*Android6.0 限兼容*/
    api 'pub.devrel:easypermissions:3.0.0'
    /*沉浸式状态栏*/
    api 'com.gyf.immersionbar:immersionbar:3.0.0'
    /*Logger日志打印*/
    api 'com.orhanobut:logger:2.2.0'
    /*EventBus*/
    api 'org.greenrobot:eventbus:3.2.0'

    /*Coil图片加载库*/
    api 'io.coil-kt:coil:2.1.0'
    api("io.coil-kt:coil-gif:2.1.0")
    api("io.coil-kt:coil-svg:2.1.0")
    api("io.coil-kt:coil-video:2.1.0")

    /*Json解析包*/
    api 'com.google.code.gson:gson:2.8.9'

    /*google firebase bom*/
    api platform('com.google.firebase:firebase-bom:30.2.0')
    /*google firebase 分析*/
    api 'com.google.firebase:firebase-analytics-ktx'

    api 'com.google.firebase:firebase-crashlytics'
    /*google firebase config*/
    api 'com.google.firebase:firebase-config-ktx'

}