diff options
| author | ruki <[email protected]> | 2016-05-31 20:45:24 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-05-31 20:45:24 +0800 |
| commit | 5b2e0333389158094a2a8bb796e13f99fac422e7 (patch) | |
| tree | c5d931b4b6886be3e1c77d2c4b8f5113768629ae | |
| parent | 3dc94888255e69d1fea8fc7079daac3054f9b76a (diff) | |
add project plugin
| -rwxr-xr-x | xmake/plugins/project/main.lua (renamed from xmake/plugins/makefile/main.lua) | 25 | ||||
| -rwxr-xr-x | xmake/plugins/project/makefile.lua (renamed from xmake/plugins/makefile/makefile.lua) | 0 | ||||
| -rwxr-xr-x | xmake/plugins/project/xmake.lua (renamed from xmake/plugins/makefile/xmake.lua) | 10 |
3 files changed, 29 insertions, 6 deletions
diff --git a/xmake/plugins/makefile/main.lua b/xmake/plugins/project/main.lua index 7f0d330f8..7d5362c9f 100755 --- a/xmake/plugins/makefile/main.lua +++ b/xmake/plugins/project/main.lua @@ -28,6 +28,27 @@ import("core.project.project") import("core.platform.platform") import("makefile") +-- make makefile +function _make_makefile(outputdir) + + -- make makefile + makefile.make(path.join(outputdir, "makefile")) +end + +-- make project +function _make(kind) + + -- the maps + local maps = + { + makefile = _make_makefile + } + assert(maps[kind], "the project kind(%s) is not supported!", kind) + + -- make it + maps[kind](option.get("outputdir")) +end + -- main function main() @@ -45,8 +66,8 @@ function main() -- load project project.load() - -- make makefile - makefile.make(option.get("output")) + -- make project + _make(option.get("kind")) -- trace print("create ok!") diff --git a/xmake/plugins/makefile/makefile.lua b/xmake/plugins/project/makefile.lua index 2fe7ffd93..2fe7ffd93 100755 --- a/xmake/plugins/makefile/makefile.lua +++ b/xmake/plugins/project/makefile.lua diff --git a/xmake/plugins/makefile/xmake.lua b/xmake/plugins/project/xmake.lua index a447057e6..e489bce21 100755 --- a/xmake/plugins/makefile/xmake.lua +++ b/xmake/plugins/project/xmake.lua @@ -21,7 +21,7 @@ -- -- define task -task("makefile") +task("project") -- set category set_category("plugin") @@ -32,15 +32,17 @@ task("makefile") -- set menu set_menu({ -- usage - usage = "xmake makefile [options] [target]" + usage = "xmake project [options] [target]" -- description - , description = "Create the project makefile." + , description = "Create the project file." -- options , options = { - {'o', "output", "kv", "makefile", "Set the output file." } + {'k', "kind", "kv", "makefile", "Set the project kind." + , " - makefile" } + , {nil, "outputdir", "v", ".", "Set the output directory." } } }) |
