summaryrefslogtreecommitdiff
path: root/xmake/plugins/project/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2026-06-18 22:54:54 +0800
committerruki <[email protected]>2026-06-18 22:54:54 +0800
commit849606b78fe250ed3315fb65a085ca6c860ddcaf (patch)
tree2b49c22a80d475f258a59b73fb3533f0f4f353d7 /xmake/plugins/project/xmake.lua
parent9b8df1e3c6bf7aa841c3c62f8f80d5016690367b (diff)
format menus
Diffstat (limited to 'xmake/plugins/project/xmake.lua')
-rw-r--r--xmake/plugins/project/xmake.lua86
1 files changed, 35 insertions, 51 deletions
diff --git a/xmake/plugins/project/xmake.lua b/xmake/plugins/project/xmake.lua
index 15333d58b..ed5b35d9f 100644
--- a/xmake/plugins/project/xmake.lua
+++ b/xmake/plugins/project/xmake.lua
@@ -18,59 +18,43 @@
-- @file xmake.lua
--
--- define task
task("project")
-
- -- set category
set_category("plugin")
-
- -- on run
on_run("main")
-
- -- set menu
set_menu {
- -- usage
- usage = "xmake project [options] [outputdir]"
-
- -- description
- , description = "Generate the project file."
-
- -- options
- , options =
- {
- {'k', "kind", "kv" , "makefile", "Set the project kind."
- , " - make"
- , " - xmakefile (makefile with xmake)"
- , " - cmake"
- , " - ninja"
- , " - xcode"
- , " - compile_flags"
- , " - compile_commands (clang compilation database with json format)"
- , " - vs (auto detect), vs2002 - vs2026"
- , " - vsxmake (auto detect), vsxmake2010 ~ vsxmake2026"
- , values = function (complete, opt)
- if not complete then return end
-
- local values = table.keys(import("main.makers")())
- table.sort(values, function (a, b) return a > b end)
- return values
- end }
- , {'m', "modes", "kv" , nil , "Set the project modes."
- , " e.g. "
- , " - xmake project -k vsxmake -m \"release,debug\"" }
- , {'a', "archs", "kv" , nil , "Set the project archs."
- , " e.g. "
- , " - xmake project -k vsxmake -a \"x86,x64\"" }
- , {'t', "target", "kv" , nil , "Set the project target."
- , " e.g. "
- , " - xmake project -k compile_commands -t \"custom\"" }
- , {nil, "lsp", "kv" , nil , "Set the LSP backend for compile_commands."
- , " e.g. "
- , " - xmake project -k compile_commands --lsp=clangd"
- , values = {"clangd", "cpptools", "ccls"}}
- , {nil, "outputdir", "v" , "." , "Set the output directory." }
- }
- }
-
-
+ usage = "xmake project [options] [outputdir]",
+ description = "Generate the project file.",
+ options = {
+ {'k', "kind", "kv", "makefile", "Set the project kind.",
+ " - make",
+ " - xmakefile (makefile with xmake)",
+ " - cmake",
+ " - ninja",
+ " - xcode",
+ " - compile_flags",
+ " - compile_commands (clang compilation database with json format)",
+ " - vs (auto detect), vs2002 - vs2026",
+ " - vsxmake (auto detect), vsxmake2010 ~ vsxmake2026",
+ values = function (complete, opt)
+ if not complete then return end
+ local values = table.keys(import("main.makers")())
+ table.sort(values, function (a, b) return a > b end)
+ return values
+ end},
+ {'m', "modes", "kv", nil, "Set the project modes.",
+ " e.g. ",
+ " - xmake project -k vsxmake -m \"release,debug\""},
+ {'a', "archs", "kv", nil, "Set the project archs.",
+ " e.g. ",
+ " - xmake project -k vsxmake -a \"x86,x64\""},
+ {'t', "target", "kv", nil, "Set the project target.",
+ " e.g. ",
+ " - xmake project -k compile_commands -t \"custom\""},
+ {nil, "lsp", "kv", nil, "Set the LSP backend for compile_commands.",
+ " e.g. ",
+ " - xmake project -k compile_commands --lsp=clangd",
+ values = {"clangd", "cpptools", "ccls"}},
+ {nil, "outputdir", "v", ".", "Set the output directory."}
+ }
+ }