diff options
| author | ruki <[email protected]> | 2023-11-14 23:56:32 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-11-14 23:56:32 +0800 |
| commit | 9a5ca6742079c85d78d84f0bcecfae577628e201 (patch) | |
| tree | 8b670dface26829e5a29aa23412d05b7419ff46e /xmake/plugins/pack/main.lua | |
| parent | 6d88e548f3f1ad6dd730ee71bbacc940e96861c5 (diff) | |
load package script
Diffstat (limited to 'xmake/plugins/pack/main.lua')
| -rw-r--r-- | xmake/plugins/pack/main.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/xmake/plugins/pack/main.lua b/xmake/plugins/pack/main.lua index e5c50e4b2..09160fda0 100644 --- a/xmake/plugins/pack/main.lua +++ b/xmake/plugins/pack/main.lua @@ -26,10 +26,18 @@ import("private.service.remote_build.action", {alias = "remote_build_action"}) import("actions.build.main", {rootdir = os.programdir(), alias = "build_action"}) import("xpack") +function _load_package(package, format) + package:format_set(format) + local script = package:script("load") + if script then + script(package) + end +end + function _pack_package(package) assert(package:formats(), "xpack(%s): formats not found, please use `set_formats()` to set it.", package:name()) for _, format in package:formats():keys() do - package:format_set(format) + _load_package(package, format) import(format)(package) end end |
