summaryrefslogtreecommitdiff
path: root/xmake/core/base/deprecated.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-07-26 09:23:24 +0800
committerGitHub <[email protected]>2019-07-26 09:23:24 +0800
commita77e8ad6db511c7adbb6b982cd5958febcb989cf (patch)
tree1fccf65b87e1d1ae89390d2292855fdd3c7deb2d /xmake/core/base/deprecated.lua
parentb03883547d69d2173ffc46f2c8b9e4d579247a60 (diff)
parent7d4023cf698bff82b2c0f2b4aad86286d4890b49 (diff)
Merge pull request #509 from OpportunityLiu/dev
Improve string.serialize; add unit test
Diffstat (limited to 'xmake/core/base/deprecated.lua')
-rw-r--r--xmake/core/base/deprecated.lua25
1 files changed, 12 insertions, 13 deletions
diff --git a/xmake/core/base/deprecated.lua b/xmake/core/base/deprecated.lua
index b37851f20..467bc2964 100644
--- a/xmake/core/base/deprecated.lua
+++ b/xmake/core/base/deprecated.lua
@@ -21,12 +21,6 @@
-- define module
local deprecated = deprecated or {}
--- load modules
-local utils = require("base/utils")
-local table = require("base/table")
-local string = require("base/string")
-local option = require("base/option")
-
-- add deprecated entry
function deprecated.add(newformat, oldformat, ...)
@@ -44,6 +38,10 @@ end
-- dump all deprecated entries
function deprecated.dump()
+ -- lazy load modules to avoid loop
+ local utils = require("base/utils")
+ local option = require("base/option")
+
-- dump one or more ..
local index = 0
deprecated._ENTRIES = deprecated._ENTRIES or {}
@@ -53,17 +51,18 @@ function deprecated.dump()
if index == 0 then
print("")
end
- if new then
- utils.cprint("${bright color.warning}deprecated: ${clear}please uses %s instead of %s", new, old)
- else
- utils.cprint("${bright color.warning}deprecated: ${clear}please remove %s", old)
- end
-- show more?
- if not option.get("verbose") then
- utils.cprint("${bright color.warning}deprecated: ${clear}add -v for getting more ..")
+ if not option.get("verbose") and index > 0 then
+ utils.cprint("${bright color.warning}deprecated:${clear} add -v for getting more ..")
break
end
+
+ if new then
+ utils.cprint("${bright color.warning}deprecated:${clear} please uses %s instead of %s", new, old)
+ else
+ utils.cprint("${bright color.warning}deprecated:${clear} please remove %s", old)
+ end
index = index + 1
end
end