plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-kapt'
    id 'kotlinx-serialization'
}

android {
    compileSdkVersion buildConfig.compileSdkVersion

    defaultConfig {
        applicationId "com.dylanc.longan.sample"
        minSdkVersion buildConfig.minSdkVersion
        targetSdkVersion buildConfig.targetSdkVersion
        versionCode buildConfig.versionCode
        versionName buildConfig.versionName

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        coreLibraryDesugaringEnabled = true
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
        freeCompilerArgs += "-Xskip-prerelease-check"
    }

    buildFeatures {
        viewBinding true
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")
    implementation project(path: ':longan')
    implementation project(path: ':longan-design')
    implementation "androidx.core:core-ktx:$coreVersion"
    implementation "androidx.appcompat:appcompat:$appcompatVersion"
    implementation "androidx.constraintlayout:constraintlayout:$constraintLayoutVersion"
    implementation "com.google.android.material:material:$materialVersion"
    implementation "com.github.DylanCaiCoding.ViewBindingKTX:viewbinding-ktx:$viewBindingKTXVersion"
    implementation "com.github.DylanCaiCoding.ViewBindingKTX:viewbinding-base:$viewBindingKTXVersion"
    implementation "com.github.bumptech.glide:glide:$glideVersion"
    implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$serializationVersion"

    testImplementation "junit:junit:$junitVersion"
    androidTestImplementation "androidx.test.ext:junit:$junitExtVersion"
    androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
}