plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-kapt'
    id 'com.github.jk1.dependency-license-report'
    id 'com.google.gms.google-services'
    id 'com.google.firebase.crashlytics'
    id 'org.jetbrains.kotlin.plugin.compose'
}

android {
    compileSdk rootProject.ext.compileSdkVersion

    namespace = "com.zhangke.notionlight"

    defaultConfig {
        applicationId "com.zhangke.notionlight"
        minSdk rootProject.ext.minSdkVersion
        targetSdk rootProject.ext.targetSdkVersion
        versionCode 12000
        versionName "1.2.0"
        multiDexEnabled = true

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = '17'
    }

    buildFeatures {
        compose = true
    }

    bundle {
        language {
            enableSplit = false
        }
    }

    composeOptions {
        kotlinCompilerExtensionVersion = rootProject.ext.compose_version
        kotlinCompilerVersion = rootProject.ext.kotlin_version
    }

    applicationVariants.all { variant ->
        variant.outputs.all {
            def flavor = variant.name
            def versionName = variant.versionName
            outputFileName = "notionlight_${flavor}_${versionName}.apk"
        }
    }
}

dependencies {
    implementation project(path: ':framework')
    implementation project(path: ':notionlib')

    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

    // Import the Firebase BoM
    implementation platform('com.google.firebase:firebase-bom:34.1.0')
    // Add the dependency for the Firebase SDK for Google Analytics
    // When using the BoM, don't specify versions in Firebase dependencies
    implementation("com.google.firebase:firebase-analytics")

    implementation compose.material3
    implementation compose.ui
    implementation compose.'ui-tooling'
    implementation compose.'ui-util'
    implementation compose.'ui-viewbinding'
    implementation compose.runtime
    implementation compose.material
    implementation compose.'material-icons-core'
    implementation compose.'material-icons-extended'
    implementation compose.foundation
    implementation compose.'foundation-layout'
    implementation compose.'runtime-livedata'
    implementation compose.'constraintlayout-compose'

    implementation support.appcompat
    implementation support.fragment
    implementation support.'fragment-ktx'
    implementation support.material
    implementation support.'activity-compose'
    implementation support.core
    implementation support.'core-ktx'
    implementation support.collection
    implementation support.'collection-ktx'
    implementation support.multidex
    implementation support.'datastore-preferences'
    implementation support.datastore
    implementation support.room
    implementation support.'room-ktx'
    kapt           support.'room-compiler'

    implementation arch.lifecycle.'viewmodel-ktx'
    implementation arch.lifecycle.'viewmodel-compose'
    implementation arch.lifecycle.'livedata-ktx'
    implementation arch.lifecycle.'viewmodel-savedstate'
    kapt           arch.lifecycle.compiler
    implementation arch.lifecycle.'common-java8'
    implementation arch.lifecycle.process
    implementation arch.lifecycle.'reactivestreams-ktx'

    implementation kotlin_libs.stdlib
    implementation coroutine.core
    implementation coroutine.android

    implementation thirdparty.retrofit
    implementation thirdparty.gson
    implementation thirdparty.rxjava3
    implementation thirdparty.rxandroid3
    implementation thirdparty.swiperefresh
    implementation thirdparty.coil
    implementation thirdparty.'coil-compose'
    implementation thirdparty.'coil-gif'

}