summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-11-09 22:58:22 +0800
committerruki <[email protected]>2023-11-09 22:58:22 +0800
commit52795181f82fdbb8e948b44d4d291d70a3852d39 (patch)
treee59da4431605a84dd59cdc10b7fa13c3e206c79f
parentcaa1342b25ed7e71b3975a6b40ec8823aa5f0d23 (diff)
load xpack
-rw-r--r--xmake/plugins/pack/main.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/xmake/plugins/pack/main.lua b/xmake/plugins/pack/main.lua
index e29bf45ce..b3b59fec7 100644
--- a/xmake/plugins/pack/main.lua
+++ b/xmake/plugins/pack/main.lua
@@ -19,9 +19,46 @@
--
-- imports
+import("core.base.task")
import("core.base.option")
+import("core.project.project")
+import("private.service.remote_build.action", {alias = "remote_build_action"})
+
+function _pack_packages()
+ local xpack_scope = project.scope("xpack")
+ for name, scope in pairs(xpack_scope) do
+ print("xpack(%s)", name)
+ print(" description: %s", scope:get("description"))
+ end
+end
function main()
+ -- do action for remote?
+ if remote_build_action.enabled() then
+ return remote_build_action()
+ end
+
+ -- lock the whole project
+ project.lock()
+
+ -- load config first
+ task.run("config", {}, {disable_dump = true})
+
+ -- load targets
+ project.load_targets()
+
+ -- enter project directory
+ local oldir = os.cd(project.directory())
+
+ -- do pack
+ _pack_packages()
+
+ -- leave project directory
+ os.cd(oldir)
+
+ -- unlock the whole project
+ project.unlock()
end
+