// ===============
// = 主程序 ( 壳 ) =
// ===============

include(":app")
project(":app").projectDir = new File(rootDir, "application/app")

// =======================
// = module - 各个模块 APP =
// =======================

def modules = [

        // 功能模板
        "module_template",

        // =============
        // = 各个功能模块 =
        // =============

        "module_splash",
        "module_main",
        "module_movie",
        "module_person",
        "module_tv",
]

modules.forEach {
    // module 文件夹路径 ( 美化 configurations name )
    File applicationModuleDir = new File(rootDir, "application/module")

    include(":$it")
    project(":$it").projectDir = new File(applicationModuleDir, "$it")
}

// ===================
// = core - 核心开发库 =
// ===================

def cores = [
        "core",
        "core_base_lib",
        "core_lib_base",
        "core_lib_base_split",
        "core_lib_bean",
        "core_lib_channel_flavors",
        "core_lib_config",
        "core_lib_debug_assist",
        "core_lib_engine",
        "core_lib_environment",
        "core_lib_language",
        "core_lib_mvvm",
        "core_lib_network",
        "core_lib_property",
        "core_lib_receiver",
        "core_lib_router",
        "core_lib_ui",
        "core_lib_ui_skin",
        "core_lib_upload",
        "core_lib_utils",
        "core_lib_web",
]

cores.forEach {
    include(":$it")
    // 属于 core/libs 模块
    if (it.startsWith("core_lib_")) {
        // 例 core/libs/lib_engine
        project(":$it").projectDir = new File(
                rootDir, "component/core/libs/" + it.replace("core_", "")
        )
    } else {
        project(":$it").projectDir = new File(rootDir, "component/core/$it")
    }
}

// ====================
// = libs - 模块封装复用 =
// ====================

def libs = [
        "lib_splash_ads",
        "lib_tmdb_ui",
]

libs.forEach {
    include(":$it")
    project(":$it").projectDir = new File(rootDir, "component/libs/$it")
}

// ========================
// = Interesting - 规范检测 =
// ========================

def interestings = [
        "DevReplace",
        "DevStandard",
]

interestings.forEach {
    include(":$it")
    project(":$it").projectDir = new File(rootDir, "interesting/$it")
}