From ca29fd0cc42da28c3ded41973ca5cc5b1c3e7ff9 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 4 Mar 2016 11:09:45 +0800 Subject: add some directories for task --- xmake/actions/global/xmake.lua | 6 +++++- xmake/core/base/task.lua | 11 +++++++++-- 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 -- cgit v1.3.1