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: 'com.jakewharton.butterknife'
apply plugin: 'kotlin-kapt'

android {
    compileSdkVersion rootProject.ext.android["compileSdkVersion"]

    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
            }
        }
    }

    compileOptions {
        targetCompatibility JavaVersion.VERSION_1_8
        sourceCompatibility JavaVersion.VERSION_1_8
    }

    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 false
            zipAlignEnabled false
            proguardFiles 'proguard.cfg'
        }
    }

    sourceSets {
        main {
            manifest.srcFile 'src/main/AndroidManifest.xml'
            java.srcDirs = ['src/main/java', 'src/main/aidl']
            resources.srcDirs = ['src/main/java']
            aidl.srcDirs = ['src/main/aidl']
            res.srcDirs = ['src/main/res']
            assets.srcDirs = ['src/main/assets']
        }
    }
}

////dokit 扩展
//dokitExt {
//    //通用设置
//    comm {
//        //地图经纬度开关
//        gpsSwitch true
//        //网络开关
//        networkSwitch true
//        //大图开关
//        bigImgSwitch true
//        //webView js 抓包
//        webViewSwitch true
//    }
//
//    slowMethod {
//        //调用栈模式配置
//        stackMethod {
//            //默认值为 5ms 小于该值的函数在调用栈中不显示
//            thresholdTime 5
//            //调用栈函数入口
//            enterMethods = ["com.didichuxing.doraemondemo.MainDebugActivity.test1"]
//            //黑名单 粒度最小到类 暂不支持到方法
//            methodBlacklist = ["com.facebook.drawee.backends.pipeline.Fresco"]
//        }
//        //普通模式配置
//        normalMethod {
//            //默认值为 500ms 小于该值的函数在运行时不会在控制台中被打印
//            thresholdTime 100
//            //需要针对函数插装的包名
//            packageNames = ["com.didichuxing.doraemondemo"]
//            //不需要针对函数插装的包名和类名
//            methodBlacklist = ["com.didichuxing.doraemondemo.dokit"]
//        }
//    }
//}


dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation files('libs/javabase64-1.2.jar')
    implementation files('libs/sun.misc.BASE64Decoder.jar')
    api files('libs/jcifs-1.3.19.jar')
    api files('libs/nexgon5lib.jar')
    api files('libs/ecracalib.jar')
    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 'androidx.viewpager2:viewpager2:1.0.0-alpha03'
    implementation files('libs\\ecracalib.jar')
    testImplementation rootProject.ext.dependencies["junit"]
    debugImplementation rootProject.ext.dependencies["canary-debug"]
    releaseImplementation rootProject.ext.dependencies["canary-release"]
    testImplementation rootProject.ext.dependencies["canary-release"]
    kapt rootProject.ext.dependencies["dagger2-compiler"]
    kapt rootProject.ext.dependencies["butterknife-compiler"]
    api rootProject.ext.dependencies["BaseRecyclerViewAdapter"]
    implementation rootProject.ext.dependencies["fastjson"]
    implementation rootProject.ext.dependencies["progressmanager"]
    implementation rootProject.ext.dependencies["autosize"]
    // test
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.gcssloop.recyclerview:pagerlayoutmanager:2.3.8'
    //商米打印庫
    api 'com.sunmi:printerlibrary:1.0.7'
    //扫码
    api 'cn.bingoogolapple:bga-qrcode-zxing:1.3.7'
    //加载反馈页管理
    api rootProject.ext.dependencies["loadsir"]
    //rxjava,rxbinding相關工具類
    api 'com.github.xuexiangjys:RxUtil2:1.1.5'
    //滴滴開源 哆啦A夢:辅助开发工具、测试效率工具、视觉辅助工具
    debugImplementation 'com.didichuxing.doraemonkit:dokitx:3.3.3'
    releaseImplementation 'com.didichuxing.doraemonkit:dokitx-no-op:3.3.3'
    //美團金剛狼日誌框架
    implementation rootProject.ext.dependencies['logan']
    //上下拉刷新
    api 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0'
    //时间选择器
    api rootProject.ext.dependencies["pickerview"]

//    implementation 'com.github.gzu-liyujiang:Android_CN_OAID:版本号'
    // 用于生成Java文件的库
//    implementation 'com.squareup:javapoet:1.13.0'
//    implementation 'com.google.auto.service:auto-service:1.0-rc6'
//    annotationProcessor 'com.google.auto.service:auto-service:1.0-rc6'

    api rootProject.ext.dependencies["permissionx"]
    api rootProject.ext.dependencies["design"]
    api rootProject.ext.dependencies["appcompat-v7"]

    api 'cn.bingoogolapple:bga-photopicker:2.0.2@aar'
    api 'cn.bingoogolapple:bga-flowlayout:1.0.0@aar'
    api 'cn.bingoogolapple:bga-baseadapter:2.0.0@aar'
    api 'pub.devrel:easypermissions:0.4.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'

    implementation 'cn.onestravel.one:one_bottom_navigationbar:1.1.1'

    api 'androidx.core:core-ktx:+'
    api 'com.github.huangyanbin:SmartTable:2.2.0'
    implementation 'com.lxj:xpopup:2.2.10'
    implementation "androidx.documentfile:documentfile:1.0.1"
}
repositories {
    mavenCentral()
}
