plugins {
    id 'com.android.library'
    id 'kotlin-android'
}

android {
    compileSdkVersion buildConfig.compileSdkVersion

    defaultConfig {
        minSdkVersion buildConfig.minSdkVersion

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

    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 += ['-module-name', "longan"]
        freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
        freeCompilerArgs += "-Xcontext-receivers"
        freeCompilerArgs += "-Xskip-prerelease-check"
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")
    implementation "androidx.startup:startup-runtime:$starupVersion"
    implementation "androidx.fragment:fragment-ktx:$fragmentVersion"
    implementation "androidx.core:core-ktx:$coreVersion"
    implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion"
    implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion"
    implementation "com.squareup.okio:okio:$okioVersion"

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