diff options
| author | ruki <[email protected]> | 2016-07-14 09:40:09 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-07-14 09:40:09 +0800 |
| commit | 95aeee4be5749ea83aadbe453b5fe221a746addf (patch) | |
| tree | 5b3e4ecbbaaf8e3395851df3572ee4c7aefea27d | |
| parent | 6c2d3f0ea4d0ccdb10199bc9462b0dc44ddc8a9a (diff) | |
add bear to doxygen
| -rwxr-xr-x | xmake/actions/build/kinds/binary.lua | 6 | ||||
| -rwxr-xr-x | xmake/actions/build/kinds/object.lua | 28 | ||||
| -rwxr-xr-x | xmake/actions/build/kinds/shared.lua | 4 | ||||
| -rwxr-xr-x | xmake/actions/build/kinds/static.lua | 4 | ||||
| -rw-r--r-- | xmake/core/project/option.lua | 81 | ||||
| -rwxr-xr-x | xmake/plugins/doxygen/main.lua | 3 |
6 files changed, 71 insertions, 55 deletions
diff --git a/xmake/actions/build/kinds/binary.lua b/xmake/actions/build/kinds/binary.lua index c3aafcb55..6dce2359e 100755 --- a/xmake/actions/build/kinds/binary.lua +++ b/xmake/actions/build/kinds/binary.lua @@ -53,13 +53,13 @@ function build(target, g) -- trace percent into cprintf("${yellow}[%02d%%]:${clear} ", (g.targetindex + 1) * 100 / g.targetcount) if verbose then - cprint("${dim}linking.$(mode) %s", path.filename(targetfile)) + cprint("${dim blue}linking.$(mode) %s", path.filename(targetfile)) else - print("linking.$(mode) %s", path.filename(targetfile)) + cprint("${blue}linking.$(mode) %s", path.filename(targetfile)) end -- trace verbose info - if option.get("verbose") then + if verbose then print(linker.linkcmd(objectfiles, targetfile, target)) end diff --git a/xmake/actions/build/kinds/object.lua b/xmake/actions/build/kinds/object.lua index f22aafbe0..6fee1ef37 100755 --- a/xmake/actions/build/kinds/object.lua +++ b/xmake/actions/build/kinds/object.lua @@ -30,11 +30,19 @@ import("core.project.config") -- build the object from the *.[o|obj] source file function _build_from_object(target, sourcefile, objectfile, percent) - -- trace - print("[%02d%%]: inserting.$(mode) %s", percent, sourcefile) + -- is verbose? + local verbose = option.get("verbose") + + -- trace percent info + cprintf("${yellow}[%02d%%]:${clear} ", percent) + if verbose then + cprint("${dim magenta}inserting.$(mode) %s", sourcefile) + else + cprint("${magenta}inserting.$(mode) %s", sourcefile) + end -- trace verbose info - if option.get("verbose") then + if verbose then print("cp %s %s", sourcefile, objectfile) end @@ -45,11 +53,19 @@ end -- build the object from the *.[a|lib] source file function _build_from_static(target, sourcefile, objectfile, percent) - -- trace - print("[%02d%%]: inserting.$(mode) %s", percent, sourcefile) + -- is verbose? + local verbose = option.get("verbose") + + -- trace percent info + cprintf("${yellow}[%02d%%]:${clear} ", percent) + if verbose then + cprint("${dim magenta}inserting.$(mode) %s", sourcefile) + else + cprint("${magenta}inserting.$(mode) %s", sourcefile) + end -- trace verbose info - if option.get("verbose") then + if verbose then print("ex %s %s", sourcefile, objectfile) end diff --git a/xmake/actions/build/kinds/shared.lua b/xmake/actions/build/kinds/shared.lua index a16848b09..b71b68ae5 100755 --- a/xmake/actions/build/kinds/shared.lua +++ b/xmake/actions/build/kinds/shared.lua @@ -66,9 +66,9 @@ function build(target, g) -- trace percent info cprintf("${yellow}[%02d%%]:${clear} ", (g.targetindex + 1) * 100 / g.targetcount) if verbose then - cprint("${dim}linking.$(mode) %s", path.filename(targetfile)) + cprint("${dim blue}linking.$(mode) %s", path.filename(targetfile)) else - print("linking.$(mode) %s", path.filename(targetfile)) + cprint("${blue}linking.$(mode) %s", path.filename(targetfile)) end -- trace verbose info diff --git a/xmake/actions/build/kinds/static.lua b/xmake/actions/build/kinds/static.lua index d7503ffcb..183143c92 100755 --- a/xmake/actions/build/kinds/static.lua +++ b/xmake/actions/build/kinds/static.lua @@ -66,9 +66,9 @@ function build(target, g) -- trace percent info cprintf("${yellow}[%02d%%]:${clear} ", (g.targetindex + 1) * 100 / g.targetcount) if verbose then - cprint("${dim}archiving.$(mode) %s", path.filename(targetfile)) + cprint("${dim blue}archiving.$(mode) %s", path.filename(targetfile)) else - print("archiving.$(mode) %s", path.filename(targetfile)) + cprint("${blue}archiving.$(mode) %s", path.filename(targetfile)) end -- trace verbose info diff --git a/xmake/core/project/option.lua b/xmake/core/project/option.lua index 880926f93..faf75161b 100644 --- a/xmake/core/project/option.lua +++ b/xmake/core/project/option.lua @@ -51,14 +51,8 @@ function option:_check_link(sourcefile, objectfile, targetfile) return false end - -- attempt to run this command - local ok, errors = instance:link(objectfile, targetfile, self) - if not ok and option_.get("verbose") then - utils.cprint("${red}" .. (errors or "")) - end - - -- ok? - return ok + -- attempt to link it + return instance:link(objectfile, targetfile, self) end -- check include @@ -93,14 +87,8 @@ function option:_check_include(include, srcpath, objpath) return false end - -- attempt to run this command - local ok, errors = instance:compile(srcpath, objpath, nil, self) - if not ok and option_.get("verbose") then - utils.cprint("${red}" .. (errors or "")) - end - - -- ok? - return ok + -- attempt to compile it + return instance:compile(srcpath, objpath, nil, self) end -- check function @@ -147,14 +135,8 @@ function option:_check_function(checkcode, srcpath, objpath) -- exit this file srcfile:close() - -- execute the compile command - local ok, errors = instance:compile(srcpath, objpath, nil, self) - if not ok and option_.get("verbose") then - utils.cprint("${red}" .. (errors or "")) - end - - -- ok? - return ok + -- attempt to compile it + return instance:compile(srcpath, objpath, nil, self) end -- check typedef @@ -201,14 +183,8 @@ function option:_check_typedef(typedef, srcpath, objpath) -- exit this file srcfile:close() - -- execute the compile command - local ok, errors = instance:compile(srcpath, objpath, nil, self) - if not ok and option_.get("verbose") then - utils.cprint("${red}" .. (errors or "")) - end - - -- ok? - return ok + -- attempt to compile it + return instance:compile(srcpath, objpath, nil, self) end -- check option for checking links @@ -230,13 +206,16 @@ function option:_check_links(cfile, objectfile, targetfile) end -- only for compile a object file - local ok = self:_check_include(nil, cfile, objectfile) + local ok, errors = self:_check_include(nil, cfile, objectfile) -- check link - if ok then ok = self:_check_link(cfile, objectfile, targetfile) end + if ok then ok, errors = self:_check_link(cfile, objectfile, targetfile) end -- trace utils.cprint("checking for the links %s ... %s", links_str, utils.ifelse(ok, "${green}ok", "${red}no")) + if not ok and option_.get("verbose") then + utils.cprint("${red}" .. (errors or "")) + end -- cache the result option._CHECKED_LINKS[links_str] = ok @@ -256,10 +235,13 @@ function option:_check_cincludes(cfile, objectfile) if option._CHECKED_CINCLUDES[cinclude] then return true end -- check cinclude - local ok = self:_check_include(cinclude, cfile, objectfile) + local ok, errors = self:_check_include(cinclude, cfile, objectfile) -- trace utils.cprint("checking for the c include %s ... %s", cinclude, utils.ifelse(ok, "${green}ok", "${red}no")) + if not ok and option_.get("verbose") then + utils.cprint("${red}" .. (errors or "")) + end -- cache the result option._CHECKED_CINCLUDES[cinclude] = ok @@ -283,10 +265,13 @@ function option:_check_cxxincludes(cxxfile, objectfile) if option._CHECKED_CXXINCLUDES[cinclude] then return true end -- check cinclude - local ok = self:_check_include(cxxinclude, cxxfile, objectfile) + local ok, errors = self:_check_include(cxxinclude, cxxfile, objectfile) -- trace utils.cprint("checking for the c++ include %s ... %s", cxxinclude, utils.ifelse(ok, "${green}ok", "${red}no")) + if not ok and option_.get("verbose") then + utils.cprint("${red}" .. (errors or "")) + end -- cache the result option._CHECKED_CXXINCLUDES[cxxinclude] = ok @@ -310,13 +295,16 @@ function option:_check_cfuncs(cfile, objectfile, targetfile) assert(checkname and checkcode) -- check function - local ok = self:_check_function(checkcode, cfile, objectfile) + local ok, errors = self:_check_function(checkcode, cfile, objectfile) -- check link - if ok and self:get("links") then ok = self:_check_link(cfile, objectfile, targetfile) end + if ok and self:get("links") then ok, errors = self:_check_link(cfile, objectfile, targetfile) end -- trace utils.cprint("checking for the c function %s ... %s", checkname, utils.ifelse(ok, "${green}ok", "${red}no")) + if not ok and option_.get("verbose") then + utils.cprint("${red}" .. (errors or "")) + end -- failed if not ok then return false end @@ -337,13 +325,16 @@ function option:_check_cxxfuncs(cxxfile, objectfile, targetfile) assert(checkname and checkcode) -- check function - local ok = self:_check_function(checkcode, cxxfile, objectfile) + local ok, errors = self:_check_function(checkcode, cxxfile, objectfile) -- check link - if ok and self:get("links") then ok = self:_check_link(cxxfile, objectfile, targetfile) end + if ok and self:get("links") then ok, errors = self:_check_link(cxxfile, objectfile, targetfile) end -- trace utils.cprint("checking for the c++ function %s ... %s", checkname, utils.ifelse(ok, "${green}ok", "${red}no")) + if not ok and option_.get("verbose") then + utils.cprint("${red}" .. (errors or "")) + end -- failed if not ok then return false end @@ -360,10 +351,13 @@ function option:_check_ctypes(cfile, objectfile, targetfile) for _, ctype in ipairs(table.wrap(self:get("ctypes"))) do -- check type - local ok = self:_check_typedef(ctype, cfile, objectfile) + local ok, errors = self:_check_typedef(ctype, cfile, objectfile) -- trace utils.cprint("checking for the c type %s ... %s", ctype, utils.ifelse(ok, "${green}ok", "${red}no")) + if not ok and option_.get("verbose") then + utils.cprint("${red}" .. (errors or "")) + end -- failed if not ok then return false end @@ -380,10 +374,13 @@ function option:_check_cxxtypes(cxxfile, objectfile, targetfile) for _, cxxtype in ipairs(table.wrap(self:get("cxxtypes"))) do -- check type - local ok = self:_check_typedef(cxxtype, cxxfile, objectfile) + local ok, errors = self:_check_typedef(cxxtype, cxxfile, objectfile) -- trace utils.cprint("checking for the c++ type %s ... %s", cxxtype, utils.ifelse(ok, "${green}ok", "${red}no")) + if not ok and option_.get("verbose") then + utils.cprint("${red}" .. (errors or "")) + end -- failed if not ok then return false end diff --git a/xmake/plugins/doxygen/main.lua b/xmake/plugins/doxygen/main.lua index 67813a5ae..84b6171a8 100755 --- a/xmake/plugins/doxygen/main.lua +++ b/xmake/plugins/doxygen/main.lua @@ -100,6 +100,9 @@ function main() -- enter the project directory os.cd(project.directory()) + -- trace + cprint("generating ..${beer}") + -- generate document if option.get("verbose") then os.exec("%s %s", doxygen, doxyfile) |
