plugins {
    id 'com.android.library'
    id 'kotlin-android'
    id 'com.github.jk1.dependency-license-report'
    id 'org.jetbrains.kotlin.plugin.compose'
}

android {
    compileSdk rootProject.ext.compileSdkVersion

    namespace = "com.zhangke.notionlib"

    defaultConfig {
        minSdk rootProject.ext.minSdkVersion
        targetSdk rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"

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

        Properties properties = new Properties()
        properties.load(project.rootProject.file('local.properties').newDataInputStream())
        buildConfigField "String", "CLIENT_ID", "\"${properties.getProperty('notion_client_id')}\""
        buildConfigField "String", "AUTHORIZATION", "\"${properties.getProperty('notion_authorization')}\""
    }

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

    buildFeatures {
        compose = true
        buildConfig = true
    }

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

    kotlinOptions {
        jvmTarget = "17"
    }
}

dependencies {

    implementation project(path: ':framework')

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

    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 support.appcompat
    implementation support.'activity-compose'
    implementation support.core
    implementation support.'core-ktx'
    implementation support.collection
    implementation support.'collection-ktx'
    implementation support.datastore
    implementation support.'datastore-preferences'

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

    implementation thirdparty.retrofit
    implementation thirdparty.gson
    implementation thirdparty.rxjava3
    implementation thirdparty.rxandroid3
}