diff options
| author | ruki <[email protected]> | 2020-09-29 00:18:31 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-09-29 00:18:31 +0800 |
| commit | d662c54d57accd1382c2368e3c7f27832d9ef10d (patch) | |
| tree | 0a9b103c16aab1f8c887b597deeddab9f7e9a709 | |
| parent | 0c52f3a6ab4397c5be94c3293f4ae20d6b7a8b94 (diff) | |
rename other pathes to paths
| -rw-r--r-- | xmake/actions/update/main.lua | 1 | ||||
| -rw-r--r-- | xmake/core/base/interpreter.lua | 68 | ||||
| -rw-r--r-- | xmake/core/base/scopeinfo.lua | 48 | ||||
| -rw-r--r-- | xmake/core/language/language.lua | 6 | ||||
| -rw-r--r-- | xmake/core/package/package.lua | 2 | ||||
| -rw-r--r-- | xmake/core/project/project.lua | 2 | ||||
| -rw-r--r-- | xmake/core/project/target.lua | 34 | ||||
| -rw-r--r-- | xmake/languages/asm/api.lua | 2 | ||||
| -rw-r--r-- | xmake/languages/c++/api.lua | 4 | ||||
| -rw-r--r-- | xmake/languages/cuda/api.lua | 2 | ||||
| -rw-r--r-- | xmake/languages/dlang/api.lua | 2 | ||||
| -rw-r--r-- | xmake/languages/fortran/api.lua | 2 | ||||
| -rw-r--r-- | xmake/languages/golang/api.lua | 2 | ||||
| -rw-r--r-- | xmake/languages/msrc/api.lua | 2 | ||||
| -rw-r--r-- | xmake/languages/objc++/api.lua | 2 | ||||
| -rw-r--r-- | xmake/languages/rust/api.lua | 2 | ||||
| -rw-r--r-- | xmake/languages/swift/api.lua | 2 | ||||
| -rw-r--r-- | xmake/languages/zig/api.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/devel/git/submodule/update.lua | 4 | ||||
| -rw-r--r-- | xmake/plugins/show/info/target.lua | 2 |
20 files changed, 95 insertions, 96 deletions
diff --git a/xmake/actions/update/main.lua b/xmake/actions/update/main.lua index 6e2f9c5c0..40a33255d 100644 --- a/xmake/actions/update/main.lua +++ b/xmake/actions/update/main.lua @@ -26,7 +26,6 @@ import("core.base.process") import("core.base.tty") import("net.http") import("devel.git") -import("devel.git.submodule") import("net.fasturl") import("core.base.privilege") import("privilege.sudo") diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua index bdce75fbc..99ed8e2da 100644 --- a/xmake/core/base/interpreter.lua +++ b/xmake/core/base/interpreter.lua @@ -353,8 +353,8 @@ function interpreter:_api_register_xxx_script(scope_kind, action, ...) self:_api_register_xxx_values(scope_kind, action, implementation, ...) end --- translate api pathes -function interpreter:_api_translate_pathes(values, apiname, infolevel) +-- translate api paths +function interpreter:_api_translate_paths(values, apiname, infolevel) local results = {} for _, p in ipairs(values) do if type(p) ~= "string" or #p == 0 then @@ -1261,8 +1261,8 @@ function interpreter:api_register_add_dictionary(scope_kind, ...) self:_api_register_xxx_values(scope_kind, "add", implementation, ...) end --- register api for set_pathes -function interpreter:api_register_set_pathes(scope_kind, ...) +-- register api for set_paths +function interpreter:api_register_set_paths(scope_kind, ...) -- check assert(self) @@ -1279,31 +1279,31 @@ function interpreter:api_register_set_pathes(scope_kind, ...) extra_config = nil end - -- translate pathes - local pathes = self:_api_translate_pathes(values, "set_" .. name) + -- translate paths + local paths = self:_api_translate_paths(values, "set_" .. name) -- save values - scope[name] = pathes + scope[name] = paths -- save extra config if extra_config then scope["__extra_" .. name] = scope["__extra_" .. name] or {} local extrascope = scope["__extra_" .. name] - for _, value in ipairs(pathes) do + for _, value in ipairs(paths) do extrascope[value] = extra_config end end -- save api source info, e.g. call api() in sourcefile:linenumber - self:_save_sourceinfo_to_scope(scope, name, pathes) + self:_save_sourceinfo_to_scope(scope, name, paths) end -- register implementation self:_api_register_xxx_values(scope_kind, "set", implementation, ...) end --- register api for del_pathes -function interpreter:api_register_del_pathes(scope_kind, ...) +-- register api for del_paths +function interpreter:api_register_del_paths(scope_kind, ...) -- check assert(self) @@ -1311,29 +1311,29 @@ function interpreter:api_register_del_pathes(scope_kind, ...) -- define implementation local implementation = function (self, scope, name, ...) - -- translate pathes + -- translate paths local values = {...} - local pathes = self:_api_translate_pathes(values, "del_" .. name) + local paths = self:_api_translate_paths(values, "del_" .. name) - -- mark these pathes as deleted - local pathes_deleted = {} - for _, pathname in ipairs(pathes) do - table.insert(pathes_deleted, "__del_" .. pathname) + -- mark these paths as deleted + local paths_deleted = {} + for _, pathname in ipairs(paths) do + table.insert(paths_deleted, "__del_" .. pathname) end -- save values - scope[name] = table.join2(scope[name] or {}, pathes_deleted) + scope[name] = table.join2(scope[name] or {}, paths_deleted) -- save api source info, e.g. call api() in sourcefile:linenumber - self:_save_sourceinfo_to_scope(scope, name, pathes) + self:_save_sourceinfo_to_scope(scope, name, paths) end -- register implementation self:_api_register_xxx_values(scope_kind, "del", implementation, ...) end --- register api for add_pathes -function interpreter:api_register_add_pathes(scope_kind, ...) +-- register api for add_paths +function interpreter:api_register_add_paths(scope_kind, ...) -- check assert(self) @@ -1350,23 +1350,23 @@ function interpreter:api_register_add_pathes(scope_kind, ...) extra_config = nil end - -- translate pathes - local pathes = self:_api_translate_pathes(values, "add_" .. name) + -- translate paths + local paths = self:_api_translate_paths(values, "add_" .. name) -- save values - scope[name] = table.join2(scope[name] or {}, pathes) + scope[name] = table.join2(scope[name] or {}, paths) -- save extra config if extra_config then scope["__extra_" .. name] = scope["__extra_" .. name] or {} local extrascope = scope["__extra_" .. name] - for _, value in ipairs(pathes) do + for _, value in ipairs(paths) do extrascope[value] = extra_config end end -- save api source info, e.g. call api() in sourcefile:linenumber - self:_save_sourceinfo_to_scope(scope, name, pathes) + self:_save_sourceinfo_to_scope(scope, name, paths) end -- register implementation @@ -1397,7 +1397,7 @@ end -- -- is_xxx -- , {"is_os", function (interp, ...) end} -- } --- , pathes = +-- , paths = -- { -- -- target.add_xxx -- "target.add_linkdirs" @@ -1524,27 +1524,27 @@ function interpreter:api_builtin_includes(...) local scopes = self._PRIVATE._SCOPES assert(scopes) - -- get all subpathes - local subpathes = table.join(...) + -- get all subpaths + local subpaths = table.join(...) -- find all files - local subpathes_matched = {} - for _, subpath in ipairs(subpathes) do + local subpaths_matched = {} + for _, subpath in ipairs(subpaths) do -- find the given files from the project directory local files = os.match(subpath, not subpath:endswith(".lua")) if files and #files > 0 then - table.join2(subpathes_matched, files) + table.join2(subpaths_matched, files) elseif not path.is_absolute(subpath) then -- attempt to find files from programdir/includes/*.lua files = os.files(path.join(os.programdir(), "includes", subpath)) if files and #files > 0 then - table.join2(subpathes_matched, files) + table.join2(subpaths_matched, files) end end end -- includes all files - for _, subpath in ipairs(subpathes_matched) do + for _, subpath in ipairs(subpaths_matched) do if subpath and type(subpath) == "string" then -- the file path diff --git a/xmake/core/base/scopeinfo.lua b/xmake/core/base/scopeinfo.lua index 83dea5df6..ec9244cb1 100644 --- a/xmake/core/base/scopeinfo.lua +++ b/xmake/core/base/scopeinfo.lua @@ -280,8 +280,8 @@ function _instance:_api_add_dictionary(name, dict_or_key, value) end end --- set the api pathes to the scope info -function _instance:_api_set_pathes(name, ...) +-- set the api paths to the scope info +function _instance:_api_set_paths(name, ...) -- get the scope info local scope = self._INFO @@ -301,27 +301,27 @@ function _instance:_api_set_pathes(name, ...) -- expand values values = table.join(unpack(values)) - -- translate pathes - local pathes = interp:_api_translate_pathes(values, "set_" .. name, 5) + -- translate paths + local paths = interp:_api_translate_paths(values, "set_" .. name, 5) -- save values - scope[name] = self:_api_handle(pathes) + scope[name] = self:_api_handle(paths) -- save extra config if extra_config then scope["__extra_" .. name] = scope["__extra_" .. name] or {} local extrascope = scope["__extra_" .. name] - for _, value in ipairs(pathes) do + for _, value in ipairs(paths) do extrascope[value] = extra_config end end -- save api source info, e.g. call api() in sourcefile:linenumber - self:_api_save_sourceinfo_to_scope(scope, name, pathes) + self:_api_save_sourceinfo_to_scope(scope, name, paths) end --- add the api pathes to the scope info -function _instance:_api_add_pathes(name, ...) +-- add the api paths to the scope info +function _instance:_api_add_paths(name, ...) -- get the scope info local scope = self._INFO @@ -341,27 +341,27 @@ function _instance:_api_add_pathes(name, ...) -- expand values values = table.join(unpack(values)) - -- translate pathes - local pathes = interp:_api_translate_pathes(values, "add_" .. name, 5) + -- translate paths + local paths = interp:_api_translate_paths(values, "add_" .. name, 5) -- save values - scope[name] = self:_api_handle(table.join2(table.wrap(scope[name]), pathes)) + scope[name] = self:_api_handle(table.join2(table.wrap(scope[name]), paths)) -- save extra config if extra_config then scope["__extra_" .. name] = scope["__extra_" .. name] or {} local extrascope = scope["__extra_" .. name] - for _, value in ipairs(pathes) do + for _, value in ipairs(paths) do extrascope[value] = extra_config end end -- save api source info, e.g. call api() in sourcefile:linenumber - self:_api_save_sourceinfo_to_scope(scope, name, pathes) + self:_api_save_sourceinfo_to_scope(scope, name, paths) end --- remove the api pathes to the scope info -function _instance:_api_del_pathes(name, ...) +-- remove the api paths to the scope info +function _instance:_api_del_paths(name, ...) -- get the scope info local scope = self._INFO @@ -372,20 +372,20 @@ function _instance:_api_del_pathes(name, ...) -- expand values values = table.join(...) - -- translate pathes - local pathes = interp:_api_translate_pathes(values, "del_" .. name, 5) + -- translate paths + local paths = interp:_api_translate_paths(values, "del_" .. name, 5) - -- mark these pathes as deleted - local pathes_deleted = {} - for _, pathname in ipairs(pathes) do - table.insert(pathes_deleted, "__del_" .. pathname) + -- mark these paths as deleted + local paths_deleted = {} + for _, pathname in ipairs(paths) do + table.insert(paths_deleted, "__del_" .. pathname) end -- save values - scope[name] = self:_api_handle(table.join2(table.wrap(scope[name]), pathes_deleted)) + scope[name] = self:_api_handle(table.join2(table.wrap(scope[name]), paths_deleted)) -- save api source info, e.g. call api() in sourcefile:linenumber - self:_api_save_sourceinfo_to_scope(scope, name, pathes) + self:_api_save_sourceinfo_to_scope(scope, name, paths) end -- get the scope kind diff --git a/xmake/core/language/language.lua b/xmake/core/language/language.lua index c7acc8b24..a1da35305 100644 --- a/xmake/core/language/language.lua +++ b/xmake/core/language/language.lua @@ -408,18 +408,18 @@ function language.apis() end -- merge apis for each language - local apis = {values = {}, pathes = {}, custom = {}, dictionary = {}} + local apis = {values = {}, paths = {}, custom = {}, dictionary = {}} for name, instance in pairs(languages) do local instance_apis = instance:get("apis") if instance_apis then table.join2(apis.values, table.wrap(instance_apis.values)) - table.join2(apis.pathes, table.wrap(instance_apis.pathes)) + table.join2(apis.paths, table.wrap(instance_apis.paths)) table.join2(apis.custom, table.wrap(instance_apis.custom)) table.join2(apis.dictionary, table.wrap(instance_apis.dictionary)) end end apis.values = table.unique(apis.values) - apis.pathes = table.unique(apis.pathes) + apis.paths = table.unique(apis.paths) apis.custom = table.unique(apis.custom) -- ok diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 66b5e6121..5eeb8fc69 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -367,7 +367,7 @@ function _instance:manifest_save() -- save variables local vars = {} local apis = language.apis() - for _, apiname in ipairs(table.join(apis.values, apis.pathes)) do + for _, apiname in ipairs(table.join(apis.values, apis.paths)) do if apiname:startswith("package.add_") or apiname:startswith("package.set_") then local name = apiname:sub(13) local value = self:get(name) diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index 0f600477c..8de824a32 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -636,7 +636,7 @@ function project.apis() , "add_requires" , "add_repositories" } - , pathes = + , paths = { -- add_xxx "add_packagedirs" diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 472102f09..5ee5d54c3 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -158,7 +158,7 @@ function _instance:_copiedfiles(filetype, outputdir, pathfilter) -- get the extra information local extrainfo = table.wrap(self:get("__extra_" .. filetype)) - -- get the source pathes and destinate pathes + -- get the source paths and destinate paths local srcfiles = {} local dstfiles = {} local fileinfos = {} @@ -171,15 +171,15 @@ function _instance:_copiedfiles(filetype, outputdir, pathfilter) end -- remove '(' and ')' - local srcpathes = copiedfile:gsub("[%(%)]", "") - if srcpathes then + local srcpaths = copiedfile:gsub("[%(%)]", "") + if srcpaths then - -- get the source pathes - srcpathes = os.match(srcpathes) - if srcpathes and #srcpathes > 0 then + -- get the source paths + srcpaths = os.match(srcpaths) + if srcpaths and #srcpaths > 0 then -- add the source copied files - table.join2(srcfiles, srcpathes) + table.join2(srcfiles, srcpaths) -- the copied directory exists? if outputdir then @@ -191,7 +191,7 @@ function _instance:_copiedfiles(filetype, outputdir, pathfilter) local prefixdir = fileinfo.prefixdir -- add the destinate copied files - for _, srcpath in ipairs(srcpathes) do + for _, srcpath in ipairs(srcpaths) do -- get the destinate directory local dstdir = outputdir @@ -1260,7 +1260,7 @@ function _instance:headerfiles(outputdir, only_deprecated) -- get the extra information local extrainfo = table.wrap(self:get("__extra_headerfiles")) - -- get the source pathes and destinate pathes + -- get the source paths and destinate paths local srcheaders = {} local dstheaders = {} for _, header in ipairs(table.wrap(headers)) do @@ -1272,15 +1272,15 @@ function _instance:headerfiles(outputdir, only_deprecated) end -- remove '(' and ')' - local srcpathes = header:gsub("[%(%)]", "") - if srcpathes then + local srcpaths = header:gsub("[%(%)]", "") + if srcpaths then - -- get the source pathes - srcpathes = os.match(srcpathes) - if srcpathes then + -- get the source paths + srcpaths = os.match(srcpaths) + if srcpaths then -- add the source headers - table.join2(srcheaders, srcpathes) + table.join2(srcheaders, srcpaths) -- get the destinate directories if the install directory exists if headerdir then @@ -1289,7 +1289,7 @@ function _instance:headerfiles(outputdir, only_deprecated) local prefixdir = (extrainfo[header] or {}).prefixdir -- add the destinate headers - for _, srcpath in ipairs(srcpathes) do + for _, srcpath in ipairs(srcpaths) do -- get the destinate directory local dstdir = headerdir @@ -1890,7 +1890,7 @@ function target.apis() , "target.add_values" , "target.add_runenvs" } - , pathes = + , paths = { -- target.set_xxx "target.set_targetdir" diff --git a/xmake/languages/asm/api.lua b/xmake/languages/asm/api.lua index 23b1a5d5e..2e25cbc16 100644 --- a/xmake/languages/asm/api.lua +++ b/xmake/languages/asm/api.lua @@ -69,7 +69,7 @@ function apis() , "toolchain.add_linkdirs" , "toolchain.add_includedirs" } - _g.pathes = + _g.paths = { -- target.add_xxx "target.add_headers" -- TODO deprecated diff --git a/xmake/languages/c++/api.lua b/xmake/languages/c++/api.lua index 1c33983a7..e2084d138 100644 --- a/xmake/languages/c++/api.lua +++ b/xmake/languages/c++/api.lua @@ -215,7 +215,7 @@ function apis() , "package.add_frameworks" , "package.add_rpathdirs" , "package.add_linkdirs" - , "package.add_includedirs" --@note we need not uses pathes for package, see https://github.com/xmake-io/xmake/issues/717 + , "package.add_includedirs" --@note we need not uses paths for package, see https://github.com/xmake-io/xmake/issues/717 , "package.add_frameworkdirs" -- toolchain.add_xxx , "toolchain.add_links" @@ -234,7 +234,7 @@ function apis() , "toolchain.add_includedirs" , "toolchain.add_frameworkdirs" } - _g.pathes = + _g.paths = { -- target.set_xxx "target.set_headerdir" -- TODO deprecated diff --git a/xmake/languages/cuda/api.lua b/xmake/languages/cuda/api.lua index d7c9d95a8..c369fd7cc 100644 --- a/xmake/languages/cuda/api.lua +++ b/xmake/languages/cuda/api.lua @@ -61,7 +61,7 @@ function apis() , "toolchain.add_undefines" , "toolchain.add_rpathdirs" } - _g.pathes = + _g.paths = { -- target.add_xxx "target.add_linkdirs" diff --git a/xmake/languages/dlang/api.lua b/xmake/languages/dlang/api.lua index 00a484cd7..9f6f92b3e 100644 --- a/xmake/languages/dlang/api.lua +++ b/xmake/languages/dlang/api.lua @@ -61,7 +61,7 @@ function apis() , "toolchain.add_linkdirs" , "toolchain.add_includedirs" } - _g.pathes = + _g.paths = { -- target.add_xxx "target.add_linkdirs" diff --git a/xmake/languages/fortran/api.lua b/xmake/languages/fortran/api.lua index a576ec2a3..69eae4ae2 100644 --- a/xmake/languages/fortran/api.lua +++ b/xmake/languages/fortran/api.lua @@ -61,7 +61,7 @@ function apis() , "toolchain.add_linkdirs" , "toolchain.add_includedirs" } - _g.pathes = + _g.paths = { -- target.add_xxx "target.add_linkdirs" diff --git a/xmake/languages/golang/api.lua b/xmake/languages/golang/api.lua index 5801629f6..0c64acf2f 100644 --- a/xmake/languages/golang/api.lua +++ b/xmake/languages/golang/api.lua @@ -43,7 +43,7 @@ function apis() , "toolchain.add_ldflags" , "toolchain.add_arflags" } - _g.pathes = + _g.paths = { -- target.add_xxx "target.add_linkdirs" diff --git a/xmake/languages/msrc/api.lua b/xmake/languages/msrc/api.lua index f114934d6..5c97212d7 100644 --- a/xmake/languages/msrc/api.lua +++ b/xmake/languages/msrc/api.lua @@ -31,7 +31,7 @@ function apis() -- toolchain.add_xxx , "toolchain.add_mrcflags" } - _g.pathes = + _g.paths = { -- target.add_xxx "target.add_includedirs" diff --git a/xmake/languages/objc++/api.lua b/xmake/languages/objc++/api.lua index 9b8c6a1a5..5d5a3ae0b 100644 --- a/xmake/languages/objc++/api.lua +++ b/xmake/languages/objc++/api.lua @@ -81,7 +81,7 @@ function apis() , "toolchain.add_includedirs" , "toolchain.add_frameworkdirs" } - _g.pathes = + _g.paths = { -- target.set_xxx "target.set_headerdir" -- TODO deprecated diff --git a/xmake/languages/rust/api.lua b/xmake/languages/rust/api.lua index 4e787c689..b7864eae2 100644 --- a/xmake/languages/rust/api.lua +++ b/xmake/languages/rust/api.lua @@ -43,7 +43,7 @@ function apis() , "toolchain.add_shflags" , "toolchain.add_rpathdirs" } - _g.pathes = + _g.paths = { -- target.add_xxx "target.add_linkdirs" diff --git a/xmake/languages/swift/api.lua b/xmake/languages/swift/api.lua index 9dfacc1a0..013fb9d59 100644 --- a/xmake/languages/swift/api.lua +++ b/xmake/languages/swift/api.lua @@ -52,7 +52,7 @@ function apis() , "toolchain.add_frameworks" , "toolchain.add_rpathdirs" } - _g.pathes = + _g.paths = { -- target.add_xxx "target.add_linkdirs" diff --git a/xmake/languages/zig/api.lua b/xmake/languages/zig/api.lua index cb24c64ab..7e36e2ebf 100644 --- a/xmake/languages/zig/api.lua +++ b/xmake/languages/zig/api.lua @@ -59,7 +59,7 @@ function apis() , "toolchain.add_rpathdirs" , "toolchain.add_linkdirs" } - _g.pathes = + _g.paths = { -- target.add_xxx "target.add_linkdirs" diff --git a/xmake/modules/devel/git/submodule/update.lua b/xmake/modules/devel/git/submodule/update.lua index 106b4ef62..1d41985f9 100644 --- a/xmake/modules/devel/git/submodule/update.lua +++ b/xmake/modules/devel/git/submodule/update.lua @@ -54,8 +54,8 @@ function main(opt) table.insert(argv, "--reference") table.insert(argv, opt.reference) end - if opt.paths or opt.pathes then - table.join2(argv, opt.paths or opt.pathes) + if opt.paths then + table.join2(argv, opt.paths) end -- enter repository directory diff --git a/xmake/plugins/show/info/target.lua b/xmake/plugins/show/info/target.lua index 807819968..778f46e41 100644 --- a/xmake/plugins/show/info/target.lua +++ b/xmake/plugins/show/info/target.lua @@ -56,7 +56,7 @@ function main(name) if packages then cprint(" ${color.dump.string}packages${clear}: %s", table.concat(table.wrap(packages), ", ")) end - for _, apiname in ipairs(table.join(language.apis().values, language.apis().pathes)) do + for _, apiname in ipairs(table.join(language.apis().values, language.apis().paths)) do if apiname:startswith("target.") then local valuename = apiname:split('.add_', {plain = true})[2] if valuename then |
