summaryrefslogtreecommitdiff
path: root/xmake/core/project/project.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-01-04 22:51:39 +0800
committerruki <[email protected]>2019-01-04 11:09:58 +0800
commit76cf129b49dba3abd63de5610900265c63603458 (patch)
treec88b20b6a4ab9dfc980e8c2d353059787281fce1 /xmake/core/project/project.lua
parenta5d9cb41fef552951bec41ba5f8c4261953f6bd5 (diff)
improve project and history cache
Diffstat (limited to 'xmake/core/project/project.lua')
-rw-r--r--xmake/core/project/project.lua33
1 files changed, 25 insertions, 8 deletions
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua
index 199756ab0..31019db59 100644
--- a/xmake/core/project/project.lua
+++ b/xmake/core/project/project.lua
@@ -558,15 +558,36 @@ function project._load_options(disable_filter)
-- check options
local options = {}
for optionname, optioninfo in pairs(results) do
-
+
+ -- TODO
+ -- load it from cache first (@note will discard scripts)
+ --[[
+ local instance = option.load(optionname)
+ if instance then
+
+ -- patch scripts (e.g. on_check ..)
+ for k, v in pairs(optioninfo) do
+ if type(v) == "function" then
+ instance:set(k, v)
+ end
+ end
+ else
+
+ -- init a option instance
+ instance = table.inherit(option)
+
+ -- save name and info
+ instance._NAME = optionname
+ instance._INFO = optioninfo
+ end]]
+
-- init a option instance
local instance = table.inherit(option)
- assert(instance)
-- save name and info
instance._NAME = optionname
instance._INFO = optioninfo
-
+
-- save it
options[optionname] = instance
@@ -645,10 +666,8 @@ function project._load_requires()
return requires
end
--- load packages
+-- load the packages from the the project file and disable filter, we will process filter after a while
function project._load_packages()
-
- -- load the packages from the the project file and disable filter, we will process filter after a while
return project._load_scope("package", true, false)
end
@@ -716,8 +735,6 @@ end
function project.requires()
if not project._REQUIRES then
-
- -- load requires
local requires, errors = project._load_requires()
if not requires then
os.raise(errors)