apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
    compileSdk Integer.parseInt(C_SDK)
    if (project.android.hasProperty("namespace")) namespace 'com.angcyo.dsladapter'

    defaultConfig {
        minSdk Integer.parseInt(M_SDK)
        targetSdk Integer.parseInt(T_SDK)
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    //https://developer.android.google.cn/topic/libraries/data-binding/start
    /*dataBinding {
        enabled = false
    }*/

    //https://developer.android.google.cn/topic/libraries/view-binding
    /*viewBinding {
        enabled = true
    }*/

    buildFeatures {
        //https://developer.android.google.cn/studio/releases/gradle-plugin/4.0.0#viewbinding-support
        viewBinding false
        dataBinding false
    }

    lintOptions {
        checkReleaseBuilds false
        abortOnError false
        //https://www.jianshu.com/p/93678f8b3421
        disable 'GoogleAppIndexingWarning'
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    // For Kotlin projects https://developer.android.com/studio/write/java8-support.html
    /*kotlinOptions { jvmTarget = "1.8" }*/
    kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8 }
}

dependencies {
    //https://mvnrepository.com/artifact/androidx.recyclerview/recyclerview
    implementation 'androidx.recyclerview:recyclerview:1.4.0'

    //https://mvnrepository.com/artifact/androidx.lifecycle/lifecycle-runtime-ktx
    def lifecycle_version = "2.9.1"
    implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"

    //https://mvnrepository.com/artifact/androidx.constraintlayout/constraintlayout
    compileOnly 'androidx.constraintlayout:constraintlayout:2.2.1'

    //https://mvnrepository.com/artifact/androidx.fragment
    //https://mvnrepository.com/artifact/androidx.fragment/fragment
    compileOnly "androidx.fragment:fragment-ktx:1.8.8"
}
