summaryrefslogtreecommitdiff
path: root/xmake/core
diff options
context:
space:
mode:
authorruki <[email protected]>2017-08-24 18:12:19 +0800
committerruki <[email protected]>2017-08-24 18:12:19 +0800
commit35e1d95ced10a2311e9ee96030b8aeb7a2e4bf8b (patch)
treec254218406e38a8faf0505d9b8a0fd30b14e342b /xmake/core
parent7187dc72fa1909168213283ecd651fed35c1daae (diff)
support build version
Diffstat (limited to 'xmake/core')
-rw-r--r--xmake/core/sandbox/modules/import/core/project/project.lua18
1 files changed, 17 insertions, 1 deletions
diff --git a/xmake/core/sandbox/modules/import/core/project/project.lua b/xmake/core/sandbox/modules/import/core/project/project.lua
index bae02f7a0..715b3d83d 100644
--- a/xmake/core/sandbox/modules/import/core/project/project.lua
+++ b/xmake/core/sandbox/modules/import/core/project/project.lua
@@ -149,7 +149,23 @@ end
-- get the project version
function sandbox_core_project.version()
- return project.get("version")
+
+ -- get version and build version
+ local version = project.get("version")
+ local version_build = sandbox_core_project._version_build
+ if version then
+ local version_extra = project.get("__extra_version")
+ if version_extra then
+ version_build = table.wrap(version_extra[version]).build
+ if type(version_build) == "string" then
+ version_build = os.date(version_build, os.time())
+ sandbox_core_project._version_build = version_build
+ end
+ end
+ end
+
+ -- ok?
+ return version, version_build
end
-- get the project name