summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/core/base/deprecated/interpreter.lua22
-rw-r--r--xmake/core/base/interpreter.lua8
2 files changed, 23 insertions, 7 deletions
diff --git a/xmake/core/base/deprecated/interpreter.lua b/xmake/core/base/deprecated/interpreter.lua
index 6f94296a3..410841ef6 100644
--- a/xmake/core/base/deprecated/interpreter.lua
+++ b/xmake/core/base/deprecated/interpreter.lua
@@ -152,13 +152,18 @@ function deprecated_interpreter:_api_register_set_xxx_xxx(scope_kind, apiname)
assert(apifunc)
-- register api
- self:api_register(nil, oldapi, function (...)
+ self:api_register_builtin(oldapi, function (value, ...)
+
+ -- check
+ if type(value) ~= "string" then
+ value = type(value)
+ end
-- deprecated
- deprecated.add(newapi .. "()", oldapi .. "()")
+ deprecated.add(newapi .. "(\"%s\")", oldapi .. "(\"%s\")", value)
-- dispatch it
- apifunc(...)
+ apifunc(value, ...)
end)
end
@@ -176,13 +181,18 @@ function deprecated_interpreter:_api_register_add_xxx_xxx(scope_kind, apiname)
assert(apifunc)
-- register api
- self:api_register(nil, oldapi, function (...)
+ self:api_register_builtin(oldapi, function (value, ...)
+
+ -- check
+ if type(value) ~= "string" then
+ value = type(value)
+ end
-- deprecated
- deprecated.add(newapi .. "()", oldapi .. "()")
+ deprecated.add(newapi .. "(\"%s\")", oldapi .. "(\"%s\")", value)
-- dispatch it
- apifunc(...)
+ apifunc(value, ...)
end)
end
diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua
index dd5e7c45f..89384dfb4 100644
--- a/xmake/core/base/interpreter.lua
+++ b/xmake/core/base/interpreter.lua
@@ -517,7 +517,13 @@ function interpreter:load(file, scope_kind, remove_repeat, enable_filter)
end
-- make results
- return self:_make(scope_kind, remove_repeat, enable_filter)
+ local ok, results = xpcall(interpreter._make, interpreter._traceback, self, scope_kind, remove_repeat, enable_filter)
+ if not ok then
+ return nil, results
+ end
+
+ -- ok
+ return results
end
-- get mtimes