apply from: rootProject.file(files.lib_app_gradle)
apply plugin: 'kotlin-kapt'

android {
    namespace "dev.engine"

    defaultConfig {
        versionCode versions.dev_engine_versionCode
        versionName versions.dev_engine_versionName
        // DevEngine Module Version
        buildConfigField "int", "DevEngine_VersionCode", "${versions.dev_engine_versionCode}"
        buildConfigField "String", "DevEngine_Version", "\"${versions.dev_engine_versionName}\""
        // DevAssist Module Version
        buildConfigField "int", "DevAssist_VersionCode", "${versions.dev_assist_versionCode}"
        buildConfigField "String", "DevAssist_Version", "\"${versions.dev_assist_versionName}\""
    }
}

// 是否发布版本
def isPublishing = false

dependencies {

    // ===================
    // = Engine 具体实现库 =
    // ===================

    // Glide 图片加载框架 https://github.com/bumptech/glide
    api deps_lib.common.glide
    kapt deps_lib.common.glide_compiler
    // 基于 mmap 的高性能通用 key-value 组件 https://github.com/Tencent/MMKV/blob/master/README_CN.md
    api deps_lib.common.mmkv
    // XXPermissions 权限请求框架 https://github.com/getActivity/XXPermissions
    api deps_lib.common.xxPermissions
    // Gson https://github.com/google/gson
    api deps_lib.common.gson
    // Fastjson2 https://github.com/alibaba/fastjson2
    api deps_lib.common.fastjson2_android
    // Toaster 吐司框架 https://github.com/getActivity/Toaster
    api deps_lib.common_widget.toaster
    // Luban 鲁班图片压缩 https://github.com/Curzibn/Luban
    api deps_lib.image_widget.luban
    // Android 平台下的图片选择器 https://github.com/LuckSiege/PictureSelector
    api deps_lib.image_widget.pictureSelector
    // 二维码 ZXing https://github.com/zxing/zxing
    api deps_lib.feature_lib.zxing_code
    // 设备兼容框架 https://github.com/getActivity/DeviceCompat
    api deps_lib.common.deviceCompat

    // =============
    // = DevEngine =
    // =============

    if (isPublishing) {
        // 打包时使用
        api deps.dev.dev_assist
    } else {
        // 编译时使用
        api project(':DevAssist')
    }
}

// tasks-build-assemble
// publishing-publishReleasePublicationToXXXXXRepository
if (isPublishing) {
    apply from: rootProject.file(files.sonatype_upload_android)
}