apply from: rootProject.file(files.lib_app_gradle)

android {
    namespace "dev.base"

    defaultConfig {
        versionCode versions.dev_base_versionCode
        versionName versions.dev_base_versionName
        // DevBase Module Version
        buildConfigField "int", "DevBase_VersionCode", "${versions.dev_base_versionCode}"
        buildConfigField "String", "DevBase_Version", "\"${versions.dev_base_versionName}\""
        // DevApp Module Version
        buildConfigField "int", "DevApp_VersionCode", "${versions.dev_app_versionCode}"
        buildConfigField "String", "DevApp_Version", "\"${versions.dev_app_versionName}\""
    }

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

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

dependencies {
    api deps.androidx.design
    api deps.androidx.appcompat
    api deps.kotlin.activity
    api deps.kotlin.fragment
    api deps.kotlin.stdlib
    api deps.kotlin.core
    api deps.kotlin.coroutines
    api deps.kotlin.lifecycle_runtime
    api deps.kotlin.lifecycle_common_java8
    api deps.kotlin.lifecycle_viewmodel
    api deps.kotlin.lifecycle_livedata
    api deps.kotlin.lifecycle_viewmodel_savedstate

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

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