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", "webview")
    }
}
android {
    compileSdkVersion 28


    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
        javaCompileOptions {
            annotationProcessorOptions {
                arguments = [AROUTER_MODULE_NAME: "webview"]
            }
        }

        ndk {
            abiFilters "arm64-v8a"
        }

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility = '1.8'
        targetCompatibility = '1.8'
    }
    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }

}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    kapt 'com.alibaba:arouter-compiler:1.2.2'
    api rootProject.ext.dependencies["ydl-user-router"]
    api fileTree(include: ['*.jar'], dir: 'libs')
    api 'com.tencent.tbs.tbssdk:sdk:43903'
    if (rootProject.ext.dev_mode) {
        //开发时使用
        api project(':ydl-platform')
        implementation modularPublication('com.ydl:m-user-api')
        implementation modularPublication('com.ydl:m-dynamic-api')
        implementation modularPublication('com.ydl:m-im-api')
    } else {
        //发布时使用
        compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
        compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
        compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
        api(rootProject.ext.dependencies["ydl-platform"]) {
            transitive = true
        }
    }
}

