diff options
| author | ruki <[email protected]> | 2015-05-30 22:41:02 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-05-30 22:41:02 +0800 |
| commit | ad9d27ef9a74603063755857b0a0191e486c1e8d (patch) | |
| tree | 6284b7af6b5d8460c1609d96c9b379c4dcf637fe /xmake/scripts/base/main.lua | |
| parent | 87683f4d3ba6d41c0b8900244e05dee4f84e2e62 (diff) | |
add run target and lua actions
Diffstat (limited to 'xmake/scripts/base/main.lua')
| -rw-r--r-- | xmake/scripts/base/main.lua | 70 |
1 files changed, 69 insertions, 1 deletions
diff --git a/xmake/scripts/base/main.lua b/xmake/scripts/base/main.lua index 9767010e2..1df26898a 100644 --- a/xmake/scripts/base/main.lua +++ b/xmake/scripts/base/main.lua @@ -54,7 +54,7 @@ local menu = , description = "Build the project if no given action." , -- actions - actions = {"create", "config", "global", "install", "clean"} + actions = {"create", "config", "global", "install", "clean", "run", "lua"} -- options , options = @@ -313,6 +313,69 @@ local menu = , {nil, "target", "v", "all", "Clean for the given target." } } } + + -- run target: xmake run +, run = + { + -- xmake r + shortname = 'r' + + -- usage + , usage = "xmake run|r [options] [target] [arguments]" + + -- description + , description = "Run the project target." + + -- options + , options = + { + {'f', "file", "kv", "xmake.xproj","Read a given xmake.xproj file." } + , {'P', "project", "kv", nil, "Change to the given project directory." + , "Search priority:" + , " 1. The Given Command Argument" + , " 2. The Envirnoment Variable: XMAKE_PROJECT_DIR" + , " 3. The Current Directory" } + , {} + , {'v', "verbose", "k", nil, "Print lots of verbose information." } + , {nil, "version", "k", nil, "Print the version number and exit." } + , {'h', "help", "k", nil, "Print this help message and exit." } + + , {} + , {nil, "target", "v", "all", "Run the given target." } + , {nil, "arguments", "v", nil, "The target arguments" } + } + } + + -- run lua: xmake lua +, lua = + { + -- xmake l + shortname = 'l' + + -- usage + , usage = "xmake lua|l [options] [script] [arguments]" + + -- description + , description = "Run the lua script." + + -- options + , options = + { + {'s', "string", "k", nil, "Run the lua string script." } + + , {} + , {'v', "verbose", "k", nil, "Print lots of verbose information." } + , {nil, "version", "k", nil, "Print the version number and exit." } + , {'h', "help", "k", nil, "Print this help message and exit." } + + , {} + , {nil, "script", "v", nil, "Run the given lua script." + , " - The script name from the xmake tool directory" + , " - The script file" + , " - The script string" } + , {nil, "arguments", "v", nil, "The script arguments" } + } + } } -- prepare project @@ -428,6 +491,11 @@ function main._done_option() return true end + -- done lua? + if options._ACTION == "lua" then + return action.done("lua") + end + -- done global? if options._ACTION == "global" then return main._done_global() |
