diff options
| author | ruki <[email protected]> | 2015-06-10 20:50:58 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-06-10 20:50:58 +0800 |
| commit | b5815f7c047221ea4a85333f7a8b6be5a2a4c737 (patch) | |
| tree | f53349989af5e057d77233d333ef5efc46d03ed3 /xmake/scripts | |
| parent | 62f8e7581602d698a341db16257bd3d9304fa30d (diff) | |
modify the checking verbose info
Diffstat (limited to 'xmake/scripts')
| -rw-r--r-- | xmake/scripts/base/project.lua | 7 | ||||
| -rw-r--r-- | xmake/scripts/base/utils.lua | 13 | ||||
| -rw-r--r-- | xmake/scripts/platform/android/prober.lua | 30 | ||||
| -rw-r--r-- | xmake/scripts/platform/iphoneos/prober.lua | 49 | ||||
| -rw-r--r-- | xmake/scripts/platform/iphonesimulator/prober.lua | 49 | ||||
| -rw-r--r-- | xmake/scripts/platform/linux/prober.lua | 30 | ||||
| -rw-r--r-- | xmake/scripts/platform/macosx/prober.lua | 49 | ||||
| -rw-r--r-- | xmake/scripts/platform/windows/prober.lua | 37 |
8 files changed, 118 insertions, 146 deletions
diff --git a/xmake/scripts/base/project.lua b/xmake/scripts/base/project.lua index 19da97029..bad0e215f 100644 --- a/xmake/scripts/base/project.lua +++ b/xmake/scripts/base/project.lua @@ -419,12 +419,7 @@ function project._make_options(configs) end -- trace - utils.verbose("checking %s ...: %s", k, utils.ifelse(o, "ok", "no")) - - else - - -- trace - utils.verbose("checking %s ...: %s", k, "ok") + utils.verbose("checking for %s ... %s", k, utils.ifelse(o, "ok", "no")) end end end diff --git a/xmake/scripts/base/utils.lua b/xmake/scripts/base/utils.lua index bbbc802ac..58ec6ba60 100644 --- a/xmake/scripts/base/utils.lua +++ b/xmake/scripts/base/utils.lua @@ -208,19 +208,15 @@ function utils.unique(array) end -- call functions -function utils.call(self, funcs, pred, ...) +function utils.call(funcs, pred, ...) -- check - assert(self and funcs and type(funcs) == "table") + assert(funcs) -- call all - for _, name in ipairs(funcs) do + for _, func in ipairs(utils.wrap(funcs)) do -- check - assert(type(name) == "string") - - -- get function - local func = self[name] assert(type(func) == "function") -- call it @@ -229,7 +225,8 @@ function utils.call(self, funcs, pred, ...) -- exists predicate? if pred and type(pred) == "function" then if not pred(name, result) then break end - end + -- failed? + elseif not result then break end end end diff --git a/xmake/scripts/platform/android/prober.lua b/xmake/scripts/platform/android/prober.lua index d3840d812..5ecf1731b 100644 --- a/xmake/scripts/platform/android/prober.lua +++ b/xmake/scripts/platform/android/prober.lua @@ -44,6 +44,9 @@ function prober._probe_arch(configs) -- init the default architecture configs.set("arch", "armv7-a") + -- trace + utils.verbose("checking the architecture ... %s", configs.get("arch")) + -- ok return true end @@ -72,6 +75,9 @@ function prober._probe_ccache(configs) configs.set("ccache", false) end + -- trace + utils.verbose("checking for the ccache ... %s", utils.ifelse(ccache_path, ccache_path, "no")) + -- ok return true end @@ -80,16 +86,9 @@ end function prober.config() -- call all probe functions - utils.call( prober - , { "_probe_arch" - , "_probe_ccache"} - - , function (name, result) - -- trace - utils.verbose("checking %s ...: %s", name:gsub("_probe_", ""), utils.ifelse(result, "ok", "no")) - return result - end - + utils.call( { prober._probe_arch + , prober._probe_ccache} + , nil , config) end @@ -98,15 +97,8 @@ end function prober.global() -- call all probe functions - utils.call( prober - , { "_probe_ccache"} - - , function (name, result) - -- trace - utils.verbose("checking %s ...: %s", name:gsub("_probe_", ""), utils.ifelse(result, "ok", "no")) - return result - end - + utils.call( prober._probe_ccache + , nil , global) end diff --git a/xmake/scripts/platform/iphoneos/prober.lua b/xmake/scripts/platform/iphoneos/prober.lua index 4d29d77cb..e62b4d39f 100644 --- a/xmake/scripts/platform/iphoneos/prober.lua +++ b/xmake/scripts/platform/iphoneos/prober.lua @@ -44,6 +44,9 @@ function prober._probe_arch(configs) -- init the default architecture configs.set("arch", "armv7") + -- trace + utils.verbose("checking the architecture ... %s", configs.get("arch")) + -- ok return true end @@ -77,10 +80,14 @@ function prober._probe_xcode(configs) -- probe ok? update it if xcode_dir then + -- save it configs.set("xcode_dir", xcode_dir) + + -- trace + utils.verbose("checking the Xcode application directory ... %s", xcode_dir) else -- failed - utils.error("The Xcode directory is unknown now, please config it first!") + utils.error("checking the Xcode application directory ... no") utils.error(" - xmake config --xcode_dir=xxx") utils.error("or - xmake global --xcode_dir=xxx") return false @@ -115,10 +122,15 @@ function prober._probe_xcode_sdkver(configs) -- probe ok? update it if xcode_sdkver then + + -- save it configs.set("xcode_sdkver", xcode_sdkver) + + -- trace + utils.verbose("checking the Xcode SDK version for %s ... %s", configs.get("plat"), xcode_sdkver) else -- failed - utils.error("The Xcode SDK version is unknown now, please config it first!") + utils.error("checking the Xcode SDK version for %s ... no", configs.get("plat")) utils.error(" - xmake config --xcode_sdkver=xxx") utils.error("or - xmake global --xcode_sdkver=xxx") return false @@ -152,6 +164,9 @@ function prober._probe_ccache(configs) configs.set("ccache", false) end + -- trace + utils.verbose("checking for the ccache ... %s", utils.ifelse(ccache_path, ccache_path, "no")) + -- ok return true end @@ -160,18 +175,11 @@ end function prober.config() -- call all probe functions - utils.call( prober - , { "_probe_arch" - , "_probe_xcode" - , "_probe_xcode_sdkver" - , "_probe_ccache"} - - , function (name, result) - -- trace - utils.verbose("checking %s ...: %s", name:gsub("_probe_", ""), utils.ifelse(result, "ok", "no")) - return result - end - + utils.call( { prober._probe_arch + , prober._probe_xcode + , prober._probe_xcode_sdkver + , prober._probe_ccache} + , nil , config) end @@ -180,16 +188,9 @@ end function prober.global() -- call all probe functions - utils.call( prober - , { "_probe_xcode" - , "_probe_ccache"} - - , function (name, result) - -- trace - utils.verbose("checking %s ...: %s", name:gsub("_probe_", ""), utils.ifelse(result, "ok", "no")) - return result - end - + utils.call( { prober._probe_xcode + , prober._probe_ccache} + , nil , global) end diff --git a/xmake/scripts/platform/iphonesimulator/prober.lua b/xmake/scripts/platform/iphonesimulator/prober.lua index 5804e97b9..419becf12 100644 --- a/xmake/scripts/platform/iphonesimulator/prober.lua +++ b/xmake/scripts/platform/iphonesimulator/prober.lua @@ -44,6 +44,9 @@ function prober._probe_arch(configs) -- init the default architecture configs.set("arch", "x86") + -- trace + utils.verbose("checking the architecture ... %s", configs.get("arch")) + -- ok return true end @@ -77,10 +80,14 @@ function prober._probe_xcode(configs) -- probe ok? update it if xcode_dir then + -- save it configs.set("xcode_dir", xcode_dir) + + -- trace + utils.verbose("checking the Xcode application directory ... %s", xcode_dir) else -- failed - utils.error("The Xcode directory is unknown now, please config it first!") + utils.error("checking the Xcode application directory ... no") utils.error(" - xmake config --xcode_dir=xxx") utils.error("or - xmake global --xcode_dir=xxx") return false @@ -115,10 +122,15 @@ function prober._probe_xcode_sdkver(configs) -- probe ok? update it if xcode_sdkver then + + -- save it configs.set("xcode_sdkver", xcode_sdkver) + + -- trace + utils.verbose("checking the Xcode SDK version for %s ... %s", configs.get("plat"), xcode_sdkver) else -- failed - utils.error("The Xcode SDK version is unknown now, please config it first!") + utils.error("checking the Xcode SDK version for %s ... no", configs.get("plat")) utils.error(" - xmake config --xcode_sdkver=xxx") utils.error("or - xmake global --xcode_sdkver=xxx") return false @@ -152,6 +164,9 @@ function prober._probe_ccache(configs) configs.set("ccache", false) end + -- trace + utils.verbose("checking for the ccache ... %s", utils.ifelse(ccache_path, ccache_path, "no")) + -- ok return true end @@ -160,18 +175,11 @@ end function prober.config() -- call all probe functions - utils.call( prober - , { "_probe_arch" - , "_probe_xcode" - , "_probe_xcode_sdkver" - , "_probe_ccache"} - - , function (name, result) - -- trace - utils.verbose("checking %s ...: %s", name:gsub("_probe_", ""), utils.ifelse(result, "ok", "no")) - return result - end - + utils.call( { prober._probe_arch + , prober._probe_xcode + , prober._probe_xcode_sdkver + , prober._probe_ccache} + , nil , config) end @@ -179,16 +187,9 @@ end function prober.global() -- call all probe functions - utils.call( prober - , { "_probe_xcode" - , "_probe_ccache"} - - , function (name, result) - -- trace - utils.verbose("checking %s ...: %s", name:gsub("_probe_", ""), utils.ifelse(result, "ok", "no")) - return result - end - + utils.call( { prober._probe_xcode + , prober._probe_ccache} + , nil , global) end diff --git a/xmake/scripts/platform/linux/prober.lua b/xmake/scripts/platform/linux/prober.lua index 70f877bb7..772c0ee66 100644 --- a/xmake/scripts/platform/linux/prober.lua +++ b/xmake/scripts/platform/linux/prober.lua @@ -44,6 +44,9 @@ function prober._probe_arch(configs) -- init the default architecture configs.set("arch", xmake._ARCH) + -- trace + utils.verbose("checking the architecture ... %s", configs.get("arch")) + -- ok return true end @@ -72,6 +75,9 @@ function prober._probe_ccache(configs) configs.set("ccache", false) end + -- trace + utils.verbose("checking for the ccache ... %s", utils.ifelse(ccache_path, ccache_path, "no")) + -- ok return true end @@ -80,16 +86,9 @@ end function prober.config() -- call all probe functions - utils.call( prober - , { "_probe_arch" - , "_probe_ccache"} - - , function (name, result) - -- trace - utils.verbose("checking %s ...: %s", name:gsub("_probe_", ""), utils.ifelse(result, "ok", "no")) - return result - end - + utils.call( { prober._probe_arch + , prober._probe_ccache} + , nil , config) end @@ -97,15 +96,8 @@ end function prober.global() -- call all probe functions - utils.call( prober - , { "_probe_ccache"} - - , function (name, result) - -- trace - utils.verbose("checking %s ...: %s", name:gsub("_probe_", ""), utils.ifelse(result, "ok", "no")) - return result - end - + utils.call( prober._probe_ccache + , nil , global) end diff --git a/xmake/scripts/platform/macosx/prober.lua b/xmake/scripts/platform/macosx/prober.lua index bdee6431e..32e059269 100644 --- a/xmake/scripts/platform/macosx/prober.lua +++ b/xmake/scripts/platform/macosx/prober.lua @@ -44,6 +44,9 @@ function prober._probe_arch(configs) -- init the default architecture configs.set("arch", xmake._ARCH) + -- trace + utils.verbose("checking the architecture ... %s", configs.get("arch")) + -- ok return true end @@ -77,10 +80,14 @@ function prober._probe_xcode(configs) -- probe ok? update it if xcode_dir then + -- save it configs.set("xcode_dir", xcode_dir) + + -- trace + utils.verbose("checking the Xcode application directory ... %s", xcode_dir) else -- failed - utils.error("The Xcode directory is unknown now, please config it first!") + utils.error("checking the Xcode application directory ... no") utils.error(" - xmake config --xcode_dir=xxx") utils.error("or - xmake global --xcode_dir=xxx") return false @@ -115,10 +122,15 @@ function prober._probe_xcode_sdkver(configs) -- probe ok? update it if xcode_sdkver then + + -- save it configs.set("xcode_sdkver", xcode_sdkver) + + -- trace + utils.verbose("checking the Xcode SDK version for %s ... %s", configs.get("plat"), xcode_sdkver) else -- failed - utils.error("The Xcode SDK version is unknown now, please config it first!") + utils.error("checking the Xcode SDK version for %s ... no", configs.get("plat")) utils.error(" - xmake config --xcode_sdkver=xxx") utils.error("or - xmake global --xcode_sdkver=xxx") return false @@ -152,6 +164,9 @@ function prober._probe_ccache(configs) configs.set("ccache", false) end + -- trace + utils.verbose("checking for the ccache ... %s", utils.ifelse(ccache_path, ccache_path, "no")) + -- ok return true end @@ -160,18 +175,11 @@ end function prober.config() -- call all probe functions - utils.call( prober - , { "_probe_arch" - , "_probe_xcode" - , "_probe_xcode_sdkver" - , "_probe_ccache"} - - , function (name, result) - -- trace - utils.verbose("checking %s ...: %s", name:gsub("_probe_", ""), utils.ifelse(result, "ok", "no")) - return result - end - + utils.call( { prober._probe_arch + , prober._probe_xcode + , prober._probe_xcode_sdkver + , prober._probe_ccache} + , nil , config) end @@ -179,16 +187,9 @@ end function prober.global() -- call all probe functions - utils.call( prober - , { "_probe_xcode" - , "_probe_ccache"} - - , function (name, result) - -- trace - utils.verbose("checking %s ...: %s", name:gsub("_probe_", ""), utils.ifelse(result, "ok", "no")) - return result - end - + utils.call( { prober._probe_xcode + , prober._probe_ccache} + , nil , global) end diff --git a/xmake/scripts/platform/windows/prober.lua b/xmake/scripts/platform/windows/prober.lua index bc39f2382..099212179 100644 --- a/xmake/scripts/platform/windows/prober.lua +++ b/xmake/scripts/platform/windows/prober.lua @@ -43,6 +43,9 @@ function prober._probe_arch(configs) -- init the default architecture configs.set("arch", xmake._ARCH) + -- trace + utils.verbose("checking the architecture ... %s", configs.get("arch")) + -- ok return true end @@ -86,10 +89,14 @@ function prober._probe_vs_version(configs) -- probe ok? update it if vs then + -- save it configs.set("vs", vs) + + -- trace + utils.verbose("checking the Microsoft Visual Studio version ... %s", vs) else -- failed - utils.error("The Microsoft Visual Studio is unknown now, please config it first!") + utils.error("checking the Microsoft Visual Studio version ... no") utils.error(" - xmake config --vs=xxx") utils.error("or - xmake global --vs=xxx") return false @@ -191,17 +198,10 @@ end function prober.config() -- call all probe functions - utils.call( prober - , { "_probe_arch" - , "_probe_vs_version" - , "_probe_vs_path"} - - , function (name, result) - -- trace - utils.verbose("checking %s ...: %s", name:gsub("_probe_", ""), utils.ifelse(result, "ok", "no")) - return result - end - + utils.call( { prober._probe_arch + , prober._probe_vs_version + , prober._probe_vs_path} + , nil , config) end @@ -209,16 +209,9 @@ end function prober.global() -- call all probe functions - utils.call( prober - , { "_probe_vs_version" - , "_probe_vs_path"} - - , function (name, result) - -- trace - utils.verbose("checking %s ...: %s", name:gsub("_probe_", ""), utils.ifelse(result, "ok", "no")) - return result - end - + utils.call( { prober._probe_vs_version + , prober._probe_vs_path} + , nil , global) end |
