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

android {
    namespace "dev.simple"

    defaultConfig {
        versionCode versions.dev_simple_versionCode
        versionName versions.dev_simple_versionName
        // DevSimple Module Version
        buildConfigField "int", "DevSimple_VersionCode", "${versions.dev_simple_versionCode}"
        buildConfigField "String", "DevSimple_Version", "\"${versions.dev_simple_versionName}\""
        // DevAssist Module Version
        buildConfigField "int", "DevAssist_VersionCode", "${versions.dev_assist_versionCode}"
        buildConfigField "String", "DevAssist_Version", "\"${versions.dev_assist_versionName}\""
        // DevEngine Module Version
        buildConfigField "int", "DevEngine_VersionCode", "${versions.dev_engine_versionCode}"
        buildConfigField "String", "DevEngine_Version", "\"${versions.dev_engine_versionName}\""
        // DevWidget Module Version
        buildConfigField "int", "DevWidget_VersionCode", "${versions.dev_widget_versionCode}"
        buildConfigField "String", "DevWidget_Version", "\"${versions.dev_widget_versionName}\""
        // DevRetrofit Module Version
        buildConfigField "int", "DevRetrofit_VersionCode", "${versions.dev_retrofit_versionCode}"
        buildConfigField "String", "DevRetrofit_Version", "\"${versions.dev_retrofit_versionName}\""
    }

    buildFeatures {
        // View Binding
        viewBinding = true
        // Data Binding
        dataBinding = true
    }
}

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

dependencies {
    if (isPublishing) {
        // 打包时使用
        api deps.dev.dev_assist
        api deps.dev.dev_base
        api deps.dev.dev_engine
        api deps.dev.dev_widget
        api deps.dev.dev_retrofit
    } else {
        // 编译时使用
        api project(':DevAssist')
        api project(':DevBase')
        api project(':DevEngine')
        api project(':DevWidget')
        api project(':DevRetrofit')
    }

    // ==============
    // = 常用开发组件 =
    // ==============

    // MVVM Adapter Binding https://github.com/evant/binding-collection-adapter
    api deps_lib.common_widget.binding_collection_adapter
    api deps_lib.common_widget.binding_collection_adapter_recyclerview
    api deps_lib.common_widget.binding_collection_adapter_viewpager2
}

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