summaryrefslogtreecommitdiff
path: root/xmake/core/project/template.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2016-12-26 08:59:06 +0800
committerruki <[email protected]>2017-01-06 17:20:08 +0800
commitcf15bd5f7162d6f009ff749e4fe6a29bd22cdda2 (patch)
tree82e72a1f6a2a5a84b3cdc8b1ee9d00eeab726a12 /xmake/core/project/template.lua
parent41b436bf13e65ea0a9eb3e826d944a626e387df2 (diff)
define apis for all scopes again
Diffstat (limited to 'xmake/core/project/template.lua')
-rw-r--r--xmake/core/project/template.lua33
1 files changed, 22 insertions, 11 deletions
diff --git a/xmake/core/project/template.lua b/xmake/core/project/template.lua
index d80283677..5830174d0 100644
--- a/xmake/core/project/template.lua
+++ b/xmake/core/project/template.lua
@@ -47,17 +47,28 @@ function template._interpreter()
local interp = interpreter.new()
assert(interp)
- -- register api: set_description() and set_projectdir()
- interp:api_register_set_values(nil, "description", "projectdir")
-
- -- register api: add_macrofiles()
- interp:api_register_add_values(nil, "macrofiles")
-
- -- register api: add_macros()
- interp:api_register_add_keyvalues(nil, "macros")
-
- -- register api: on_create()
- interp:api_register_on_script(nil, "create")
+ -- define apis (only root scope)
+ interp:api_define
+ {
+ values =
+ {
+ -- set_xxx
+ "set_description"
+ , "set_projectdir"
+ -- add_xxx
+ , "add_macrofiles"
+ }
+ , keyvalues =
+ {
+ -- add_xxx
+ "add_macros"
+ }
+ , script =
+ {
+ -- on_xxx
+ "on_create"
+ }
+ }
-- save interpreter
template._INTERPRETER = interp