summaryrefslogtreecommitdiff
path: root/xmake/core/base/interpreter.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-02-23 11:19:33 +0800
committerruki <[email protected]>2020-02-23 11:54:26 +0800
commit9d34862fe5c82c7ac7e8d6dd8a1d951b3f1ed46c (patch)
tree3f34a71e6b7a72ca8750f05acfa5a7a6f6739fdc /xmake/core/base/interpreter.lua
parentabffcefe13ed5867a9c340214baa431795e4857f (diff)
regenerate build.ninja
Diffstat (limited to 'xmake/core/base/interpreter.lua')
-rw-r--r--xmake/core/base/interpreter.lua25
1 files changed, 9 insertions, 16 deletions
diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua
index c7f1d42ba..579ffec46 100644
--- a/xmake/core/base/interpreter.lua
+++ b/xmake/core/base/interpreter.lua
@@ -639,6 +639,7 @@ function interpreter.new()
local instance = { _PUBLIC = {}
, _PRIVATE = { _SCOPES = {}
, _MTIMES = {}
+ , _SCRIPT_FILES = {}
, _FILTER = require("base/filter").new()}}
-- inherit the interfaces of interpreter
@@ -711,6 +712,7 @@ function interpreter:load(file, opt)
-- init the current file
self._PRIVATE._CURFILE = file
+ self._PRIVATE._SCRIPT_FILES = {file}
-- init the root directory
self._PRIVATE._ROOTDIR = path.directory(file)
@@ -737,43 +739,33 @@ function interpreter:make(scope_kind, remove_repeat, enable_filter)
return results
end
+-- get all loaded script files (xmake.lua)
+function interpreter:scriptfiles()
+ assert(self and self._PRIVATE)
+ return self._PRIVATE._SCRIPT_FILES
+end
+
-- get mtimes
function interpreter:mtimes()
-
- -- check
assert(self and self._PRIVATE)
-
- -- get mtimes
return self._PRIVATE._MTIMES
end
-- get filter
function interpreter:filter()
-
- -- check
assert(self and self._PRIVATE)
-
- -- get it
return self._PRIVATE._FILTER
end
-- get root directory
function interpreter:rootdir()
-
- -- check
assert(self and self._PRIVATE)
-
- -- get it
return self._PRIVATE._ROOTDIR
end
-- set root directory
function interpreter:rootdir_set(rootdir)
-
- -- check
assert(self and self._PRIVATE and rootdir)
-
- -- set it
self._PRIVATE._ROOTDIR = rootdir
end
@@ -1545,6 +1537,7 @@ function interpreter:api_builtin_includes(...)
-- update the current file
self._PRIVATE._CURFILE = file
+ table.insert(self._PRIVATE._SCRIPT_FILES, file)
-- load the file script
local script, errors = loadfile(file)