summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-04-23 23:21:04 +0800
committerruki <[email protected]>2024-04-23 23:21:04 +0800
commitd00c884b8d6b71f8f232cbb5cd0e7186ad966df9 (patch)
treec84e743269b10c9a2d666b973899fa2d58f7d7fb
parent9f2d6865e1d85fbf5a4cf3f6bae1648be32cd5e3 (diff)
add project apis
-rw-r--r--xmake/core/sandbox/modules/import/core/project/project.lua1
-rw-r--r--xmake/plugins/show/lists/apis.lua16
2 files changed, 17 insertions, 0 deletions
diff --git a/xmake/core/sandbox/modules/import/core/project/project.lua b/xmake/core/sandbox/modules/import/core/project/project.lua
index b8feddefc..c197ff770 100644
--- a/xmake/core/sandbox/modules/import/core/project/project.lua
+++ b/xmake/core/sandbox/modules/import/core/project/project.lua
@@ -70,6 +70,7 @@ sandbox_core_project.policy = project.policy
sandbox_core_project.tmpdir = project.tmpdir
sandbox_core_project.tmpfile = project.tmpfile
sandbox_core_project.is_loaded = project.is_loaded
+sandbox_core_project.apis = project.apis
-- check project options
function sandbox_core_project.check_options()
diff --git a/xmake/plugins/show/lists/apis.lua b/xmake/plugins/show/lists/apis.lua
index 696b7133c..cfd243c63 100644
--- a/xmake/plugins/show/lists/apis.lua
+++ b/xmake/plugins/show/lists/apis.lua
@@ -22,11 +22,26 @@
import("core.project.config")
import("core.project.rule")
import("core.project.target")
+import("core.project.project")
import("core.project.option")
import("core.package.package")
import("core.tool.toolchain")
import(".showlist")
+-- get project scope apis
+function project_scope_apis()
+ local result = {}
+ for _, names in pairs(project.apis()) do
+ for _, name in ipairs(names) do
+ if type(name) == "table" then
+ name = name[1]
+ end
+ table.insert(result, name)
+ end
+ end
+ return result
+end
+
-- get target scope apis
function target_scope_apis()
local result = {}
@@ -149,6 +164,7 @@ end
-- get scope apis
function scope_apis()
local result = {}
+ table.join2(result, project_scope_apis())
table.join2(result, target_scope_apis())
table.join2(result, option_scope_apis())
table.join2(result, rule_scope_apis())