summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2016-03-04 11:09:45 +0800
committerruki <[email protected]>2016-03-04 11:09:45 +0800
commitca29fd0cc42da28c3ded41973ca5cc5b1c3e7ff9 (patch)
tree374e2943948e564ed010ba07835980e080e5ae20
parentae466964bd7404958782890a267e98bd104a43bd (diff)
add some directories for task
-rwxr-xr-xxmake/actions/global/xmake.lua6
-rw-r--r--xmake/core/base/task.lua11
2 files changed, 14 insertions, 3 deletions
diff --git a/xmake/actions/global/xmake.lua b/xmake/actions/global/xmake.lua
index 7736a411b..24bd90fb2 100755
--- a/xmake/actions/global/xmake.lua
+++ b/xmake/actions/global/xmake.lua
@@ -29,7 +29,11 @@ task("global")
-- on run
on_task_run(function ()
-
+ printf("$(tmpdir)")
+ printf("$(buildir)")
+ printf("$(configdir)")
+ printf("$(globaldir)")
+ printf("$(projectdir)")
end)
diff --git a/xmake/core/base/task.lua b/xmake/core/base/task.lua
index d77c58710..69886339f 100644
--- a/xmake/core/base/task.lua
+++ b/xmake/core/base/task.lua
@@ -29,13 +29,16 @@ local table = require("base/table")
local utils = require("base/utils")
local filter = require("base/filter")
local string = require("base/string")
-local sandbox = require("sandbox/sandbox")
local interpreter = require("base/interpreter")
+local sandbox = require("sandbox/sandbox")
+local global = require("project/global")
+local config = require("project/config")
-- the directories of tasks
function task._directories()
- return { path.join(xmake._PROGRAM_DIR, "plugins")
+ return { path.join(global.directory(), "plugins")
+ , path.join(xmake._PROGRAM_DIR, "plugins")
, path.join(xmake._PROGRAM_DIR, "actions")
}
end
@@ -79,6 +82,10 @@ function task._interpreter()
local maps =
{
host = xmake._HOST
+ , tmpdir = os.tmpdir()
+ , globaldir = global.directory()
+ , configdir = config.directory()
+ , projectdir = xmake._PROJECT_DIR
}
-- map it