summaryrefslogtreecommitdiff
path: root/xmake/core/project
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/core/project')
-rw-r--r--xmake/core/project/project.lua2
-rw-r--r--xmake/core/project/task.lua7
-rw-r--r--xmake/core/project/template.lua2
3 files changed, 6 insertions, 5 deletions
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua
index 9bcbec092..52e9c4b8e 100644
--- a/xmake/core/project/project.lua
+++ b/xmake/core/project/project.lua
@@ -442,7 +442,7 @@ function project._interpreter()
interp:api_register("add_pkgs", interpreter.api_builtin_add_subdirs)
-- set filter
- interp:filter_set(filter.init(function (variable)
+ interp:filter_set(filter.new(function (variable)
-- check
assert(variable)
diff --git a/xmake/core/project/task.lua b/xmake/core/project/task.lua
index 22cee9714..98cf00454 100644
--- a/xmake/core/project/task.lua
+++ b/xmake/core/project/task.lua
@@ -175,7 +175,7 @@ function task._interpreter()
, "before")
-- set filter
- interp:filter_set(filter.init(function (variable)
+ interp:filter_set(filter.new(function (variable)
-- check
assert(variable)
@@ -188,6 +188,7 @@ function task._interpreter()
local maps =
{
host = xmake._HOST
+ , nuldev = xmake._NULDEV
, tmpdir = os.tmpdir()
, curdir = os.curdir()
, globaldir = global.directory()
@@ -239,7 +240,7 @@ function task._bind(tasks)
if type(opt) == "function" then
-- make sandbox instance with the given script
- local instance, errors = sandbox.new(opt, interp)
+ local instance, errors = sandbox.new(opt, interp:filter(), interp:rootdir())
if not instance then
return false, errors
end
@@ -271,7 +272,7 @@ function task._bind(tasks)
if type(description) == "function" then
-- make sandbox instance with the given script
- local instance, errors = sandbox.new(description, interp)
+ local instance, errors = sandbox.new(description, interp:filter(), interp:rootdir())
if not instance then
return false, errors
end
diff --git a/xmake/core/project/template.lua b/xmake/core/project/template.lua
index 30ee76952..4ed035fd9 100644
--- a/xmake/core/project/template.lua
+++ b/xmake/core/project/template.lua
@@ -171,7 +171,7 @@ function template.create(language, templateid, targetname)
assert(interp)
-- set filter
- interp:filter_set(filter.init(function (variable)
+ interp:filter_set(filter.new(function (variable)
-- init maps
local maps =