diff options
| author | ruki <[email protected]> | 2023-11-10 23:02:56 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-11-10 23:02:56 +0800 |
| commit | fa0ffa6f9266cc6123671c408d09cef210c8448c (patch) | |
| tree | f156c309c7535559a26e4e78896250256de50052 | |
| parent | 41b31a8fdb0a9e4e7dd2a6868694c12f95c8a4c6 (diff) | |
build targets first in xpack
| -rw-r--r-- | xmake/plugins/pack/main.lua | 17 | ||||
| -rw-r--r-- | xmake/plugins/pack/nsis/main.lua | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/xmake/plugins/pack/main.lua b/xmake/plugins/pack/main.lua index 1da430d24..d7901d952 100644 --- a/xmake/plugins/pack/main.lua +++ b/xmake/plugins/pack/main.lua @@ -23,6 +23,7 @@ import("core.base.task") import("core.base.option") import("core.project.project") import("private.service.remote_build.action", {alias = "remote_build_action"}) +import("actions.build.main", {rootdir = os.programdir(), alias = "build_action"}) import("xpack") function _pack_package(package) @@ -39,6 +40,19 @@ function _pack_packages() end end +function _build_targets() + local targetnames = {} + for _, package in pairs(xpack.packages()) do + local targets = package:get("targets") + if targets then + table.join2(targetnames, targets) + end + end + if #targetnames > 0 then + build_action.build_targets(targetnames) + end +end + function main() -- do action for remote? @@ -58,6 +72,9 @@ function main() -- enter project directory local oldir = os.cd(project.directory()) + -- build targets first + _build_targets() + -- do pack _pack_packages() diff --git a/xmake/plugins/pack/nsis/main.lua b/xmake/plugins/pack/nsis/main.lua index 876ada157..d30559402 100644 --- a/xmake/plugins/pack/nsis/main.lua +++ b/xmake/plugins/pack/nsis/main.lua @@ -89,7 +89,7 @@ function _pack_nsis(makensis, package, opt) os.vrunv(makensis, argv) end -function main(package, opt) +function main(package) -- get makensis local makensis, oldenvs = _get_makensis() |
