summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-09-27 22:41:48 +0800
committerruki <[email protected]>2022-09-27 22:41:48 +0800
commitac1ae70b7226b32ff62d19b54465c42ecd70e99c (patch)
treec0a4739c2fefc675239e67ac77797ef6e3133e33
parent239a254ca980adb927e086cf2cf1e4392e9c61c6 (diff)
remove load rule deps
-rw-r--r--xmake/core/project/project.lua12
-rw-r--r--xmake/core/project/rule.lua34
2 files changed, 4 insertions, 42 deletions
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua
index 62e180a87..62f1f2398 100644
--- a/xmake/core/project/project.lua
+++ b/xmake/core/project/project.lua
@@ -288,18 +288,6 @@ function project._load_rules()
for rulename, ruleinfo in pairs(results) do
rules[rulename] = rule.new(rulename, ruleinfo)
end
-
- -- load rule deps
- local instances = table.join(rule.rules(), rules)
- for _, instance in pairs(instances) do
- instance._DEPS = instance._DEPS or {}
- instance._ORDERDEPS = instance._ORDERDEPS or {}
- local base = instance:get("base")
- if base then
- instance._BASE = instances[base]
- end
- instance_deps.load_deps(instance, instances, instance._DEPS, instance._ORDERDEPS, {instance:name()})
- end
return rules
end
diff --git a/xmake/core/project/rule.lua b/xmake/core/project/rule.lua
index f9449ad58..d0fbfb93d 100644
--- a/xmake/core/project/rule.lua
+++ b/xmake/core/project/rule.lua
@@ -46,11 +46,6 @@ end
function _instance:_build_deps()
end
--- get the base rule
-function _instance:base()
- return self._BASE
-end
-
-- clone rule
function _instance:clone()
local instance = rule.new(self:name(), self._INFO:clone())
@@ -61,13 +56,7 @@ end
-- get the rule info
function _instance:get(name)
- local value = self._INFO:get(name)
- if value == nil and self:base() then
- value = self:base():get(name)
- end
- if value ~= nil then
- return value
- end
+ return self._INFO:get(name)
end
-- set the value to the package info
@@ -84,13 +73,7 @@ end
-- get the extra configuration
function _instance:extraconf(name, item, key)
- local value = self._INFO:extraconf(name, item, key)
- if value == nil and self:base() then
- value = self:base():extraconf(name)
- end
- if value ~= nil then
- return value
- end
+ return self._INFO:extraconf(name, item, key)
end
-- get the rule name
@@ -309,7 +292,6 @@ function rule.apis()
"rule.set_extensions"
, "rule.set_sourcekinds"
, "rule.set_kind"
- , "rule.set_base"
-- rule.add_xxx
, "rule.add_deps"
, "rule.add_imports"
@@ -400,19 +382,11 @@ function rule.rules()
end
-- make rule instances
- local instances = {}
+ rules = {}
for rulename, ruleinfo in pairs(ruleinfos) do
local instance = rule.new(rulename, ruleinfo)
- instances[rulename] = instance
- end
-
- -- load rule deps
- for _, instance in pairs(instances) do
- instance._DEPS = instance._DEPS or {}
- instance._ORDERDEPS = instance._ORDERDEPS or {}
- rule._load_deps(instance, instances, instance._DEPS, instance._ORDERDEPS)
+ rules[rulename] = instance
end
- rules = instances
rule._RULES = rules
end
return rules