summaryrefslogtreecommitdiff
path: root/xmake/actions/addon
diff options
context:
space:
mode:
authorruki <[email protected]>2026-08-16 23:43:27 +0800
committerGitHub <[email protected]>2026-08-16 23:43:27 +0800
commite180e51cfb91f59ea6b4912e4d7bc052f5ef5add (patch)
tree637ba32123a35fbfec26a7b0c977a9c65b7e05fe /xmake/actions/addon
parentc3debec81c555e5b39c81c4e39e1b9737041a650 (diff)
parentd7fc1e30a747c0457b4f45194946fcff747c76db (diff)
Merge pull request #7714 from xmake-io/addon
move add_addons to xmake.lua
Diffstat (limited to 'xmake/actions/addon')
-rw-r--r--xmake/actions/addon/main.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/xmake/actions/addon/main.lua b/xmake/actions/addon/main.lua
index bf6f27f5d..99f92d125 100644
--- a/xmake/actions/addon/main.lua
+++ b/xmake/actions/addon/main.lua
@@ -21,6 +21,7 @@
-- imports
import("core.base.option")
import("core.package.addon")
+import("core.project.project")
import("devel.git")
import("private.action.addon.impl.install_addons")
import("private.action.addon.impl.xrepo", {alias = "xrepo_addon"})
@@ -228,9 +229,12 @@ function _remove()
end
end
--- upgrade the addons which the current project declares in its `xmake-addons.lua`
+-- upgrade the addons which the current project declares, e.g. add_addons("esp32-devel 1.0.x")
function _upgrade()
- install_addons(os.projectdir(), {upgrade = true})
+ local declarations = {addons = table.wrap(project.get("addons")),
+ repositories = table.wrap(project.get("repositories"))}
+ assert(#declarations.addons > 0, "no addons are declared in this project, e.g. add_addons(\"esp32-devel\")!")
+ install_addons(os.projectdir(), declarations, {upgrade = true})
end
-- search the addons from the repositories