summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-01-02 22:57:10 +0800
committerruki <[email protected]>2019-01-02 11:43:01 +0800
commitf4ba9c2b6f85ce5d8b959714d8beaae9f03e4fe0 (patch)
tree990b915f0f772d0da92d6c094d69d35c348be83c
parentb183f6326762e3797ad65fe81051f1e03494e331 (diff)
add build.progress style
-rw-r--r--xmake/actions/build/kinds/binary.lua4
-rw-r--r--xmake/actions/build/kinds/object.lua16
-rw-r--r--xmake/actions/build/kinds/shared.lua4
-rw-r--r--xmake/actions/build/kinds/static.lua4
-rw-r--r--xmake/themes/default/xmake.lua3
-rw-r--r--xmake/themes/plain/xmake.lua3
6 files changed, 20 insertions, 14 deletions
diff --git a/xmake/actions/build/kinds/binary.lua b/xmake/actions/build/kinds/binary.lua
index 35ac2c936..68dec33e1 100644
--- a/xmake/actions/build/kinds/binary.lua
+++ b/xmake/actions/build/kinds/binary.lua
@@ -77,7 +77,7 @@ function _build_from_objects(target, buildinfo)
local verbose = option.get("verbose")
-- trace progress into
- cprintf("${green}[%3d%%]:${clear} ", (buildinfo.targetindex + 1) * 100 / buildinfo.targetcount)
+ cprintf("${build.progress}[%3d%%]:${clear} ", (buildinfo.targetindex + 1) * 100 / buildinfo.targetcount)
if verbose then
cprint("${dim magenta}linking.$(mode) %s", path.filename(targetfile))
else
@@ -111,7 +111,7 @@ function _build_from_sources(target, buildinfo, sourcebatch, sourcekind)
local verbose = option.get("verbose")
-- trace progress into
- cprintf("${green}[%3d%%]:${clear} ", (buildinfo.targetindex + 1) * 100 / buildinfo.targetcount)
+ cprintf("${build.progress}[%3d%%]:${clear} ", (buildinfo.targetindex + 1) * 100 / buildinfo.targetcount)
if verbose then
cprint("${dim magenta}linking.$(mode) %s", path.filename(targetfile))
else
diff --git a/xmake/actions/build/kinds/object.lua b/xmake/actions/build/kinds/object.lua
index d6e794569..de18cc028 100644
--- a/xmake/actions/build/kinds/object.lua
+++ b/xmake/actions/build/kinds/object.lua
@@ -41,9 +41,9 @@ function _build_from_object(target, sourcefile, objectfile, progress)
-- trace progress info
if verbose then
- cprint("${green}[%3d%%]: ${dim magenta}inserting.$(mode) %s", progress, sourcefile)
+ cprint("${build.progress}[%3d%%]: ${dim magenta}inserting.$(mode) %s", progress, sourcefile)
else
- cprint("${green}[%3d%%]: ${magenta}inserting.$(mode) %s", progress, sourcefile)
+ cprint("${build.progress}[%3d%%]: ${magenta}inserting.$(mode) %s", progress, sourcefile)
end
-- trace verbose info
@@ -66,9 +66,9 @@ function _build_from_static(target, sourcefile, objectfile, progress)
-- trace progress info
if verbose then
- cprint("${green}[%3d%%]: ${dim magenta}inserting.$(mode) %s", progress, sourcefile)
+ cprint("${build.progress}[%3d%%]: ${dim magenta}inserting.$(mode) %s", progress, sourcefile)
else
- cprint("${green}[%3d%%]: ${magenta}inserting.$(mode) %s", progress, sourcefile)
+ cprint("${build.progress}[%3d%%]: ${magenta}inserting.$(mode) %s", progress, sourcefile)
end
-- trace verbose info
@@ -120,9 +120,9 @@ function _do_build_file(target, sourcefile, opt)
-- trace progress info
if verbose then
- cprint("${green}[%3d%%]:${dim} %scompiling.$(mode) %s", progress, _g.ccache and "ccache " or "", sourcefile)
+ cprint("${build.progress}[%3d%%]:${dim} %scompiling.$(mode) %s", progress, _g.ccache and "ccache " or "", sourcefile)
else
- cprint("${green}[%3d%%]:${clear} %scompiling.$(mode) %s", progress, _g.ccache and "ccache " or "", sourcefile)
+ cprint("${build.progress}[%3d%%]:${clear} %scompiling.$(mode) %s", progress, _g.ccache and "ccache " or "", sourcefile)
end
-- trace verbose info
@@ -219,9 +219,9 @@ function _build_files_for_single(target, sourcebatch, jobs)
-- trace progress info
if verbose then
- cprint("${green}[%3d%%]:${clear} ${dim}%scompiling.$(mode) %s", progress, _g.ccache and "ccache " or "", sourcefile)
+ cprint("${build.progress}[%3d%%]:${clear} ${dim}%scompiling.$(mode) %s", progress, _g.ccache and "ccache " or "", sourcefile)
else
- cprint("${green}[%3d%%]:${clear} %scompiling.$(mode) %s", progress, _g.ccache and "ccache " or "", sourcefile)
+ cprint("${build.progress}[%3d%%]:${clear} %scompiling.$(mode) %s", progress, _g.ccache and "ccache " or "", sourcefile)
end
end
diff --git a/xmake/actions/build/kinds/shared.lua b/xmake/actions/build/kinds/shared.lua
index 14e7a8d29..52f6e02ae 100644
--- a/xmake/actions/build/kinds/shared.lua
+++ b/xmake/actions/build/kinds/shared.lua
@@ -90,7 +90,7 @@ function _build_from_objects(target, buildinfo)
local verbose = option.get("verbose")
-- trace progress info
- cprintf("${green}[%3d%%]:${clear} ", (buildinfo.targetindex + 1) * 100 / buildinfo.targetcount)
+ cprintf("${build.progress}[%3d%%]:${clear} ", (buildinfo.targetindex + 1) * 100 / buildinfo.targetcount)
if verbose then
cprint("${dim magenta}linking.$(mode) %s", path.filename(targetfile))
else
@@ -124,7 +124,7 @@ function _build_from_sources(target, buildinfo, sourcebatch, sourcekind)
local verbose = option.get("verbose")
-- trace progress into
- cprintf("${green}[%3d%%]:${clear} ", (buildinfo.targetindex + 1) * 100 / buildinfo.targetcount)
+ cprintf("${build.progress}[%3d%%]:${clear} ", (buildinfo.targetindex + 1) * 100 / buildinfo.targetcount)
if verbose then
cprint("${dim magenta}linking.$(mode) %s", path.filename(targetfile))
else
diff --git a/xmake/actions/build/kinds/static.lua b/xmake/actions/build/kinds/static.lua
index 3be849f68..7a9bac54e 100644
--- a/xmake/actions/build/kinds/static.lua
+++ b/xmake/actions/build/kinds/static.lua
@@ -86,7 +86,7 @@ function _build_from_objects(target, buildinfo)
local verbose = option.get("verbose")
-- trace progress info
- cprintf("${green}[%3d%%]:${clear} ", (buildinfo.targetindex + 1) * 100 / buildinfo.targetcount)
+ cprintf("${build.progress}[%3d%%]:${clear} ", (buildinfo.targetindex + 1) * 100 / buildinfo.targetcount)
if verbose then
cprint("${dim magenta}archiving.$(mode) %s", path.filename(targetfile))
else
@@ -120,7 +120,7 @@ function _build_from_sources(target, buildinfo, sourcebatch, sourcekind)
local verbose = option.get("verbose")
-- trace progress into
- cprintf("${green}[%3d%%]:${clear} ", (buildinfo.targetindex + 1) * 100 / buildinfo.targetcount)
+ cprintf("${build.progress}[%3d%%]:${clear} ", (buildinfo.targetindex + 1) * 100 / buildinfo.targetcount)
if verbose then
cprint("${dim magenta}archiving.$(mode) %s", path.filename(targetfile))
else
diff --git a/xmake/themes/default/xmake.lua b/xmake/themes/default/xmake.lua
index 6ba884dfd..17e7c8770 100644
--- a/xmake/themes/default/xmake.lua
+++ b/xmake/themes/default/xmake.lua
@@ -36,3 +36,6 @@ theme("default")
-- set color of the verbose warning info
set_color("verbose.warning", "dim yellow")
+
+ -- the color of the building progress
+ set_color("build.progress", "green")
diff --git a/xmake/themes/plain/xmake.lua b/xmake/themes/plain/xmake.lua
index 667b4a0be..457559bd0 100644
--- a/xmake/themes/plain/xmake.lua
+++ b/xmake/themes/plain/xmake.lua
@@ -36,3 +36,6 @@ theme("plain")
-- set color of the verbose warning info
set_color("verbose.warning", "")
+
+ -- the color of the building progress
+ set_color("build.progress", "")