diff options
| author | ruki <[email protected]> | 2023-11-20 22:32:36 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-11-20 22:32:36 +0800 |
| commit | 9aad219bee6773423b05361c1b6ed33d1840ebb5 (patch) | |
| tree | fe0876d85ef2dbe167376a40c9ff632383a78bd0 /xmake/plugins/pack/xpack.lua | |
| parent | 081ab8547ac7faff45ee89cdd9b4fcd6c7d68775 (diff) | |
improve xpack
Diffstat (limited to 'xmake/plugins/pack/xpack.lua')
| -rw-r--r-- | xmake/plugins/pack/xpack.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/xmake/plugins/pack/xpack.lua b/xmake/plugins/pack/xpack.lua index d0dc56697..0d6dd08f3 100644 --- a/xmake/plugins/pack/xpack.lua +++ b/xmake/plugins/pack/xpack.lua @@ -514,8 +514,16 @@ function packages() need = true end if need then - local instance = _new(name, scope) - packages[name] = instance + local formats = scope:get("formats") + if formats then + for _, format in ipairs(formats) do + local instance = _new(name, scope) + instance:format_set(format) + table.insert(packages, instance) + end + else + raise("xpack(%s): formats not found, please use `set_formats()` to set it.", scope:get("name")) + end end end _g.packages = packages |
