Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add before/after_config #5791 #5813

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions xmake/core/project/rule.lua
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ function rule.apis()
, "rule.before_run"
, "rule.before_test"
, "rule.before_load"
, "rule.before_config"
, "rule.before_link"
, "rule.before_build"
, "rule.before_build_file"
Expand All @@ -307,6 +308,7 @@ function rule.apis()
, "rule.after_run"
, "rule.after_test"
, "rule.after_load"
, "rule.after_config"
, "rule.after_link"
, "rule.after_build"
, "rule.after_build_file"
Expand Down
14 changes: 14 additions & 0 deletions xmake/core/sandbox/modules/import/core/project/project.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ end

-- config target
function sandbox_core_project._config_target(target, opt)
for _, rule in ipairs(table.wrap(target:orderules())) do
local before_config = rule:script("config_before")
if before_config then
before_config(target, opt)
end
end

for _, rule in ipairs(table.wrap(target:orderules())) do
local on_config = rule:script("config")
if on_config then
Expand All @@ -137,6 +144,13 @@ function sandbox_core_project._config_target(target, opt)
if on_config then
on_config(target, opt)
end

for _, rule in ipairs(table.wrap(target:orderules())) do
local after_config = rule:script("config_after")
if after_config then
after_config(target, opt)
end
end
end

-- config targets
Expand Down
2 changes: 1 addition & 1 deletion xmake/rules/utils/inherit_links/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@

-- define rule: utils.inherit.links
rule("utils.inherit.links")
on_config("inherit_links")
after_config("inherit_links")

Loading