diff options
| author | ruki <[email protected]> | 2022-02-25 22:35:49 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-02-25 22:35:49 +0800 |
| commit | 69235493bfdafde85187c565dc45bf9cde9abeaa (patch) | |
| tree | ba9873e172b87d129ae3b66ee01d4b112908b94f /xmake/modules/private/tools/codesign.lua | |
| parent | ae25e418f786b926b291c9bd40de5d0d871e48b5 (diff) | |
add global detect cache
Diffstat (limited to 'xmake/modules/private/tools/codesign.lua')
| -rw-r--r-- | xmake/modules/private/tools/codesign.lua | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/xmake/modules/private/tools/codesign.lua b/xmake/modules/private/tools/codesign.lua index 0eb42860c..cdb643f04 100644 --- a/xmake/modules/private/tools/codesign.lua +++ b/xmake/modules/private/tools/codesign.lua @@ -20,7 +20,7 @@ -- imports import("lib.detect.find_tool") -import("core.cache.globalcache") +import("core.cache.global_detectcache") -- get mobile provision name function _get_mobile_provision_name(provision) @@ -46,9 +46,9 @@ end -- get codesign identities function codesign_identities() - local identities = globalcache.get("codesign", "identities") - local lastime = globalcache.get("codesign", "lastime") - if lastime and os.time() - lastime > 3 * 24 * 3600 then -- > 3 days + local identities = global_detectcache:get2("codesign", "identities") + local lastime = global_detectcache:get2("codesign", "lastime") + if type(lastime) == "number" and os.time() - lastime > 3 * 24 * 3600 then -- > 3 days identities = nil end if identities == nil then @@ -72,18 +72,18 @@ function codesign_identities() end end end - globalcache.set("codesign", "identities", identities or false) - globalcache.set("codesign", "lastime", os.time()) - globalcache.save("codesign") + global_detectcache:set2("codesign", "identities", identities or false) + global_detectcache:set2("codesign", "lastime", os.time()) + global_detectcache:save() end return identities or nil end -- get provision profiles only for mobile function mobile_provisions() - local mobile_provisions = globalcache.get("codesign", "mobile_provisions") - local lastime = globalcache.get("codesign", "lastime") - if lastime and os.time() - lastime > 3 * 24 * 3600 then -- > 3 days + local mobile_provisions = global_detectcache:get2("codesign", "mobile_provisions") + local lastime = global_detectcache:get2("codesign", "lastime") + if type(lastime) == "number" and os.time() - lastime > 3 * 24 * 3600 then -- > 3 days mobile_provisions = nil end if mobile_provisions == nil then @@ -98,9 +98,9 @@ function mobile_provisions() end end end - globalcache.set("codesign", "mobile_provisions", mobile_provisions or false) - globalcache.set("codesign", "lastime", os.time()) - globalcache.save("codesign") + global_detectcache:set2("codesign", "mobile_provisions", mobile_provisions or false) + global_detectcache:set2("codesign", "lastime", os.time()) + global_detectcache:save() end return mobile_provisions or nil end |
