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

rootProject.ext.artifact_id = 'common'
apply from: '../../publish.gradle'

android {
    compileSdkVersion build_versions.compileSdkVersion
    publishNonDefault true
    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }
    defaultConfig {
        minSdkVersion build_versions.minSdkVersion
        targetSdkVersion build_versions.targetSdkVersion
        versionCode rootProject.ext.android.versionCode
        versionName rootProject.ext.android.versionName

        manifestPlaceholders = [qqappid: "101923771"]

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

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    buildFeatures {
        viewBinding true
        dataBinding true
    }
    kapt {
        generateStubs = true
    }
    repositories {
        flatDir {
            dirs 'libs'
        }
    }
}

dependencies {
    // 注意高德地图jar引入需要其他组件可以使用，故而api
    api fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    // kotlin实现MVVM框架之使用DataBinding之unresolved reference: BR解决办法
    kapt "com.android.databinding:compiler:4.0.1"
    kapt 'com.github.bumptech.glide:compiler:4.12.0'
    api rootProject.ext.dependencies.publicImplementation
    compileOnly rootProject.ext.dependencies.privateImplementation
    testImplementation rootProject.ext.dependencies.testImplementation
    androidTestImplementation rootProject.ext.dependencies.androidTestImplementation
    api('com.yidian.android:CommonComponent:0.0.88') {
        exclude(group: 'com.yidian.android', module: 'NetworkImageLib')
    }
}