summaryrefslogtreecommitdiff
path: root/xmake/core/project/task.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-20 14:01:06 +0800
committerruki <[email protected]>2017-07-20 14:01:06 +0800
commita9a33cca711e2bc6d88594e2ab6b99921d5992f2 (patch)
treed44c4e9b9afb04d3aa0baa5da98b8e66f428d59d /xmake/core/project/task.lua
parente5d685f1fdba2977986950b13dc851682d3f7bcc (diff)
seperate task api from project and remove package module
Diffstat (limited to 'xmake/core/project/task.lua')
-rw-r--r--xmake/core/project/task.lua36
1 files changed, 20 insertions, 16 deletions
diff --git a/xmake/core/project/task.lua b/xmake/core/project/task.lua
index b32352b7e..6da3c26ee 100644
--- a/xmake/core/project/task.lua
+++ b/xmake/core/project/task.lua
@@ -35,7 +35,6 @@ local interpreter = require("base/interpreter")
local sandbox = require("sandbox/sandbox")
local config = require("project/config")
local project = require("project/project")
-local package = require("project/package")
local sandbox_os = require("sandbox/modules/os")
-- the directories of tasks
@@ -167,20 +166,7 @@ function task._interpreter()
assert(interp)
-- define apis
- interp:api_define
- {
- values =
- {
- -- task.set_xxx
- "task.set_category" -- main, action, plugin, task (default)
- , "task.set_menu"
- }
- , script =
- {
- -- task.on_xxx
- "task.on_run"
- }
- }
+ interp:api_define(task.apis())
-- set filter
interp:filter():register("task", function (variable)
@@ -202,7 +188,6 @@ function task._interpreter()
, globaldir = global.directory()
, configdir = config.directory()
, projectdir = os.projectdir()
- , packagedir = package.directory()
, programdir = os.programdir()
}
@@ -328,6 +313,25 @@ function task._load(filepath)
-- ok?
return tasks
end
+
+-- get task apis
+function task.apis()
+
+ return
+ {
+ values =
+ {
+ -- task.set_xxx
+ "task.set_category" -- main, action, plugin, task (default)
+ , "task.set_menu"
+ }
+ , script =
+ {
+ -- task.on_xxx
+ "task.on_run"
+ }
+ }
+end
-- get all tasks
function task.tasks()