diff options
| author | ruki <[email protected]> | 2024-11-26 22:43:06 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-11-26 22:43:06 +0800 |
| commit | c3c77df11b0a04302c7a08e69d6e9ae0208e5876 (patch) | |
| tree | dc17aa195d5ab9db92cab753e0c2d1f023a1082f | |
| parent | 2fef318fffae6d4638b27a4964484c2e50606137 (diff) | |
add installtips for package
| -rw-r--r-- | xmake/core/package/package.lua | 1 | ||||
| -rw-r--r-- | xmake/modules/private/action/require/impl/install_packages.lua | 18 |
2 files changed, 17 insertions, 2 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index d5fc901f1..39b01e51f 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -2788,6 +2788,7 @@ function package.apis() , "package.set_arch" -- deprecated , "package.set_base" , "package.set_license" + , "package.set_installtips" , "package.set_homepage" , "package.set_description" , "package.set_parallelize" diff --git a/xmake/modules/private/action/require/impl/install_packages.lua b/xmake/modules/private/action/require/impl/install_packages.lua index 303b300d9..ba1ccdbd8 100644 --- a/xmake/modules/private/action/require/impl/install_packages.lua +++ b/xmake/modules/private/action/require/impl/install_packages.lua @@ -217,12 +217,26 @@ function _get_confirm(packages, opt) local group = instance:group() if group and packages_group[group] and #packages_group[group] > 1 then for idx, package_in_group in ipairs(packages_group[group]) do - cprint(" ${yellow}%s${clear} %s %s ${dim}%s", idx == 1 and "->" or " or", package_in_group:displayname(), package_in_group:version_str() or "", package.get_configs_str(package_in_group)) + cprint(" ${yellow}%s${clear} %s %s ${dim}%s", idx == 1 and "->" or " or", + package_in_group:displayname(), package_in_group:version_str() or "", + package.get_configs_str(package_in_group)) + for _, tip in ipairs(package_in_group:get("installtips")) do + if idx == 1 then + cprint(" ${yellow}*${clear} %s", tip) + else + cprint(" ${yellow}*${clear} %s", tip) + end + end packages_showed[tostring(package_in_group)] = true end packages_group[group] = nil else - cprint(" ${yellow}->${clear} %s %s ${dim}%s", instance:displayname(), instance:version_str() or "", package.get_configs_str(instance)) + cprint(" ${yellow}->${clear} %s %s ${dim}%s", + instance:displayname(), instance:version_str() or "", + package.get_configs_str(instance)) + for _, tip in ipairs(instance:get("installtips")) do + cprint(" ${yellow}*${clear} %s", tip) + end packages_showed[tostring(instance)] = true end end |
