summaryrefslogtreecommitdiff
path: root/xmake/core/tasks/lua.lua
blob: 22aac6eeab1cf905ec3e382b83923f6506dcd846 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
-- define task
task("lua")

    -- set category
    set_task_category("action")

    -- set menu
    set_task_menu({
                    -- usage
                    usage = "xmake lua|l [options] [script] [arguments]"

                    -- description
                ,   description = "Run the lua script."

                    -- xmake l
                ,   shortname = 'l'

                    -- options
                ,   options = 
                    {
                        {'f', "file",       "kv", nil,          "Read a given xmake.lua 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"                                  }

                    ,   {}
                    ,   {'s', "string",     "k",  nil,          "Run the lua string script."                                    }

                    ,   {}
                    ,   {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",  "vs", nil,          "The script arguments"                                          }
                    }
                })