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.android["compileSdkVersion"]
    buildToolsVersion rootProject.ext.android["buildToolsVersion"]

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

        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
        flavorDimensions "versionCode"

        ndk {
            abiFilters "arm64-v8a"
        }
        vectorDrawables.useSupportLibrary = true
    }

    lintOptions {
        abortOnError false
        disable 'MissingTranslation'
    }

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

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    sourceSets {
        main {
            res.srcDirs = [
                    'src/main/res/layouts/share',
                    'src/main/res/layouts/music_player',//课程音频播放器
                    'src/main/res/layouts/confideredpacket',
                    'src/main/res/layouts/couponhint',
                    'src/main/res/layouts/redpacket',
                    'src/main/res/layouts/swipe',
                    'src/main/res/layouts',
                    'src/main/res'
            ]
            jniLibs.srcDirs = ['src/main/jniLibs']
            java.srcDirs += 'src/main/kotlin'
        }
    }

}

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

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.2.0'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    //====================YDL Repository====================
//    api rootProject.ext.dependencies["ydl-pushagent"]
//    api rootProject.ext.dependencies["ydl-hnet"]
    implementation 'com.volcengine:apm_insight:1.4.6.cn'
    api(rootProject.ext.dependencies["ydl-notracepoint"]) {
        transitive = true
        exclude group: 'com.google.code.gson', module: 'gson'
        exclude group: 'com.squareup.okhttp3', module: 'okhttp3'
        exclude group: 'com.squareup.okhttp3', module: 'logging-interceptor'
    }

    api(rootProject.ext.dependencies["pictureselector"]) {
        exclude group: 'com.android.support', module: 'recyclerview-v7'
        exclude group: 'com.android.support', module: 'appcompat-v7'
        exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib'
        exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7'
        exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-common'
        exclude group: 'com.ydl', module: 'pictureselector'
    }

    api rootProject.ext.dependencies["ydl-utils"]
//    api project(':ydl-utils')
    api rootProject.ext.dependencies["ydl-js"]
    api rootProject.ext.dependencies["ydl-net"]
    api rootProject.ext.dependencies["ydl-js"]
    api rootProject.ext.dependencies["ptr-lib-release"]
    api(rootProject.ext.dependencies["ydl-device"]) {
        transitive = true
        exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib'
        exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7'
        exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-common'
    }
    api(rootProject.ext.dependencies["ydl-router"]) {
        transitive = true
    }
    api(rootProject.ext.dependencies["protector"]) {
        transitive = true
    }
    api(rootProject.ext.dependencies["blankUtil"]) {
        transitive = true
    }
    api(rootProject.ext.dependencies["ydl-image"]) {
        transitive = true
    }
    //====================Rx====================
    api rootProject.ext.dependencies["rxjava2"]
    api rootProject.ext.dependencies["rxpermissions2"]
    api rootProject.ext.dependencies["xxpermission"]
    api(rootProject.ext.dependencies["rxandroid2"]) {
        exclude module: 'rxjava'
    }
    api(rootProject.ext.dependencies["rxlifecycle2"]) {
        exclude module: 'rxjava'
        exclude module: 'jsr305'
    }
    api(rootProject.ext.dependencies["rxlifecycle2-android"]) {
        exclude module: 'support-annotations'
        exclude module: 'rxjava'
        exclude module: 'rxandroid'
        exclude module: 'rxlifecycle'
    }
    //====================View====================
    api rootProject.ext.dependencies["cardview-v7"]
    kapt rootProject.ext.dependencies["glide-compiler"]
    api rootProject.ext.dependencies["glide"]
    api rootProject.ext.dependencies["glide-transformations"]
    api rootProject.ext.dependencies["fresco"]
    api rootProject.ext.dependencies["fresco-animated-webp"]
    api rootProject.ext.dependencies["fresco-webpsupport"]
    api rootProject.ext.dependencies["constraint-layout"]
    api rootProject.ext.dependencies["cube"]
    api rootProject.ext.dependencies["support-multidex"]
    api rootProject.ext.dependencies["tablayout"]
    api rootProject.ext.dependencies["xrecyclerview"]
    api rootProject.ext.dependencies["mmkv"]
    api rootProject.ext.dependencies["flowlayout"]
    api rootProject.ext.dependencies["androidanimations"]
    //====================Tools====================
    api rootProject.ext.dependencies["robust"]
    api rootProject.ext.dependencies["walle"]
    api rootProject.ext.dependencies["jpush"]
    api rootProject.ext.dependencies["jcore"]
    api rootProject.ext.dependencies["eventbus"]
    api rootProject.ext.dependencies["umeng-common"]
    api rootProject.ext.dependencies["umeng-asms"]
    api rootProject.ext.dependencies["umeng-share-core"]
    api rootProject.ext.dependencies["umeng-share-qq"]
    api rootProject.ext.dependencies["umeng-share-wechat"]
    api rootProject.ext.dependencies["umeng-shareboard"]
    api rootProject.ext.dependencies["umeng-wx-guanfang"]
    api rootProject.ext.dependencies["umeng-qq-guanfang"]
    api rootProject.ext.dependencies["stetho"]
    api rootProject.ext.dependencies["stetho-okhttp3"]
    api rootProject.ext.dependencies["bugly-crashreport"]
    api rootProject.ext.dependencies["bugly-nativecrashreport"]
    api rootProject.ext.dependencies["arouter-api"]
    kapt rootProject.ext.dependencies["arouter-compiler"]
    implementation rootProject.ext.dependencies["free_reflection"]
//    debugImplementation rootProject.ext.dependencies["canary-debug"]
//    releaseImplementation rootProject.ext.dependencies["canary-release"]
}
