From 6170240ebc98e155105fc0e6934de276bb92d25d Mon Sep 17 00:00:00 2001 From: Yao Weijie Date: Thu, 30 May 2024 00:11:45 +0800 Subject: fix `xmake show --list=architectures` with `--json` option --- xmake/plugins/show/lists/architectures.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- cgit v1.3.1 From 119eedfb8520ffdf736eb27fa83df60bdebf5b00 Mon Sep 17 00:00:00 2001 From: Yao Weijie Date: Thu, 30 May 2024 20:58:13 +0800 Subject: fix: `xmake show --list=packages` import error --- xmake/plugins/show/lists/packages.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.3.1