From 6ef0f9be8bb89a2c8cabd6d950ac104fbf3c88d5 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 8 Jan 2025 23:30:16 +0800 Subject: improve package name --- xmake/core/package/package.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'xmake/core/package/package.lua') diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index be736d2f0..502a0b0f8 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -90,7 +90,7 @@ function _instance:_memcache() return cache end --- get the package name +-- get the package name without namespace function _instance:name() return self._NAME end @@ -100,12 +100,22 @@ function _instance:namespace() return self._NAMESPACE end --- get the full name +-- get the full name (with namespace) function _instance:fullname() local namespace = self:namespace() return namespace and namespace .. "::" .. self:name() or self:name() end +-- get the display name (with namespace and ~label) +function _instance:displayname() + return self._DISPLAYNAME +end + +-- set the display name +function _instance:displayname_set(fullname) + self._DISPLAYNAME = displayname +end + -- get the type: package function _instance:type() return "package" @@ -1547,16 +1557,6 @@ function _instance:label() return requireinfo and requireinfo.label end --- get the display name -function _instance:displayname() - return self._DISPLAYNAME -end - --- set the display name -function _instance:displayname_set(displayname) - self._DISPLAYNAME = displayname -end - -- invalidate configs function _instance:_invalidate_configs() self._CONFIGS = nil -- cgit v1.3.1