From ae84c24d057752b7d3fe2101020e97e697fdd70d Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 8 Oct 2022 11:56:37 +0800 Subject: add some comments for package rule --- xmake/actions/config/main.lua | 3 +++ xmake/core/project/rule.lua | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua index eb51cb4dc..c8705d945 100644 --- a/xmake/actions/config/main.lua +++ b/xmake/actions/config/main.lua @@ -206,6 +206,9 @@ function _load_package_rules_for_target(target) local r = pkginfo:rule(rulename) if r then target:rule_add(r) + for _, dep in pairs(r:deps()) do + target:rule_add(dep) + end end end end diff --git a/xmake/core/project/rule.lua b/xmake/core/project/rule.lua index 367107393..4d2a058a0 100644 --- a/xmake/core/project/rule.lua +++ b/xmake/core/project/rule.lua @@ -364,7 +364,21 @@ function rule.new(name, info, opt) instance._INFO = info instance._PACKAGE = opt.package if opt.package then - -- replace deps in package + -- replace deps in package, @bar -> @zlib/bar + -- @see https://github.com/xmake-io/xmake/issues/2374 + -- + -- packages/z/zlib/rules/foo.lua + -- @code + -- rule("foo") + -- add_deps("@bar") + -- @endcode + -- + -- package/z/zlib/rules/foo.lua + -- @code + -- rule("bar") + -- ... + -- @endcode + -- local deps = {} for _, depname in ipairs(table.wrap(instance:get("deps"))) do -- @xxx -> @package/xxx -- cgit v1.3.1