summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-05-31 08:34:22 +0800
committerGitHub <[email protected]>2024-05-31 08:34:22 +0800
commit9f510bf537c3b3eda6bf31e598aa4b9224b57d97 (patch)
tree736cc907b12608666231aab59c10ee0be4f4716b
parent9743a0c611c3d94ba85c9001b4377621dfec91e8 (diff)
parent119eedfb8520ffdf736eb27fa83df60bdebf5b00 (diff)
Merge pull request #5170 from yao-weijie/dev
fix `xmake show` issues
-rw-r--r--xmake/plugins/show/lists/architectures.lua10
-rw-r--r--xmake/plugins/show/lists/packages.lua2
2 files changed, 10 insertions, 2 deletions
diff --git a/xmake/plugins/show/lists/architectures.lua b/xmake/plugins/show/lists/architectures.lua
index 8eba152f2..0aecc6e1e 100644
--- a/xmake/plugins/show/lists/architectures.lua
+++ b/xmake/plugins/show/lists/architectures.lua
@@ -22,6 +22,8 @@
import("core.project.project")
import("core.platform.platform")
import("core.base.text")
+import("core.base.option")
+import(".showlist")
-- show all platforms
function main()
@@ -35,6 +37,7 @@ function main()
-- get all architectures
local result = {align = 'l', sep = " "}
+ local json_result = {}
for i, plat in ipairs(plats) do
local archs = try {function () return project.allowed_archs(plat) end}
if archs then
@@ -45,7 +48,12 @@ function main()
end
if archs and #archs > 0 then
table.insert(result, table.join(plat, archs))
+ json_result[plat] = archs
end
end
- print(text.table(result))
+ if option.get("json") then
+ showlist(json_result)
+ else
+ print(text.table(result))
+ end
end
diff --git a/xmake/plugins/show/lists/packages.lua b/xmake/plugins/show/lists/packages.lua
index 8c8f45c20..3aeedc0d2 100644
--- a/xmake/plugins/show/lists/packages.lua
+++ b/xmake/plugins/show/lists/packages.lua
@@ -20,7 +20,7 @@
-- imports
import("core.project.config")
-import("require.list", {rootdir = path.join(os.programdir(), "actions"), alias = "show_packages"})
+import("private.action.require.list", { alias = "show_packages" })
import(".showlist")
-- show all packages