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 {
//        Test {
//            buildConfigField "boolean", "LOG_DEBUG", "false"
//            buildConfigField "boolean", "USE_CANARY", "false"
//            minifyEnabled false
//            shrinkResources false
//            zipAlignEnabled false
//            proguardFiles 'proguard.cfg'
//        }

        debug {
            buildConfigField "boolean", "LOG_DEBUG", "true"
            buildConfigField "boolean", "USE_CANARY", "true"
            minifyEnabled false
            proguardFiles 'proguard.cfg'
        }
        release {
            buildConfigField "boolean", "LOG_DEBUG", "false"
            buildConfigField "boolean", "USE_CANARY", "false"
            minifyEnabled true
//            shrinkResources true
            zipAlignEnabled true
            proguardFiles 'proguard.cfg'
        }
    }
}


buildscript {
    repositories {
        jcenter()
    }
}


dependencies {
    //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["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'
    }
    implementation(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']
    //network
    api(rootProject.ext.dependencies["retrofit"]) {
        exclude module: 'okhttp'
        exclude module: 'okio'
    }
    implementation(rootProject.ext.dependencies["retrofit-converter-gson"]) {
        exclude module: 'gson'
        exclude module: 'okhttp'
        exclude module: 'okio'
        exclude module: 'retrofit'
    }
    implementation(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"]
    //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"]
}


//apply from: 'bintray.gradle'