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

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"]
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles 'consumer-rules.pro'
        multiDexEnabled true
        //配置注解处理器
        javaCompileOptions {
            annotationProcessorOptions {
                includeCompileClasspath true
            }
        }
    }
//    viewBinding {
//        enabled = true
//    }
    buildTypes {
        debug {
            buildConfigField "boolean", "LOG_DEBUG", rootProject.ext.buildType["debugLogDebug"]
            buildConfigField "boolean", "USE_CANARY", rootProject.ext.buildType["debugUseCanary"]
            minifyEnabled false
            proguardFiles 'proguard-rules.pro'
        }
        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-rules.pro'
        }
    }
}


buildscript {
    repositories {
        jcenter()
    }
}


dependencies {
    if (project.ext.runAsApp) {
        annotationProcessor rootProject.ext.dependencies["dagger2-compiler"]
        debugImplementation rootProject.ext.dependencies["canary-debug"]
        releaseImplementation rootProject.ext.dependencies["canary-release"]
        testImplementation rootProject.ext.dependencies["canary-release"]
    } else {
        compileOnly rootProject.ext.dependencies["dagger2-compiler"]
        compileOnly rootProject.ext.dependencies["canary-debug"]
        compileOnly rootProject.ext.dependencies["canary-release"]
        compileOnly rootProject.ext.dependencies["canary-release"]
    }
    api rootProject.ext.dependencies["butterknife"]
    kapt rootProject.ext.dependencies["butterknife-compiler"]
    api rootProject.ext.dependencies["xpopup"]
    api rootProject.ext.dependencies["coordinatorlayout"]
    //多功能輸入框
    api 'com.rengwuxian.materialedittext:library:2.1.4'
    //底部功能導航view
    api 'com.github.ittianyu:BottomNavigationViewEx:2.0.4'
    //RecyclerView 流式佈局layoutManager
    api 'com.google.android:flexbox:1.0.0'
    //陰影背景
    api 'com.github.lihangleo2:ShadowLayout:2.1.6'
    //lottie
    api rootProject.ext.dependencies["lottie"]
    // loadingView
    api rootProject.ext.dependencies["loadingIndicatorView"]
}
