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

apply from: "../publish.gradle"

kapt {
    arguments {
        arg("AROUTER_MODULE_NAME", project.getName())
    }
}

android {
    compileSdkVersion rootProject.ext.android["compileSdkVersion"]
    buildToolsVersion rootProject.ext.android["buildToolsVersion"]

    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }

    defaultConfig {
        minSdkVersion rootProject.ext.android["minSdkVersion"]
        targetSdkVersion rootProject.ext.android["targetSdkVersion"]
        versionCode 1
        versionName "1.0"

        multiDexEnabled true
        flavorDimensions "versionCode"
        vectorDrawables.useSupportLibrary = true
    }

    lintOptions {
        abortOnError false
    }

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

    //Flavor 信息
    publishNonDefault true
    productFlavors {
        ydl {}
        xlzx {}
    }
    dataBinding {
        enabled true
    }
    sourceSets {
        main {
            res.srcDirs = ['src/main/res']
        }
    }
}

dependencies {
    api fileTree(dir: 'libs', include: ['*.jar', '*.aar'])

    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.fragment:fragment-ktx:1.2.4'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    api "com.airbnb.android:lottie:3.4.0"
    api(rootProject.ext.dependencies["ydl-device"])

    implementation "com.alibaba:arouter-api:$arouter_api"
    kapt "com.alibaba:arouter-compiler:$arouter_compiler"

    implementation rootProject.ext.dependencies["ydl-user-router"]

    implementation project(":api:consultant")
    implementation project(":api:user")
    implementation project(":api:tests")
    implementation project(":api:home")
    implementation project(":api:im")
    implementation project(':api:confide')
    implementation project(':ydl-webview')
    implementation project(':ydl-media')
    implementation project(":ydl-platform")
}
