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


android {
    compileSdkVersion rootProject.ext.android.compileSdkVersion
    defaultConfig {
        minSdkVersion rootProject.ext.android.minSdkVersion
        targetSdkVersion rootProject.ext.android.targetSdkVersion
        versionCode rootProject.ext.appInfo.versionCode
        versionName rootProject.ext.appInfo.versionName
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles 'consumer-rules.pro'

        javaCompileOptions {
            annotationProcessorOptions {
                arguments = [AROUTER_MODULE_NAME: project.getName()]
            }
        }
    }

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



    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    /*defaultConfig {
        configurations.all {
            resolutionStrategy {
                force 'androidx.appcompat:appcompat:1.1.0'
                force 'androidx.room:room-runtime:2.2.3'
                force 'com.squareup.okhttp3:okhttp:4.0.1'
                force 'androidx.annotation:annotation:1.1.0'
                force 'androidx.core:core:1.2.0'
                force 'androidx.fragment:fragment:1.2.0'
                force 'androidx.lifecycle:lifecycle-runtime:2.2.0'
                force 'androidx.arch.core:core-common:2.1.0'
                force 'androidx.arch.core:core-runtime:2.1.0'
                force 'androidx.lifecycle:lifecycle-common:2.2.0'
                force 'androidx.lifecycle:lifecycle-livedata:2.2.0'
                force 'androidx.lifecycle:lifecycle-viewmodel:2.2.0'
                force 'com.google.code.gson:gson:2.8.0'
                force 'com.squareup.okio:okio:2.2.2'
                force 'io.reactivex.rxjava2:rxjava:2.2.4'
                force 'androidx.versionedparcelable:versionedparcelable:1.1.0'
                force 'androidx.collection:collection:1.1.0'
                force 'androidx.vectordrawable:vectordrawable:1.1.0'
                force 'org.slf4j:slf4j-api:1.7.21'
                force 'org.jetbrains.kotlin:kotlin-stdlib:1.3.61'
                force 'org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61'
                force 'com.google.auto:auto-common:0.10'
                force 'com.squareup:javapoet:1.7.0'
                force 'com.google.guava:guava:27.1-jre'
                force 'io.reactivex.rxjava3:rxjava:3.0.0-RC0'
                failOnVersionConflict()
            }
        }
    }*/
}

greendao {
    schemaVersion 1 //数据库版本号,必须 >= 1
    daoPackage 'com.example.base.database.greendao.db'
// 设置DaoMaster、DaoSession、Dao 包名
    targetGenDir 'src/main/java'//设置DaoMaster、DaoSession、Dao目录
    generateTests false //设置为true以自动生成单元测试。
    targetGenDirTests 'src/main/java' //应存储生成的单元测试的基本目录。默认为 src / androidTest / java。
}

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



dependencies {
    api fileTree(dir: 'libs', include: ['*.jar'])
    api project(path: ':arouter')
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    // usually
    api rootProject.ext.dependencies["kotlin"]
    api rootProject.ext.dependencies["appcompat"]
    api rootProject.ext.dependencies["corektx"]
    api rootProject.ext.dependencies["anonotation"]

    api rootProject.ext.dependencies["multidex"]
    api rootProject.ext.dependencies["legacy"]
    api rootProject.ext.dependencies["vectordrawable"]
    api rootProject.ext.dependencies["lifecycleExtensions"]
    api rootProject.ext.dependencies["lifecycleViewModelKtx"]
    api rootProject.ext.dependencies["lifecycleRuntimeKtx"]
    //UI
    api rootProject.ext.dependencies["material"]
    api rootProject.ext.dependencies["recyclerview"]
    api rootProject.ext.dependencies["cardview"]
    api rootProject.ext.dependencies["constraint"]
//    api rootProject.ext.dependencies["baserecyclerview"]
    api rootProject.ext.dependencies["smart_refreshlayout"]
    api rootProject.ext.dependencies["smart_refreshlayout_class"]

    api rootProject.ext.dependencies["refreshlayout_h"]
    api rootProject.ext.dependencies["refreshlayout_l"]
//    api rootProject.ext.dependencies["PhotoView"]
    //media and player
    api rootProject.ext.dependencies["jiaozivideoplayer"]
    api rootProject.ext.dependencies["exoplayer"]
    api rootProject.ext.dependencies["jcodec_android"]
    api rootProject.ext.dependencies["videocache"]
    api rootProject.ext.dependencies["glide"]
    //database
    api rootProject.ext.dependencies["greendao"]
    api rootProject.ext.dependencies["greendaosql"]
    api rootProject.ext.dependencies["mqttv3"]
    api rootProject.ext.dependencies["mqttv3service"]
    api rootProject.ext.dependencies["roomRuntime"]
    api rootProject.ext.dependencies["roomKtx"]
    annotationProcessor rootProject.ext.dependencies["roomCompiler"]
    kapt rootProject.ext.dependencies["databinding"]

//    api rootProject.ext.dependencies["roomRxJava2"]

    //network
    api rootProject.ext.dependencies["retrofit"]
    api rootProject.ext.dependencies["retrofitConvertGson"]
    api rootProject.ext.dependencies["retrofitConverter"]
    api rootProject.ext.dependencies["okhttp"]
    api rootProject.ext.dependencies["logging_interceptor"]
    api rootProject.ext.dependencies["gson"]
    api rootProject.ext.dependencies["moshi"]
    api rootProject.ext.dependencies["moshi_adapter"]
    api rootProject.ext.dependencies["jsoup"]
    // injection and event
    api rootProject.ext.dependencies["butterknife"]
    annotationProcessor rootProject.ext.dependencies["butterknife_compiler"]
    api rootProject.ext.dependencies["dagger"]
    annotationProcessor rootProject.ext.dependencies["dagger_compiler"]
    api rootProject.ext.dependencies["rxjava3"]
    api rootProject.ext.dependencies["reactive_stream"]
//    api rootProject.ext.dependencies["arouter"]
    kapt  rootProject.ext.dependencies["aroutercompiler"]
    annotationProcessor rootProject.ext.dependencies["aroutercompiler"]
    // tools
    api rootProject.ext.dependencies["okdownload"]
    api rootProject.ext.dependencies["okdownload_sqlite"]
    api rootProject.ext.dependencies["zt_zip"]
    api rootProject.ext.dependencies["easypermissions"]
    debugImplementation rootProject.ext.dependencies["debug_db"]
    api rootProject.ext.dependencies["lottie"]
    api rootProject.ext.dependencies["logger"]

}
