From 6871f31ec3fe4cdc4199c57c86f8371752f4e75b Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 29 Oct 2025 23:23:00 +0800 Subject: improve batchcmds:show --- xmake/plugins/project/cmake/cmakelists.lua | 5 +++-- xmake/plugins/project/make/makefile.lua | 5 +++-- xmake/plugins/project/vstudio/impl/vs201x.lua | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'xmake/plugins') diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua index a4d8361e1..167d4bb5f 100644 --- a/xmake/plugins/project/cmake/cmakelists.lua +++ b/xmake/plugins/project/cmake/cmakelists.lua @@ -1222,8 +1222,9 @@ function _get_command_string(cmd, outputdir) return string.format("cd %s", _get_relative_unix_path_to_cmake(cmd.dir, outputdir)) elseif kind == "mkdir" then return string.format("${CMAKE_COMMAND} -E make_directory %s", _get_relative_unix_path_to_cmake(cmd.dir, outputdir)) - elseif kind == "show" then - local text = colors.ignore(cmd.showtext) + elseif kind == "show" or kind == "show_progress" then + local text = string.format(cmd.format, table.unpack(cmd.argv)) + text = colors.ignore(text) -- we need to translate paths in text -- https://github.com/xmake-io/xmake/issues/6553 if is_host("windows") then diff --git a/xmake/plugins/project/make/makefile.lua b/xmake/plugins/project/make/makefile.lua index 7e818164c..3128a1c96 100644 --- a/xmake/plugins/project/make/makefile.lua +++ b/xmake/plugins/project/make/makefile.lua @@ -267,8 +267,9 @@ function _get_command_string(cmd, outputdir) return _get_cmd_cd(_get_relative_unix_path(cmd.dir, outputdir)) elseif kind == "mkdir" then return _get_cmd_mkdir(_get_relative_unix_path(cmd.dir, outputdir)) - elseif kind == "show" then - return _get_cmd_echo(cmd.showtext) + elseif kind == "show" or kind == "show_progress" then + local text = string.format(cmd.format, table.unpack(cmd.argv)) + return _get_cmd_echo(text) end end diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua index 823787ab1..bc31acbbe 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x.lua @@ -118,8 +118,9 @@ function _get_command_string(cmd, vcxprojdir) elseif kind == "mkdir" then local dir = _translate_path(cmd.dir, vcxprojdir) return string.format("if not exist \"%s\" mkdir \"%s\"", dir, dir) - elseif kind == "show" then - return string.format("echo %s", colors.ignore(cmd.showtext)) + elseif kind == "show" or kind == "show_progress" then + local text = string.format(cmd.format, table.unpack(cmd.argv)) + return string.format("echo %s", colors.ignore(text)) end end -- cgit v1.3.1