apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from : '../maven_push.gradle'

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

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion


    defaultConfig {
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion

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

        flavorDimensions "versionCode"
    }

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

            buildConfigField "String", "AGORA_APPID", '"13b1536698f64905a1e7e5bb978ba821"'
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

            buildConfigField "String", "AGORA_APPID", '"3387e9b251f3491e9221a9877e8f7830"'
        }
    }
    dataBinding {
        enabled true
    }

    //设置JDK1.8
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'

    implementation 'com.daimajia.androidanimations:library:2.3@aar'
    api 'fr.tvbarthel.blurdialogfragment:lib:2.1.5'
    api "com.alibaba:arouter-api:$arouter_api"
    api 'com.tencent.tbs.tbssdk:sdk:43903'
//    注意此处的依赖方式：kotlin中使用和java中使用方式有不同
    kapt "com.alibaba:arouter-compiler:$arouter_compiler"
    implementation 'com.alibaba:fastjson:1.2.38'
    implementation "com.ydl:jjdxm-ijkplayer:0.0.33"

    api rootProject.ext.dependencies["ydl-user-router"]
    if (rootProject.ext.dev_mode){
        //开发时使用
        api project(':ydl-media')
        api project(':ydl-platform')
        api project(':m-audioim')
        api project(":ydl-pay")
        api project(':ydl-webview')
        api project(':ydl-utils')
        implementation project(":api:im")
        implementation project(":api:user")
        implementation project(":api:consultant")
        implementation project(':api:confide')
    }else {
        //发布时使用
        api rootProject.ext.dependencies["ydl-media"]
        api rootProject.ext.dependencies["m-audioim"]
        api rootProject.ext.dependencies["ydl-pay"]
        api rootProject.ext.dependencies["ydl-webview"]
        api(rootProject.ext.dependencies["ydl-platform"]) {
            transitive = true
        }
        compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
        compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
        compileOnly rootProject.ext.dependencies["ydl-m-confide-api"]
        compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"]
    }
}
