diff options
| author | ruki <[email protected]> | 2016-06-01 15:00:25 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-06-01 15:00:25 +0800 |
| commit | effb1055c467886ad873c01ee67167008e39ee9b (patch) | |
| tree | e72120bda5926dde4f1157772e15fbb793565707 /xmake/plugins/doxygen/main.lua | |
| parent | a695fd4b26ed7c5bdba3bd18d9adb3075190b1ee (diff) | |
impl doxygen plugin
Diffstat (limited to 'xmake/plugins/doxygen/main.lua')
| -rwxr-xr-x | xmake/plugins/doxygen/main.lua | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/xmake/plugins/doxygen/main.lua b/xmake/plugins/doxygen/main.lua index bcc7fd7db..72af8124e 100755 --- a/xmake/plugins/doxygen/main.lua +++ b/xmake/plugins/doxygen/main.lua @@ -27,9 +27,57 @@ import("core.tool.tool") -- main function main() + -- check the doxygen + local doxygen = tool.check("doxygen", function (shellname) + os.run("%s -v", shellname) + end) + assert(doxygen, "doxygen not found!") + -- generate doxyfile first if not exists local doxyfile = option.get("doxyfile") if not os.isfile(doxyfile) then - tool.run("doxygen", "doxygen -g " .. doxyfile) + + -- generate the default doxyfile + os.run("%s -g %s", doxygen, doxyfile) + + -- enable recursive + -- + -- RECURSIVE = YES + -- + io.gsub(doxyfile, "RECURSIVE%s-=%s-NO", "RECURSIVE = YES") + + -- set the source directory + -- + -- INPUT = xxx + -- + local srcdir = option.get("srcdir") + if srcdir and os.isdir(srcdir) then + io.gsub(doxyfile, "INPUT%s-=.-\n", format("INPUT = %s\n", srcdir)) + end + + -- set the output directory + -- + -- HTML_OUTPUT = html + -- LATEX_OUTPUT = latex + -- + local outputdir = option.get("outputdir") + if outputdir then + + -- update the doxyfile + io.gsub(doxyfile, "HTML_OUTPUT%s-=.-\n", format("HTML_OUTPUT = %s/html\n", outputdir)) + io.gsub(doxyfile, "LATEX_OUTPUT%s-=.-\n", format("LATEX_OUTPUT = %s/latex\n", outputdir)) + + -- ensure the output directory + os.mkdir(outputdir) + end end + + -- check + assert(os.isfile(doxyfile), "%s not found!", doxyfile) + + -- generate document + os.run("%s %s", doxygen, doxyfile) + + -- trace + print("doxygen ok!") end |
