summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2016-06-01 11:43:05 +0800
committerruki <[email protected]>2016-06-01 11:43:05 +0800
commita695fd4b26ed7c5bdba3bd18d9adb3075190b1ee (patch)
tree3b5238e5df7a5f2db927627e36f3d7782b60fd0b
parent8f62668161f2c002484ff783d67c53d65eee2116 (diff)
add arguments for doxygen plugin
-rwxr-xr-xxmake/plugins/doxygen/main.lua35
-rwxr-xr-xxmake/plugins/doxygen/xmake.lua12
-rw-r--r--xmake/tools/doxygen.lua50
3 files changed, 93 insertions, 4 deletions
diff --git a/xmake/plugins/doxygen/main.lua b/xmake/plugins/doxygen/main.lua
new file mode 100755
index 000000000..bcc7fd7db
--- /dev/null
+++ b/xmake/plugins/doxygen/main.lua
@@ -0,0 +1,35 @@
+--!The Automatic Cross-platform Build Tool
+--
+-- XMake is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU Lesser General Public License as published by
+-- the Free Software Foundation; either version 2.1 of the License, or
+-- (at your option) any later version.
+--
+-- XMake is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public License
+-- along with XMake;
+-- If not, see <a href="http://www.gnu.org/licenses/"> http://www.gnu.org/licenses/</a>
+--
+-- Copyright (C) 2015 - 2016, ruki All rights reserved.
+--
+-- @author ruki
+-- @file main.lua
+--
+
+-- imports
+import("core.base.option")
+import("core.tool.tool")
+
+-- main
+function main()
+
+ -- generate doxyfile first if not exists
+ local doxyfile = option.get("doxyfile")
+ if not os.isfile(doxyfile) then
+ tool.run("doxygen", "doxygen -g " .. doxyfile)
+ end
+end
diff --git a/xmake/plugins/doxygen/xmake.lua b/xmake/plugins/doxygen/xmake.lua
index 4bead9547..3342df331 100755
--- a/xmake/plugins/doxygen/xmake.lua
+++ b/xmake/plugins/doxygen/xmake.lua
@@ -26,19 +26,23 @@ task("doxygen")
-- set category
set_category("plugin")
+ -- on run
+ on_run("main")
+
-- set menu
set_menu({
-- usage
- usage = "xmake doxygen [options] [name] [arguments]"
+ usage = "xmake doxygen [options] [arguments]"
-- description
- , description = "Generate the doxygen document for the given name."
+ , description = "Generate the doxygen document."
-- options
, options =
{
- {nil, "name", "v", "all", "Configure for the given document name." }
-
+ {nil, "doxyfile", "kv", "Doxyfile", "Set the doxygen config file." }
+ , {}
+ , {nil, "srcdir", "v", "src", "Set the source code directory." }
}
})
diff --git a/xmake/tools/doxygen.lua b/xmake/tools/doxygen.lua
new file mode 100644
index 000000000..5afda2c72
--- /dev/null
+++ b/xmake/tools/doxygen.lua
@@ -0,0 +1,50 @@
+--!The Automatic Cross-platform Build Tool
+--
+-- XMake is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU Lesser General Public License as published by
+-- the Free Software Foundation; either version 2.1 of the License, or
+-- (at your option) any later version.
+--
+-- XMake is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public License
+-- along with XMake;
+-- If not, see <a href="http://www.gnu.org/licenses/"> http://www.gnu.org/licenses/</a>
+--
+-- Copyright (C) 2015 - 2016, ruki All rights reserved.
+--
+-- @author ruki
+-- @file ccache.lua
+--
+
+-- init it
+function init(shellname)
+
+ -- save name
+ _g.shellname = shellname or "doxygen"
+
+end
+
+-- get the property
+function get(name)
+
+ -- get it
+ return _g[name]
+end
+
+-- run it
+function run(...)
+
+ -- run it
+ os.run(...)
+end
+
+-- check the given flags
+function check(flags)
+
+ -- check it
+ os.run("%s %s -h", _g.shellname, ifelse(flags, flags, ""))
+end