summaryrefslogtreecommitdiff
path: root/xmake/plugins/pack/xpack.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-11-10 22:57:56 +0800
committerruki <[email protected]>2023-11-10 22:57:56 +0800
commit41b31a8fdb0a9e4e7dd2a6868694c12f95c8a4c6 (patch)
tree8c7a3c1e5897efc1dfae25329201d575d650c007 /xmake/plugins/pack/xpack.lua
parentff33f52afebb41b4d281e9b4f7c9c6711a1e422c (diff)
call makensis
Diffstat (limited to 'xmake/plugins/pack/xpack.lua')
-rw-r--r--xmake/plugins/pack/xpack.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/xmake/plugins/pack/xpack.lua b/xmake/plugins/pack/xpack.lua
index 2ffe725be..cbc2b9045 100644
--- a/xmake/plugins/pack/xpack.lua
+++ b/xmake/plugins/pack/xpack.lua
@@ -232,6 +232,29 @@ function xpack:outputfile()
return path.join(self:outputdir(), self:filename())
end
+-- get the package version
+function xpack:version()
+ local version = self:get("version")
+ local version_build
+ if version == nil then
+ for _, target in ipairs(self:targets()) do
+ version, version_build = target:version()
+ if version then
+ break
+ end
+ end
+ if version == nil then
+ version, version_build = project.version()
+ end
+ else
+ version_build = self:extraconf("version", version, "build")
+ if type(version_build) == "string" then
+ version_build = os.date(version_build, os.time())
+ end
+ end
+ return version, version_build
+end
+
-- new a xpack
function _new(name, info)
return xpack {name, info}