diff options
| author | ruki <[email protected]> | 2022-10-19 22:37:25 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-10-19 22:37:25 +0800 |
| commit | b72444bdd60a6ce90cd899743b0b304dc3159f11 (patch) | |
| tree | 7e589ff3da7b9aa8692290d8fb2b3796f419886f /xmake/modules | |
| parent | f55de1eb50c29fc58bbaef1bc387035a8deabe6e (diff) | |
use private components
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/private/action/require/impl/register_packages.lua | 10 | ||||
| -rw-r--r-- | xmake/modules/private/action/require/info.lua | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/xmake/modules/private/action/require/impl/register_packages.lua b/xmake/modules/private/action/require/impl/register_packages.lua index a6247cc9a..2ff643d61 100644 --- a/xmake/modules/private/action/require/impl/register_packages.lua +++ b/xmake/modules/private/action/require/impl/register_packages.lua @@ -59,14 +59,14 @@ function _register_required_package_libs(instance, required_package, is_deps) -- save components list if components then required_package:set("__components_list", instance:get("components")) - local components_default = {} + local components_private = {} for _, comp in ipairs(instance:get("components")) do - if instance:extraconf("components", comp, "default") then - table.insert(components_default, comp) + if instance:extraconf("components", comp, "private") then + table.insert(components_private, comp) end end - if #components_default > 0 then - required_package:set("__components_default", components_default) + if #components_private > 0 then + required_package:set("__components_private", components_private) end end diff --git a/xmake/modules/private/action/require/info.lua b/xmake/modules/private/action/require/info.lua index 3bc8123e5..31a91c891 100644 --- a/xmake/modules/private/action/require/info.lua +++ b/xmake/modules/private/action/require/info.lua @@ -249,7 +249,15 @@ function main(requires_raw) -- show components local components = instance:get("components") if components then - cprint(" -> ${color.dump.string_quote}components${clear}: %s", table.concat(table.wrap(components), ", ")) + cprint(" -> ${color.dump.string_quote}components${clear}: ") + for _, comp in ipairs(components) do + cprintf(" -> ${cyan}%s${clear}: ", comp) + if instance:extraconf("components", comp, "private") then + print("(private)") + else + print("(public)") + end + end end -- show references |
