summaryrefslogtreecommitdiff
path: root/xmake/core/package/package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-05-27 22:51:00 +0800
committerruki <[email protected]>2024-05-27 22:51:00 +0800
commitc9cf85fc880d6c2937d3dea66fa78fabf4bbf97b (patch)
tree6769c5f1c83d7415b01825e314c66a37347a0cb4 /xmake/core/package/package.lua
parentd58352a36f0ee20e302e09fb9b0400695ff665b8 (diff)
add on_source for package
Diffstat (limited to 'xmake/core/package/package.lua')
-rw-r--r--xmake/core/package/package.lua19
1 files changed, 18 insertions, 1 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 00c89f241..101c8f23e 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -975,6 +975,22 @@ function _instance:manifest_save()
end
end
+-- init package source
+function _instance:_init_source()
+ local on_source = self:script("source")
+ if on_source then
+ on_source(self)
+ end
+end
+
+-- load package
+function _instance:_load()
+ local on_load = self:script("load")
+ if on_load then
+ on_load(self)
+ end
+end
+
-- get the raw environments
function _instance:_rawenvs()
local envs = self._RAWENVS
@@ -2661,7 +2677,8 @@ function package.apis()
, script =
{
-- package.on_xxx
- "package.on_load"
+ "package.on_source"
+ , "package.on_load"
, "package.on_fetch"
, "package.on_check"
, "package.on_download"