apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-parcelize'

apply from: "$gradleHost/master/key.gradle"

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

    defaultConfig {
        applicationId "com.angcyo.dsladapter.demo"
        minSdk Integer.parseInt(M_SDK)
        targetSdk Integer.parseInt(T_SDK)

        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled true
            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 true
        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 {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //https://mvnrepository.com/artifact/androidx.appcompat/appcompat
    //api "androidx.appcompat:appcompat:1.5.1" //minCompileSdk (32)
    implementation "androidx.appcompat:appcompat:1.6.1"
    //https://mvnrepository.com/artifact/androidx.activity/activity-ktx
    implementation "androidx.activity:activity-ktx:1.7.2"
    //https://mvnrepository.com/artifact/androidx.constraintlayout/constraintlayout
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    //https://mvnrepository.com/artifact/com.google.android.material/material
    implementation 'com.google.android.material:material:1.6.1'
    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

    implementation project(':Adapter')

    //https://github.com/angcyo/DslAdapter
    //compileOnly 'com.github.angcyo:DslAdapter:4.0.0'

    //https://github.com/angcyo/DslItem
    implementation('com.github.angcyo:DslItem:2.1.0') {
        exclude module: 'DslAdapter'
    }
}
