summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2021-08-19 00:43:52 +0800
committerruki <[email protected]>2021-08-19 00:43:52 +0800
commite830cca00c1d3a2761eb725003823d8660acafc8 (patch)
tree1d90a67e1aae19dfdc0febf51aabebdcf7b5d7e7 /xmake/modules
parentc3b21f59947f34aa38881f621d21fd76fef5f008 (diff)
check lockrequire version
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/private/action/require/impl/lock_packages.lua1
-rw-r--r--xmake/modules/private/action/require/impl/package.lua3
2 files changed, 4 insertions, 0 deletions
diff --git a/xmake/modules/private/action/require/impl/lock_packages.lua b/xmake/modules/private/action/require/impl/lock_packages.lua
index a5e971b60..a02a65470 100644
--- a/xmake/modules/private/action/require/impl/lock_packages.lua
+++ b/xmake/modules/private/action/require/impl/lock_packages.lua
@@ -76,6 +76,7 @@ end
function main(packages)
if project.policy("package.requires_lock") then
local results = {}
+ results.version = project.requireslock_version()
for _, instance in ipairs(packages) do
local packagelock_key = _get_packagelock_key(instance)
results[packagelock_key] = _lock_package(instance)
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua
index 148758c59..3d9145477 100644
--- a/xmake/modules/private/action/require/impl/package.lua
+++ b/xmake/modules/private/action/require/impl/package.lua
@@ -684,6 +684,9 @@ function _load_package(packagename, requireinfo, opt)
if _has_locked_requires() then
local requirekey = _get_packagelock_key(requireinfo)
locked_requireinfo = _get_locked_requires(requirekey)
+ if semver.compare(project.requireslock_version(), locked_requireinfo.version) < 0 then
+ locked_requireinfo = nil
+ end
end
-- select package version