summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-03-01 14:05:42 +0800
committerruki <[email protected]>2020-03-01 14:05:42 +0800
commit8399236ed894f10f58570b91af8e8a501cd2453d (patch)
tree5a1d6b297fc3be45ec5b1dec3c55fae3d3070fb6
parentab89db832e169bc6727b2ad8f5c1b6d34651269c (diff)
improve to show progress
-rw-r--r--xmake/actions/build/kinds/binary.lua8
-rw-r--r--xmake/actions/build/kinds/shared.lua6
-rw-r--r--xmake/actions/build/kinds/static.lua6
-rw-r--r--xmake/core/base/colors.lua4
-rw-r--r--xmake/modules/private/action/build/object.lua6
5 files changed, 15 insertions, 15 deletions
diff --git a/xmake/actions/build/kinds/binary.lua b/xmake/actions/build/kinds/binary.lua
index 97e4d14e8..13ad6e153 100644
--- a/xmake/actions/build/kinds/binary.lua
+++ b/xmake/actions/build/kinds/binary.lua
@@ -70,12 +70,12 @@ function _do_link_target(target, opt)
-- is verbose?
local verbose = option.get("verbose")
- -- trace progress into
- cprintf("${color.build.progress}" .. theme.get("text.build.progress_format") .. ":${clear} ", opt.progress.stop)
+ -- trace progress info
+ local progress_prefix = "${color.build.progress}" .. theme.get("text.build.progress_format") .. ":${clear} "
if verbose then
- cprint("${dim color.build.target}linking.$(mode) %s", path.filename(targetfile))
+ cprint(progress_prefix .. "${dim color.build.target}linking.$(mode) %s", opt.progress.stop, path.filename(targetfile))
else
- cprint("${color.build.target}linking.$(mode) %s", path.filename(targetfile))
+ cprint(progress_prefix .. "${color.build.target}linking.$(mode) %s", opt.progress.stop, path.filename(targetfile))
end
-- trace verbose info
diff --git a/xmake/actions/build/kinds/shared.lua b/xmake/actions/build/kinds/shared.lua
index 31f97a51a..9ad2541db 100644
--- a/xmake/actions/build/kinds/shared.lua
+++ b/xmake/actions/build/kinds/shared.lua
@@ -84,11 +84,11 @@ function _do_link_target(target, opt)
local verbose = option.get("verbose")
-- trace progress info
- cprintf("${color.build.progress}" .. theme.get("text.build.progress_format") .. ":${clear} ", opt.progress.stop)
+ local progress_prefix = "${color.build.progress}" .. theme.get("text.build.progress_format") .. ":${clear} "
if verbose then
- cprint("${dim color.build.target}linking.$(mode) %s", path.filename(targetfile))
+ cprint(progress_prefix .. "${dim color.build.target}linking.$(mode) %s", opt.progress.stop, path.filename(targetfile))
else
- cprint("${color.build.target}linking.$(mode) %s", path.filename(targetfile))
+ cprint(progress_prefix .. "${color.build.target}linking.$(mode) %s", opt.progress.stop, path.filename(targetfile))
end
-- trace verbose info
diff --git a/xmake/actions/build/kinds/static.lua b/xmake/actions/build/kinds/static.lua
index 42481d3ec..6c0a9a2f8 100644
--- a/xmake/actions/build/kinds/static.lua
+++ b/xmake/actions/build/kinds/static.lua
@@ -80,11 +80,11 @@ function _do_link_target(target, opt)
local verbose = option.get("verbose")
-- trace progress info
- cprintf("${color.build.progress}" .. theme.get("text.build.progress_format") .. ":${clear} ", opt.progress.stop)
+ local progress_prefix = "${color.build.progress}" .. theme.get("text.build.progress_format") .. ":${clear} "
if verbose then
- cprint("${dim color.build.target}archiving.$(mode) %s", path.filename(targetfile))
+ cprint(progress_prefix .. "${dim color.build.target}archiving.$(mode) %s", opt.progress.stop, path.filename(targetfile))
else
- cprint("${color.build.target}archiving.$(mode) %s", path.filename(targetfile))
+ cprint(progress_prefix .. "${color.build.target}archiving.$(mode) %s", opt.progress.stop, path.filename(targetfile))
end
-- trace verbose info
diff --git a/xmake/core/base/colors.lua b/xmake/core/base/colors.lua
index 4071f636f..2781de044 100644
--- a/xmake/core/base/colors.lua
+++ b/xmake/core/base/colors.lua
@@ -349,7 +349,7 @@ function colors.translate(str, opt)
end
-- split words
- local blocks_raw = word:split("%s")
+ local blocks_raw = word:split(' ', {plain = true})
-- translate theme color first, e.g ${color.error}
local blocks = {}
@@ -357,7 +357,7 @@ function colors.translate(str, opt)
if theme then
local theme_block = theme:get(block)
if theme_block then
- for _, theme_block_sub in ipairs(theme_block:split("%s")) do
+ for _, theme_block_sub in ipairs(theme_block:split(' ', {plain = true})) do
table.insert(blocks, theme_block_sub)
end
else
diff --git a/xmake/modules/private/action/build/object.lua b/xmake/modules/private/action/build/object.lua
index 27aedb527..c9dc5cbc8 100644
--- a/xmake/modules/private/action/build/object.lua
+++ b/xmake/modules/private/action/build/object.lua
@@ -58,11 +58,11 @@ function _do_build_file(target, sourcefile, opt)
-- trace progress info
if not opt.quiet then
- cprintf("${color.build.progress}" .. theme.get("text.build.progress_format") .. ":${clear} ", progress)
+ local progress_prefix = "${color.build.progress}" .. theme.get("text.build.progress_format") .. ":${clear} "
if verbose then
- cprint("${dim color.build.object}%scompiling.$(mode) %s", exists_ccache and "ccache " or "", sourcefile)
+ cprint(progress_prefix .. "${dim color.build.object}%scompiling.$(mode) %s", progress, exists_ccache and "ccache " or "", sourcefile)
else
- cprint("${color.build.object}%scompiling.$(mode) %s", exists_ccache and "ccache " or "", sourcefile)
+ cprint(progress_prefix .. "${color.build.object}%scompiling.$(mode) %s", progress, exists_ccache and "ccache " or "", sourcefile)
end
end