ext.alwaysLib = true //虽然apply了cc-settings-2.gradle，但一直作为library编译，否则别的组件依赖此module时会报错
apply from: rootProject.file("cc-settings.gradle")

android {
    compileSdkVersion rootProject.ext.android["compileSdkVersion"]
    useLibrary 'org.apache.http.legacy'

    compileOptions {
        targetCompatibility JavaVersion.VERSION_1_8
        sourceCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        minSdkVersion rootProject.ext.android["minSdkVersion"]
        targetSdkVersion rootProject.ext.android["targetSdkVersion"]
        versionCode rootProject.ext.android["versionCode"]
        versionName rootProject.ext.android["versionName"]
    }
    buildTypes {
        debug {
            buildConfigField "boolean", "LOG_DEBUG", rootProject.ext.buildType["debugLogDebug"]
            buildConfigField "boolean", "USE_CANARY", rootProject.ext.buildType["debugUseCanary"]
            minifyEnabled false
            proguardFiles 'proguard.cfg'
        }
        release {
            buildConfigField "boolean", "LOG_DEBUG", rootProject.ext.buildType["releaseLogDebug"]
            buildConfigField "boolean", "USE_CANARY", rootProject.ext.buildType["releaseUseCanary"]
            minifyEnabled true
//            shrinkResources true
            zipAlignEnabled true
            proguardFiles 'proguard.cfg'
        }
    }
}


buildscript {
    repositories {
        jcenter()
    }
}


dependencies {
    //fragmentation
    api project(':library-fragmentation_core')
    //support
    api(rootProject.ext.dependencies["support-v4"]) {
        exclude module: 'support-annotations'
    }
    api(rootProject.ext.dependencies["appcompat-v7"]) {
        exclude module: 'support-annotations'
        exclude module: 'support-v4'
    }
    api(rootProject.ext.dependencies["design"]) {
        exclude module: 'support-annotations'
        exclude module: 'appcompat-v7'
        exclude module: 'support-v4'
    }
    api rootProject.ext.dependencies["support-design"]
    api rootProject.ext.dependencies["annotations"]
    //view
    api(rootProject.ext.dependencies["autolayout"]) {
        exclude group: 'com.android.support'
    }
    api(rootProject.ext.dependencies["butterknife"]) {
        exclude module: 'support-annotations'
    }
    //rx
    api rootProject.ext.dependencies["rxjava2"]
    api(rootProject.ext.dependencies["rxandroid2"]) {
        exclude module: 'rxjava'
    }
    api(rootProject.ext.dependencies["rxcache2"]) {
        exclude module: 'rxjava'
        exclude module: 'dagger'
    }
    api(rootProject.ext.dependencies["rxcache-jolyglot-gson"]) {
        exclude module: 'gson'
    }
    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'
    }
    api(rootProject.ext.dependencies["rxpermissions2"]) {
        exclude module: 'rxjava'
        exclude module: 'support-annotations'
    }
    api rootProject.ext.dependencies['rxerrorhandler2']
    api rootProject.ext.dependencies["rxbinding2"]
    //network
    api(rootProject.ext.dependencies["retrofit"]) {
        exclude module: 'okhttp'
        exclude module: 'okio'
    }
    api(rootProject.ext.dependencies["retrofit-converter-gson"]) {
        exclude module: 'gson'
        exclude module: 'okhttp'
        exclude module: 'okio'
        exclude module: 'retrofit'
    }
    api(rootProject.ext.dependencies["retrofit-adapter-rxjava2"]) {
        exclude module: 'rxjava'
        exclude module: 'okhttp'
        exclude module: 'retrofit'
        exclude module: 'okio'
    }
    api rootProject.ext.dependencies["okhttp3"]
    api(rootProject.ext.dependencies["glide"]) {
        exclude module: 'support-v4'
    }
    annotationProcessor(rootProject.ext.dependencies["glide-compiler"]) {
        exclude module: 'jsr305'
    }
    //tools
    compileOnly rootProject.ext.dependencies["javax.annotation"]
    api rootProject.ext.dependencies["dagger2"]
    annotationProcessor rootProject.ext.dependencies["dagger2-compiler"]
    api rootProject.ext.dependencies["androideventbus"]
    api rootProject.ext.dependencies["gson"]
    api rootProject.ext.dependencies["butterknife"]
    implementation rootProject.ext.dependencies["multidex"]

    implementation rootProject.ext.dependencies["recyclerview-v7"]
    implementation rootProject.ext.dependencies["cardview-v7"]

    //可長按拖動 側滑刪除的recyclerview
    api rootProject.ext.dependencies["yzjRecyclerView"]
    //test
    api rootProject.ext.dependencies["timber"]
    implementation rootProject.ext.dependencies["retrofit-url-manager"]
    //解决Glide找不到Android声明库问题
    annotationProcessor 'androidx.annotation:annotation:1.1.0'
    //    testApi rootProject.ext.dependencies["junit"]
    api rootProject.ext.dependencies["immersionbar-components"]
    api rootProject.ext.dependencies["immersionbar"]

}


//apply from: 'bintray.gradle'