diff options
| author | wtz <[email protected]> | 2023-07-19 12:35:52 +0800 |
|---|---|---|
| committer | wtz <[email protected]> | 2023-07-19 12:35:52 +0800 |
| commit | f75224a8435d0eb9cdda79f8bc571eeef25a8e33 (patch) | |
| tree | 278e00b17c8f5558df1c1a21f1204078ea62a58f | |
| parent | ca83e9a78b7f2d45e833fa705c880867ad2381c6 (diff) | |
Fix grammar
151 files changed, 270 insertions, 270 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8169ea088..26a1c5e86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1444,7 +1444,7 @@ ### Bugs fixed * [#41](https://github.com/waruqi/xmake/issues/41): Fix checker bug for windows -* [#43](https://github.com/waruqi/xmake/issues/43): Avoid to generate unnecessary .xmake directory +* [#43](https://github.com/waruqi/xmake/issues/43): Avoid generating unnecessary .xmake directory * Add c++ stl search directories for android * Fix compile error for rhel 5.10 * Fix `os.iorun` bug @@ -835,7 +835,7 @@ _get_abstract_flag_for_gcc_clang() { string_replace "${value}" "\$ORIGIN" "@loader_path"; value="${_ret}" flag="-Xlinker -rpath -Xlinker ${value}" else - # escape $ORIGIN in makefile, TODO we need also handle it for ninja + # escape $ORIGIN in makefile, TODO we also need to handle it for ninja string_replace "${value}" "@loader_path" '$$ORIGIN'; value="${_ret}" if is_plat "bsd"; then flag="-Wl,-zorigin -Wl,-rpath='${value}'" @@ -1835,7 +1835,7 @@ _get_target_flags() { _add_target_filepaths() { local key="$1" shift - # we need avoid escape `*` automatically in for-loop + # we need to avoid escape `*` automatically in for-loop local file="" string_replace "${@}" "\*" "?"; local list="${_ret}" if test_eq "${key}" "files"; then @@ -2079,7 +2079,7 @@ add_configfiles() { _add_target_filepaths "configfiles" "$@" } -# add defines in target +# add definitions in target add_defines() { local define="" if ${_loading_targets} && test_z "${_xmake_sh_option_current}"; then diff --git a/core/src/demo/xmake.lua b/core/src/demo/xmake.lua index 6f5e3e431..fa290a2a9 100644 --- a/core/src/demo/xmake.lua +++ b/core/src/demo/xmake.lua @@ -11,16 +11,16 @@ target("demo") -- make as a binary set_kind("binary") - -- add defines + -- add definitions add_defines("__tb_prefix__=\"xmake\"") -- add includes directory add_includedirs("$(projectdir)", "$(projectdir)/src") - -- add the common source files + -- add common source files add_files("**.c") - -- add the resource files (it will be enabled after publishing new version) + -- add resource files (it will be enabled after publishing new version) if is_plat("windows") then add_files("*.rc") end diff --git a/core/src/demo/xmake.sh b/core/src/demo/xmake.sh index 9233f1c30..d91b50d99 100755 --- a/core/src/demo/xmake.sh +++ b/core/src/demo/xmake.sh @@ -6,7 +6,7 @@ target "demo" set_basename "xmake" set_targetdir "${buildir}" - # add defines + # add definitions add_defines "__tb_prefix__=\"xmake\"" # add includes directory diff --git a/core/src/lua/xmake.lua b/core/src/lua/xmake.lua index 048d7305e..44c797aab 100644 --- a/core/src/lua/xmake.lua +++ b/core/src/lua/xmake.lua @@ -19,7 +19,7 @@ target("lua") add_files("lua/loslib.c") end - -- add defines + -- add definitions add_defines("LUA_COMPAT_5_1", "LUA_COMPAT_5_2", "LUA_COMPAT_5_3", {public = true}) if is_plat("windows") then add_defines("LUA_USE_WINDOWS") diff --git a/core/src/lua/xmake.sh b/core/src/lua/xmake.sh index f34dd53f2..78e05bd21 100755 --- a/core/src/lua/xmake.sh +++ b/core/src/lua/xmake.sh @@ -42,7 +42,7 @@ target "lua" add_files "lua/lvm.c" add_files "lua/lzio.c" - # add defines + # add definitions add_defines "LUA_COMPAT_5_1" "LUA_COMPAT_5_2" "LUA_COMPAT_5_3" "{public}" if is_plat "mingw"; then add_defines "LUA_USE_WINDOWS" diff --git a/core/src/lz4/xmake.lua b/core/src/lz4/xmake.lua index 257aefff8..6f55f9bb2 100644 --- a/core/src/lz4/xmake.lua +++ b/core/src/lz4/xmake.lua @@ -16,6 +16,6 @@ target("lz4") -- add the common source files add_files("lz4/lib/*.c|lz4file.c") - -- add defines + -- add definitions add_defines("XXH_NAMESPACE=LZ4_") diff --git a/core/src/pdcurses/xmake.lua b/core/src/pdcurses/xmake.lua index 4fd2bb96d..1cafaf996 100644 --- a/core/src/pdcurses/xmake.lua +++ b/core/src/pdcurses/xmake.lua @@ -15,7 +15,7 @@ target("pdcurses") -- add the common source files add_files("pdcurses/pdcurses/*.c", "pdcurses/win32/*.c") - -- add defines + -- add definitions add_defines("PDC_WIDE") -- set languages diff --git a/core/src/xmake/curses/curses.c b/core/src/xmake/curses/curses.c index e185fd7b6..c7b67aa85 100644 --- a/core/src/xmake/curses/curses.c +++ b/core/src/xmake/curses/curses.c @@ -830,7 +830,7 @@ int xm_lua_curses_register(lua_State* lua, const char* module) /* since version 5.4, the ncurses library decides how to interpret non-ASCII data using the nl_langinfo function. * that means that you have to call setlocale() in the application and encode Unicode strings using one of the system’s available encodings. * - * and we need link libncurses_window.so for drawing vline, hline characters + * and we need to link libncurses_window.so for drawing vline, hline characters */ #if defined(NCURSES_VERSION) setlocale(LC_ALL, ""); diff --git a/core/src/xmake/engine.h b/core/src/xmake/engine.h index af0db9a0c..cc5a533ca 100644 --- a/core/src/xmake/engine.h +++ b/core/src/xmake/engine.h @@ -71,7 +71,7 @@ tb_void_t xm_engine_exit(xm_engine_ref_t engine); */ tb_int_t xm_engine_main(xm_engine_ref_t engine, tb_int_t argc, tb_char_t** argv, tb_char_t** taskargv); -/*! register lni modules in the engine, @note we need call it in lni_initalizer() +/*! register lni modules in the engine, @note we need to call it in lni_initalizer() * * @param engine the engine * @param module the lni module name diff --git a/core/src/xmake/io/iscygpty.c b/core/src/xmake/io/iscygpty.c index fc5a5b8da..49850e25c 100644 --- a/core/src/xmake/io/iscygpty.c +++ b/core/src/xmake/io/iscygpty.c @@ -57,7 +57,7 @@ #endif /* USE_FILEEXTD */ #if _WIN32_WINNT >= 0x0600 -# define USE_DYNFILEID // we need enable it for supporting xp +# define USE_DYNFILEID // we need to enable it for supporting xp #endif #ifdef USE_DYNFILEID typedef BOOL (WINAPI *pfnGetFileInformationByHandleEx)( diff --git a/core/src/xmake/lz4/prefix.h b/core/src/xmake/lz4/prefix.h index 7efdc71d3..d8f052795 100644 --- a/core/src/xmake/lz4/prefix.h +++ b/core/src/xmake/lz4/prefix.h @@ -33,7 +33,7 @@ * types */ -// we need define LZ4_byte if < 1.9.3 +// we need to define LZ4_byte if < 1.9.3 #if defined(LZ4_VERSION_NUMBER) && LZ4_VERSION_NUMBER < (1 * 100 * 100 + 9 * 100 + 3) # if defined(__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) # include <stdint.h> diff --git a/core/src/xmake/process/openv.c b/core/src/xmake/process/openv.c index 79c8986bb..21add6d55 100644 --- a/core/src/xmake/process/openv.c +++ b/core/src/xmake/process/openv.c @@ -329,7 +329,7 @@ tb_int_t xm_process_openv(lua_State* lua) // set the new environments if (envn > 0) attr.envp = envs; - /* we need ignore SIGINT and SIGQUIT if we enter exclusive mode + /* we need to ignore SIGINT and SIGQUIT if we enter exclusive mode * @see https://github.com/xmake-io/xmake/discussions/2893 */ #if defined(SIGINT) diff --git a/core/src/xmake/xmake.lua b/core/src/xmake/xmake.lua index d4e11040e..03e733c9a 100644 --- a/core/src/xmake/xmake.lua +++ b/core/src/xmake/xmake.lua @@ -15,7 +15,7 @@ target("xmake") add_deps("pdcurses") end - -- add defines + -- add definitions add_defines("__tb_prefix__=\"xmake\"") if is_mode("debug") then add_defines("__tb_debug__", {public = true}) @@ -49,7 +49,7 @@ target("xmake") add_options("curses") end - -- add defines + -- add definitions if is_plat("windows") then add_defines("UNICODE", "_UNICODE") end diff --git a/core/src/xmake/xmake.sh b/core/src/xmake/xmake.sh index dc45ecbca..a813cf078 100755 --- a/core/src/xmake/xmake.sh +++ b/core/src/xmake/xmake.sh @@ -36,7 +36,7 @@ target "xmake" # add options add_options "readline" "curses" "{public}" - # add defines + # add definitions add_defines "__tb_prefix__=\"xmake\"" if is_mode "debug"; then add_defines "__tb_debug__" "{public}" diff --git a/core/xmake.lua b/core/xmake.lua index 45d7ac5f4..dcbab5cf6 100644 --- a/core/xmake.lua +++ b/core/xmake.lua @@ -7,7 +7,7 @@ set_version("2.8.1", {build = "%Y%m%d"}) -- set xmake min version set_xmakever("2.2.3") --- set warning all as error +-- set all warnings as errors set_warnings("all", "error") -- set language: c99, c++11 @@ -25,7 +25,7 @@ end -- disable some compiler errors add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing", "-Wno-error=nullability-completeness", "-Wno-error=parentheses-equality") --- add defines +-- add definitions add_defines("_GNU_SOURCE=1", "_FILE_OFFSET_BITS=64", "_LARGEFILE_SOURCE") -- add vectorexts diff --git a/core/xmake.sh b/core/xmake.sh index 6108f3f58..7c4ff5337 100755 --- a/core/xmake.sh +++ b/core/xmake.sh @@ -9,7 +9,7 @@ set_warnings "all" # set language: c99 set_languages "c99" -# add defines +# add definitions add_defines "_GNU_SOURCE=1" "_FILE_OFFSET_BITS=64" "_LARGEFILE_SOURCE" # disable some compiler errors diff --git a/tests/apis/add_allowedxxx/xmake.lua b/tests/apis/add_allowedxxx/xmake.lua index 963007b99..d15f0ee32 100644 --- a/tests/apis/add_allowedxxx/xmake.lua +++ b/tests/apis/add_allowedxxx/xmake.lua @@ -55,7 +55,7 @@ target("test") -- -- add macro definition -- add_defines("NDEBUG", "_GNU_SOURCE=1") -- --- -- set warning all as error +-- -- set all warnings as errors -- set_warnings("all", "error") -- -- -- set language: c99, c++11 diff --git a/tests/modules/process/process_autoexit.lua b/tests/modules/process/process_autoexit.lua index 048e47c06..c7d56a286 100644 --- a/tests/modules/process/process_autoexit.lua +++ b/tests/modules/process/process_autoexit.lua @@ -9,6 +9,6 @@ function main(cmd) end) end -- check processes status after exiting - -- we need terminate all unclosed processes automatically after parent process is exited + -- we need to terminate all unclosed processes automatically after parent process is exited -- ps aux | grep sleep end diff --git a/tests/modules/process/process_killed.lua b/tests/modules/process/process_killed.lua index ed412e780..5d7045647 100644 --- a/tests/modules/process/process_killed.lua +++ b/tests/modules/process/process_killed.lua @@ -7,7 +7,7 @@ function main(cmd) -- @note we need test xx.bat cmd on windows local proc = process.open(cmd or "xmake l os.sleep 60000") print("%s: wait ..", proc) - -- we need terminate all unclosed processes automatically after parent process is exited after do ctrl-c + -- we need to terminate all unclosed processes automatically after parent process is exited after do ctrl-c proc:wait(-1) print("%s: wait ok", proc) proc:close() diff --git a/tests/modules/string/serialize/test.lua b/tests/modules/string/serialize/test.lua index dfbd01c09..47dbc776d 100644 --- a/tests/modules/string/serialize/test.lua +++ b/tests/modules/string/serialize/test.lua @@ -63,7 +63,7 @@ function test_function(t) function f() return x end -- fenv will restore if xmake.luajit() then - -- TODO we need fix it for lua backend + -- TODO we need to fix it for lua backend t:are_same(roundtrip(f)(), x) end diff --git a/tests/projects/linux/bpf/minimal/test.lua b/tests/projects/linux/bpf/minimal/test.lua index 474060ab0..4be411b32 100644 --- a/tests/projects/linux/bpf/minimal/test.lua +++ b/tests/projects/linux/bpf/minimal/test.lua @@ -1,6 +1,6 @@ function main(t) if is_host("linux") and os.arch() == "x86_64" then - -- TODO, we need wait fix of linux kernel + -- TODO, we need to wait fix of linux kernel if linuxos.name() == "archlinux" then return end diff --git a/tests/projects/windows/driver/kmdf/serial/read.c b/tests/projects/windows/driver/kmdf/serial/read.c index ab745fdd7..6f138d9d3 100644 --- a/tests/projects/windows/driver/kmdf/serial/read.c +++ b/tests/projects/windows/driver/kmdf/serial/read.c @@ -1736,7 +1736,7 @@ Return Value: //
// Since we (essentially) reduced the percentage of the interrupt
- // buffer being full, we need to handle any flow control.
+ // buffer being full, we need to handle any flow of control.
//
SerialHandleReducedIntBuffer(extension);
diff --git a/tests/projects/windows/driver/wdm/msdsm/intrface.c b/tests/projects/windows/driver/wdm/msdsm/intrface.c index eeebf7f93..4a390c212 100644 --- a/tests/projects/windows/driver/wdm/msdsm/intrface.c +++ b/tests/projects/windows/driver/wdm/msdsm/intrface.c @@ -3720,8 +3720,8 @@ Return Value: //
// This indicates that the request is being retried. So we need to:
// 1. Update old path's and new path's request count
- // 2. If the old path was supposed to be removed, check if there are
- // no more requests are outstanding, and if yes, remove the path
+ // 2. If the old path was supposed to be removed, check if there is
+ // no more outstanding request, and if so, remove the path
//
irpStack = IoGetCurrentIrpStackLocation(irp);
diff --git a/xmake/actions/build/build.lua b/xmake/actions/build/build.lua index f79f6fe37..87dda4857 100644 --- a/xmake/actions/build/build.lua +++ b/xmake/actions/build/build.lua @@ -206,7 +206,7 @@ function _add_batchjobs_for_target_and_deps(batchjobs, rootjob, jobrefs, target) end end --- get batch jobs, @note we need export it for private.diagnosis.dump_buildjobs +-- get batch jobs, @note we need to export it for private.diagnosis.dump_buildjobs function get_batchjobs(targetname, group_pattern) -- get root targets diff --git a/xmake/actions/build/cleaner.lua b/xmake/actions/build/cleaner.lua index 0f47ffeb3..7c1eaed4b 100644 --- a/xmake/actions/build/cleaner.lua +++ b/xmake/actions/build/cleaner.lua @@ -36,7 +36,7 @@ function cleanup() return end - -- mark as posted first, avoid to post it repeatly + -- mark as posted first, avoid posting it repeatly io.writefile(markfile, "ok") -- init argument list diff --git a/xmake/actions/build/kinds/binary.lua b/xmake/actions/build/kinds/binary.lua index 26544c311..55454f262 100644 --- a/xmake/actions/build/kinds/binary.lua +++ b/xmake/actions/build/kinds/binary.lua @@ -157,7 +157,7 @@ function main(batchjobs, rootjob, target) _link_target(target, {progress = (index * 100) / total}) end, {rootjob = rootjob}) - -- we need only return and depend the link job for each target, + -- we only need to return and depend the link job for each target, -- so we can compile the source files for each target in parallel -- -- unless call set_policy("build.across_targets_in_parallel", false) to disable to build across targets in parallel. diff --git a/xmake/actions/build/kinds/object.lua b/xmake/actions/build/kinds/object.lua index df24db2cb..35ae830b2 100644 --- a/xmake/actions/build/kinds/object.lua +++ b/xmake/actions/build/kinds/object.lua @@ -204,7 +204,7 @@ function _add_batchjobs_for_group(batchjobs, rootjob, target, group, suffix) if item.target then _add_batchjobs_for_target(batchjobs, rootjob, target, sourcebatch, suffix) end - -- override on_xxx script in target? we need ignore rule scripts + -- override on_xxx script in target? we need to ignore rule scripts if item.rule and (suffix or not _has_scripts_for_target(target, suffix)) then _add_batchjobs_for_rule(batchjobs, rootjob, target, sourcebatch, suffix) end diff --git a/xmake/actions/build/kinds/shared.lua b/xmake/actions/build/kinds/shared.lua index 99a6d1db5..cc9957ca9 100644 --- a/xmake/actions/build/kinds/shared.lua +++ b/xmake/actions/build/kinds/shared.lua @@ -172,7 +172,7 @@ function main(batchjobs, rootjob, target) _link_target(target, {progress = (index * 100) / total}) end, {rootjob = rootjob}) - -- we need only return and depend the link job for each target, + -- we only need to return and depend the link job for each target, -- so we can compile the source files for each target in parallel -- -- unless call set_policy("build.across_targets_in_parallel", false) to disable to build across targets in parallel. diff --git a/xmake/actions/build/kinds/static.lua b/xmake/actions/build/kinds/static.lua index 56a900572..644710154 100644 --- a/xmake/actions/build/kinds/static.lua +++ b/xmake/actions/build/kinds/static.lua @@ -172,7 +172,7 @@ function main(batchjobs, rootjob, target) _link_target(target, {progress = (index * 100) / total}) end, {rootjob = rootjob}) - -- we need only return and depend the link job for each target, + -- we only need to return and depend the link job for each target, -- so we can compile the source files for each target in parallel -- -- unless call set_policy("build.across_targets_in_parallel", false) to disable to build across targets in parallel. diff --git a/xmake/actions/build/main.lua b/xmake/actions/build/main.lua index 54ec2e9e9..58456ba70 100644 --- a/xmake/actions/build/main.lua +++ b/xmake/actions/build/main.lua @@ -194,7 +194,7 @@ function main() { function (errors) - -- maybe it's unreachable when building fails, so we need also os.atexit() + -- maybe it's unreachable when building fails, so we also need os.atexit() -- @see https://github.com/xmake-io/xmake/issues/3401 _on_exit(false, errors) diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua index bfe69da6d..70378ebfb 100644 --- a/xmake/actions/config/main.lua +++ b/xmake/actions/config/main.lua @@ -90,8 +90,8 @@ function _need_check(changed) changed = true end - -- xmake has been updated? force to check config again - -- we need clean the dirty config cache of the old version + -- Has xmake been updated? force to check config again + -- we need to clean the dirty config cache of the old version if not changed then if os.mtime(path.join(os.programdir(), "core", "main.lua")) > os.mtime(config.filepath()) then changed = true @@ -216,7 +216,7 @@ function main(opt) return remote_build_action() end - -- avoid to run this task repeatly + -- avoid running this task repeatly opt = opt or {} if _g.configured then return end _g.configured = true @@ -271,7 +271,7 @@ force to build in current directory via run `xmake -P .`]], os.projectdir()) local importfile = option.get("import") if importfile then assert(os.isfile(importfile), "%s not found!", importfile) - -- we need use readonly, @see https://github.com/xmake-io/xmake/issues/2278 + -- we need to use readonly, @see https://github.com/xmake-io/xmake/issues/2278 local import_configs = io.load(importfile) if import_configs then for name, value in pairs(import_configs) do @@ -290,7 +290,7 @@ force to build in current directory via run `xmake -P .`]], os.projectdir()) options = options or options_history end for name, value in pairs(options) do - -- options is changed by argument options? + -- Is options changed by argument options? options_changed = options_changed or options_history[name] ~= value -- @note override it and mark as readonly (highest priority) config.set(name, value, {readonly = true}) @@ -419,7 +419,7 @@ force to build in current directory via run `xmake -P .`]], os.projectdir()) _export_configs() end - -- we need save it and enable external working mode + -- we need to save it and enable external working mode -- if we configure the given project directory -- -- @see https://github.com/xmake-io/xmake/issues/3342 diff --git a/xmake/actions/config/menuconf.lua b/xmake/actions/config/menuconf.lua index cbc91dffd..85626533c 100644 --- a/xmake/actions/config/menuconf.lua +++ b/xmake/actions/config/menuconf.lua @@ -360,7 +360,7 @@ function app:_save_configs(configs) end end --- configs have been changed? +-- Have configs been changed? function app:_configs_changed() return self._CONFIGS_CHANGED end diff --git a/xmake/actions/service/main.lua b/xmake/actions/service/main.lua index 9b4df5865..61bc06ea2 100644 --- a/xmake/actions/service/main.lua +++ b/xmake/actions/service/main.lua @@ -38,8 +38,8 @@ import("private.service.show_logs") import("private.service.show_status") function main() - -- @note we need load server config before loading client config, - -- because we need same local token in both configs + -- @note we need the load server config before loading the client config, + -- because we need the same local token in both configs server_config.load() client_config.load() if option.get("start") then diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua index b82b71bcd..bb41831f7 100644 --- a/xmake/core/base/interpreter.lua +++ b/xmake/core/base/interpreter.lua @@ -92,7 +92,7 @@ function interpreter._merge_root_scope(root, root_prev, override) root_prev = root_prev or {} for scope_kind_and_name, _ in pairs(root or {}) do -- only merge sub-scope for each kind("target@@xxxx") or __rootkind - -- we need ignore the sub-root scope e.g. target{} after fetching root scope + -- we need to ignore the sub-root scope e.g. target{} after fetching root scope -- if scope_kind_and_name:find("@@", 1, true) or scope_kind_and_name == "__rootkind" then local scope_values = root_prev[scope_kind_and_name] or {} @@ -481,7 +481,7 @@ function interpreter:_handle(scope, deduplicate, enable_filter) -- filter values -- - -- @note we need do filter before removing repeat values + -- @note we need to do filter before removing repeat values -- https://github.com/xmake-io/xmake/issues/1732 if enable_filter then values = self:_filter(values) @@ -1080,7 +1080,7 @@ function interpreter:api_register_set_values(scope_kind, ...) extra_config = nil end - -- @note we need mark table value as meta object to avoid wrap/unwrap + -- @note we need to mark table value as meta object to avoid wrap/unwrap -- if these values cannot be expanded, especially when there is only one value -- -- e.g. set_shflags({"-Wl,-exported_symbols_list", exportfile}, {force = true, expand = false}) @@ -1130,7 +1130,7 @@ function interpreter:api_register_add_values(scope_kind, ...) extra_config = nil end - -- @note we need mark table value as meta object to avoid wrap/unwrap + -- @note we need to mark table value as meta object to avoid wrap/unwrap -- if these values cannot be expanded, especially when there is only one value -- -- e.g. add_shflags({"-Wl,-exported_symbols_list", exportfile}, {force = true, expand = false}) diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index bb2ebec53..870f4bdf6 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -771,7 +771,7 @@ function os.execv(program, argv, opt) local head = file:read("l") if head and head:startswith("#!") then -- we cannot run `/bin/sh` directly on msys2/cygwin - -- because `/bin/sh` is not real file path, maybe we need convert it. + -- because `/bin/sh` is not real file path, maybe we need to convert it. local subhost = os.subhost() if subhost == "msys" or subhost == "cygwin" then filename = "sh" diff --git a/xmake/core/base/scheduler.lua b/xmake/core/base/scheduler.lua index 61c438f4a..e89c8c604 100644 --- a/xmake/core/base/scheduler.lua +++ b/xmake/core/base/scheduler.lua @@ -443,7 +443,7 @@ function scheduler:co_suspend(...) -- suspend it local results = table.pack(coroutine.yield(...)) - -- if the current directory has been changed? restore it + -- Has the current directory been changed? restore it local running = assert(self:co_running()) local curdir = self._CO_CURDIR_HASH local olddir = self._CO_CURDIRS and self._CO_CURDIRS[running] or nil @@ -451,7 +451,7 @@ function scheduler:co_suspend(...) os.cd(olddir[2]) end - -- if the current environments has been changed? restore it + -- Has the current environments been changed? restore it local curenvs = self._CO_CURENVS_HASH local oldenvs = self._CO_CURENVS and self._CO_CURENVS[running] or nil if oldenvs and curenvs ~= oldenvs[1] and running:is_isolated() then -- hash changed? @@ -470,7 +470,7 @@ end -- sleep some times (ms) function scheduler:co_sleep(ms) - -- we need not do sleep + -- we don't need to sleep if ms == 0 then return true end diff --git a/xmake/core/base/scopeinfo.lua b/xmake/core/base/scopeinfo.lua index cdc43c4bc..d7215917f 100644 --- a/xmake/core/base/scopeinfo.lua +++ b/xmake/core/base/scopeinfo.lua @@ -113,7 +113,7 @@ function _instance:_api_set_values(name, ...) extra_config = nil end - -- @note we need mark table value as meta object to avoid wrap/unwrap + -- @note we need to mark table value as meta object to avoid wrap/unwrap -- if these values cannot be expanded, especially when there is only one value -- -- e.g. target:set("shflags", {"-Wl,-exported_symbols_list", exportfile}, {force = true, expand = false}) @@ -162,7 +162,7 @@ function _instance:_api_add_values(name, ...) extra_config = nil end - -- @note we need mark table value as meta object to avoid wrap/unwrap + -- @note we need to mark table value as meta object to avoid wrap/unwrap -- if these values cannot be expanded, especially when there is only one value -- -- e.g. target:add("shflags", {"-Wl,-exported_symbols_list", exportfile}, {force = true, expand = false}) diff --git a/xmake/core/base/task.lua b/xmake/core/base/task.lua index 78b476c2b..8c361463b 100644 --- a/xmake/core/base/task.lua +++ b/xmake/core/base/task.lua @@ -150,7 +150,7 @@ function task._translate_menu(menu) end end - -- add common options, we need avoid repeat because the main/build task will be inserted twice + -- add common options, we need to avoid repeat because the main/build task will be inserted twice if not menu._common_options then for i, v in ipairs(task.common_options()) do table.insert(options, i, v) diff --git a/xmake/core/base/winos.lua b/xmake/core/base/winos.lua index 79c1f9ce0..68815bec8 100644 --- a/xmake/core/base/winos.lua +++ b/xmake/core/base/winos.lua @@ -170,7 +170,7 @@ function winos.cmdargv(argv, opt) local argsfile = os.tmpfile(opt.tmpkey or os.args(argv)) .. ".args.txt" local f = io.open(argsfile, 'w', {encoding = "ansi"}) if f then - -- we need split args file to solve `fatal error LNK1170: line in command file contains 131071 or more characters` + -- we need to split args file to solve `fatal error LNK1170: line in command file contains 131071 or more characters` -- @see https://github.com/xmake-io/xmake/issues/812 local idx = 1 while idx <= #argv do @@ -179,7 +179,7 @@ function winos.cmdargv(argv, opt) if arg1 then arg1 = tostring(arg1) end - -- we need ensure `/name value` in same line, + -- we need to ensure `/name value` in same line, -- otherwise cl.exe will prompt that the corresponding parameter value cannot be found -- -- e.g. diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 8c86d0abb..3d7dbb23e 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -89,7 +89,7 @@ end function _instance:get(name) local value = self._INFO:get(name) if name == "configs" then - -- we need merge it, because current builtin configs always exists + -- we need to merge it, because current builtin configs always exists if self:base() then local configs_base = self:base():get("configs") if configs_base then @@ -555,7 +555,7 @@ function _instance:is_system() end -- is the third-party package? e.g. brew::pcre2/libpcre2-8, conan::OpenSSL/1.0.2n@conan/stable --- we need install and find package by third-party package manager directly +-- we need to install and find package by third-party package manager directly -- function _instance:is_thirdparty() return self._is_thirdparty @@ -1066,7 +1066,7 @@ function _instance:build_envs(lazy_loading) for _, opt in ipairs(table.join(language_menu.options("config"), platform_menu.options("config"))) do local optname = opt[2] if type(optname) == "string" then - -- we need only index it to force load it's value + -- we only need to index it to force load it's value local value = build_envs[optname] end end @@ -1544,7 +1544,7 @@ function _instance:_fetch_tool(opt) else fetchinfo = self:find_tool(self:name(), {require_version = opt.require_version, cachekey = "fetch_package_xmake", - norun = true, -- we need not run it to check for xmake/packages, @see https://github.com/xmake-io/xmake-repo/issues/66 + norun = true, -- we don't need to run it to check for xmake/packages, @see https://github.com/xmake-io/xmake-repo/issues/66 system = false, -- we only find it from xmake/packages, @see https://github.com/xmake-io/xmake-repo/pull/2085 force = opt.force}) @@ -1713,7 +1713,7 @@ function _instance:fetch(opt) -- @see https://github.com/xmake-io/xmake/issues/726 system = nil elseif self:is_cross() then - -- we need disable system package for cross-compilation + -- we need to disable system package for cross-compilation system = false end @@ -1767,7 +1767,7 @@ function _instance:fetch(opt) -- save to cache self._FETCHINFO = fetchinfo - -- we need update the real version if it's system package + -- we need to update the real version if it's system package -- @see https://github.com/xmake-io/xmake/issues/3333 if is_system and fetchinfo and fetchinfo.version then local fetch_version = semver.new(fetchinfo.version) @@ -2585,7 +2585,7 @@ function package.load_from_repository(packagename, packagedir, opt) -- get interpreter local interp = package._interpreter() - -- we need modify plat/arch in description scope at same time + -- we need to modify plat/arch in description scope at same time -- if plat/arch are passed to add_requires. -- -- @see https://github.com/orgs/xmake-io/discussions/3439 diff --git a/xmake/core/platform/platform.lua b/xmake/core/platform/platform.lua index cc46b8d41..01d5b0e5e 100644 --- a/xmake/core/platform/platform.lua +++ b/xmake/core/platform/platform.lua @@ -66,7 +66,7 @@ end -- set platform architecture function _instance:arch_set(arch) if self:arch() ~= arch then - -- we need clean the dirty cache if architecture has been changed + -- we need to clean the dirty cache if architecture has been changed platform._PLATFORMS[self:name() .. "_" .. self:arch()] = nil platform._PLATFORMS[self:name() .. "_" .. arch] = self self._ARCH = arch @@ -243,7 +243,7 @@ function _instance:check() local toolchains_valid = {} while idx <= num do local toolchain = toolchains[idx] - -- we need remove other standalone toolchains if standalone toolchain found + -- we need to remove other standalone toolchains if standalone toolchain found if (standalone and toolchain:is_standalone()) or not toolchain:check() then table.remove(toolchains, idx) num = num - 1 diff --git a/xmake/core/project/package.lua b/xmake/core/project/package.lua index bf1e61ea8..0e16a7e1b 100644 --- a/xmake/core/project/package.lua +++ b/xmake/core/project/package.lua @@ -298,7 +298,7 @@ function _instance:_sort_componentdeps(name) return orderdeps end --- we need sort package set keys by this string +-- we need to sort package set keys by this string -- @see https://github.com/xmake-io/xmake/pull/2971#issuecomment-1290052169 function _instance:__tostring() return "<package: " .. self:name() .. ">" diff --git a/xmake/core/project/policy.lua b/xmake/core/project/policy.lua index 82944d415..03fc2aaf9 100644 --- a/xmake/core/project/policy.lua +++ b/xmake/core/project/policy.lua @@ -70,7 +70,7 @@ function policy.policies() ["preprocessor.linemarkers"] = {description = "Enable linemarkers for preprocessor.", default = true, type = "boolean"}, -- preprocessor configuration for ccache/distcc, we can disable it to avoid cache object file with __DATE__, __TIME__ ["preprocessor.gcc.directives_only"] = {description = "Enable -fdirectives-only for gcc preprocessor.", type = "boolean"}, - -- we need enable longpaths when building target or installing package + -- we need to enable longpaths when building target or installing package ["platform.longpaths"] = {description = "Enable long paths when building target or installing package on windows.", default = false, type = "boolean"}, -- lock required packages ["package.requires_lock"] = {description = "Enable xmake-requires.lock to lock required packages.", default = false, type = "boolean"}, diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index 81181c72d..3ac9ab7e2 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -375,7 +375,7 @@ function project._load_targets() t._RULES[deprule:name()] = deprule end end - -- we need ignore `@package/rulename`, it will be loaded later + -- we need to ignore `@package/rulename`, it will be loaded later elseif not rulename:match("@.-/") then return nil, string.format("unknown rule(%s) in target(%s)!", rulename, t:name()) end @@ -387,7 +387,7 @@ function project._load_targets() return nil, errors end - -- we need call on_load() before building deps/rules, + -- we need to call on_load() before building deps/rules, -- so we can use `target:add("deps", "xxx")` to add deps in on_load ok, errors = t:_load() if not ok then @@ -799,7 +799,7 @@ end function project.name() local name = project.get("project") -- TODO multi project names? we only get the first name now. - -- and we need improve it in the future. + -- and we need to improve it in the future. if type(name) == "table" then name = name[1] end @@ -1004,7 +1004,7 @@ end -- get the given toolchain function project.toolchain(name, opt) - local toolchain_name = toolchain.parsename(name) -- we need ignore `@packagename` + local toolchain_name = toolchain.parsename(name) -- we need to ignore `@packagename` local info = project._toolchains()[toolchain_name] if info then return toolchain.load_withinfo(name, info, opt) diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 3c8c14085..ae3212343 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -273,7 +273,7 @@ end function _instance:_invalidate(name) self._CACHEID = self._CACHEID + 1 self._POLICIES = nil - -- we need flush the source files cache if target/files are modified, e.g. `target:add("files", "xxx.c")` + -- we need to flush the source files cache if target/files are modified, e.g. `target:add("files", "xxx.c")` if name == "files" then self._SOURCEFILES = nil elseif name == "deps" then @@ -1140,7 +1140,7 @@ function _instance:autogenfile(sourcefile, opt) -- objectfile: project/build/.objs/xxxx/../../xxx.c will be out of range for objectdir -- autogenfile: project/build/.gens/xxxx/../../xxx.c will be out of range for autogendir -- - -- we need replace '..' to '__' in this case + -- we need to replace '..' with '__' in this case -- if path.is_absolute(relativedir) and os.host() == "windows" then -- remove C:\\ and whitespaces and fix long path issue @@ -1539,7 +1539,7 @@ function _instance:sourcefiles() pattern = pattern:sub(3) end pattern = path.pattern(pattern) - -- we need match whole pattern, https://github.com/xmake-io/xmake/issues/3523 + -- we need to match whole pattern, https://github.com/xmake-io/xmake/issues/3523 if sourcefile:match("^" .. pattern .. "$") then return true end @@ -1574,14 +1574,14 @@ function _instance:objectfiles() local batchcount = 0 local sourcebatches = self:sourcebatches() local orderkeys = table.keys(sourcebatches) - table.sort(orderkeys) -- @note we need guarantee the order of objectfiles for depend.is_changed() and etc. + table.sort(orderkeys) -- @note we need to guarantee the order of objectfiles for depend.is_changed() and etc. for _, k in ipairs(orderkeys) do local sourcebatch = sourcebatches[k] table.join2(objectfiles, sourcebatch.objectfiles) batchcount = batchcount + 1 end - -- some object files may be repeat and appear link errors if multi-batches exists, so we need remove all repeat object files + -- some object files may be repeat and appear link errors if multi-batches exists, so we need to remove all repeat object files -- e.g. add_files("src/*.c", {rules = {"rule1", "rule2"}}) local deduplicate = batchcount > 1 @@ -1810,7 +1810,7 @@ function _instance:dependfile(objectfile) -- originfile: project/build/.objs/xxxx/../../xxx.c will be out of range for objectdir -- - -- we need replace '..' to '__' in this case + -- we need to replace '..' to '__' in this case -- relativedir = relativedir:gsub("%.%.", "__") @@ -2194,7 +2194,7 @@ function _instance:tool(toolkind) if program and not toolname then local pos = program:find('@', 1, true) if pos then - -- we need ignore valid path with `@`, e.g. /usr/local/opt/[email protected]/bin/go + -- we need to ignore valid path with `@`, e.g. /usr/local/opt/[email protected]/bin/go -- https://github.com/xmake-io/xmake/issues/2853 local prefix = program:sub(1, pos - 1) if prefix and not prefix:find("[/\\]") then diff --git a/xmake/core/sandbox/modules/import/lib/detect/find_path.lua b/xmake/core/sandbox/modules/import/lib/detect/find_path.lua index 78b9f4c9d..0f79c9825 100644 --- a/xmake/core/sandbox/modules/import/lib/detect/find_path.lua +++ b/xmake/core/sandbox/modules/import/lib/detect/find_path.lua @@ -37,7 +37,7 @@ function sandbox_lib_detect_find_path._find(filedir, name) if results and #results > 0 then local filepath = results[1] if filepath then - -- we need translate name first, https://github.com/xmake-io/xmake-repo/issues/1315 + -- we need to translate name first, https://github.com/xmake-io/xmake-repo/issues/1315 local p = filepath:lastof(path.pattern(path.translate(name))) if p then filepath = path.translate(filepath:sub(1, p - 1)) diff --git a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua index a4e3c2849..c0755cbf3 100644 --- a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua +++ b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua @@ -84,7 +84,7 @@ function sandbox_lib_detect_find_program._check(program, opt) end elseif os.subhost() == "msys" and os.isfile(program) and os.filesize(program) < 256 then -- only a sh script on msys2? e.g. c:/msys64/usr/bin/7z - -- we need use sh to wrap it, otherwise os.exec cannot run it + -- we need to use sh to wrap it, otherwise os.exec cannot run it program = "sh " .. program findname = program end diff --git a/xmake/core/tool/builder.lua b/xmake/core/tool/builder.lua index 9070cca85..3eda6ce6a 100644 --- a/xmake/core/tool/builder.lua +++ b/xmake/core/tool/builder.lua @@ -393,7 +393,7 @@ end -- preprocess flags function builder:_preprocess_flags(flags) - -- remove repeat by right direction, because we need consider links/deps order + -- remove repeat by right direction, because we need to consider links/deps order -- @note https://github.com/xmake-io/xmake/issues/1240 local unique = {} local count = #flags diff --git a/xmake/core/tool/linker.lua b/xmake/core/tool/linker.lua index aa7b1bb8c..3048cd955 100644 --- a/xmake/core/tool/linker.lua +++ b/xmake/core/tool/linker.lua @@ -114,7 +114,7 @@ function linker.load(targetkind, sourcekinds, target) -- wrap sourcekinds first sourcekinds = table.wrap(sourcekinds) if #sourcekinds == 0 then - -- we need detect the sourcekinds of all deps if the current target has not any source files + -- we need to detect the sourcekinds of all deps if the current target has not any source files for _, dep in ipairs(target:orderdeps()) do table.join2(sourcekinds, dep:sourcekinds()) end diff --git a/xmake/core/tool/tool.lua b/xmake/core/tool/tool.lua index 46e3e664b..45ac78a08 100644 --- a/xmake/core/tool/tool.lua +++ b/xmake/core/tool/tool.lua @@ -41,7 +41,7 @@ function _instance.new(kind, name, program, plat, arch, toolchain_inst) -- import "core.tools.xxx" local toolclass = nil if os.isfile(path.join(os.programdir(), "modules", "core", "tools", name .. ".lua")) then - toolclass = import("core.tools." .. name, {nocache = true}) -- @note we need create a tool instance with unique toolclass context (_g) + toolclass = import("core.tools." .. name, {nocache = true}) -- @note we need to create a tool instance with unique toolclass context (_g) end -- not found? @@ -202,7 +202,7 @@ function _instance:_sysflags(toolkind, flagkind) table.insert(sourceflags, flagkind) table.insert(sourceflags, "mxxflags") else - -- flagkind may be ldflags, we need ignore it + -- flagkind may be ldflags, we need to ignore it -- and we should use more precise flagkind, e.g. rcldflags instead of ldflags end end @@ -255,7 +255,7 @@ function tool.load(kind, opt) if program then local pos = program:find('@', 1, true) if pos then - -- we need ignore valid path with `@`, e.g. /usr/local/opt/[email protected]/bin/go + -- we need to ignore valid path with `@`, e.g. /usr/local/opt/[email protected]/bin/go -- https://github.com/xmake-io/xmake/issues/2853 local prefix = program:sub(1, pos - 1) if prefix and not prefix:find("[/\\]") then diff --git a/xmake/core/tool/toolchain.lua b/xmake/core/tool/toolchain.lua index b230bf674..4831bce5c 100644 --- a/xmake/core/tool/toolchain.lua +++ b/xmake/core/tool/toolchain.lua @@ -345,7 +345,7 @@ function _instance:_on_load() return on_load end --- do load, @note we need load it repeatly for each architectures +-- do load, @note we need to load it repeatly for each architectures function _instance:_load() local info = self:info() if not info:get("__loaded") and not info:get("__loading") then @@ -456,7 +456,7 @@ function _instance:_checktool(toolkind, toolpath) if toolpath then local pos = toolpath:find('@', 1, true) if pos then - -- we need ignore valid path with `@`, e.g. /usr/local/opt/[email protected]/bin/go + -- we need to ignore valid path with `@`, e.g. /usr/local/opt/[email protected]/bin/go -- https://github.com/xmake-io/xmake/issues/2853 local prefix = toolpath:sub(1, pos - 1) if prefix and not prefix:find("[/\\]") then @@ -698,7 +698,7 @@ function toolchain.load_fromfile(filepath, opt) local scope_opt = {interpreter = toolchain._interpreter(), deduplicate = true, enable_filter = true} local info = scopeinfo.new("toolchain", fileinfo.info, scope_opt) local instance = toolchain.load_withinfo(fileinfo.name, info, opt) - -- we need skip check + -- we need to skip check instance._CHECKED = true return instance end @@ -753,7 +753,7 @@ function toolchain.tool(toolchains, toolkind, opt) if program and type(program) == "string" then local pos = program:find('@', 1, true) if pos then - -- we need ignore valid path with `@`, e.g. /usr/local/opt/[email protected]/bin/go + -- we need to ignore valid path with `@`, e.g. /usr/local/opt/[email protected]/bin/go -- https://github.com/xmake-io/xmake/issues/2853 local prefix = program:sub(1, pos - 1) if prefix and not prefix:find("[/\\]") then diff --git a/xmake/core/ui/view.lua b/xmake/core/ui/view.lua index 5655aedc7..45a46c6f6 100644 --- a/xmake/core/ui/view.lua +++ b/xmake/core/ui/view.lua @@ -305,7 +305,7 @@ end -- set state function view:state_set(name, enable) - -- state is not changed? + -- state not changed? enable = enable or false if self:state(name) == enable then return self @@ -324,7 +324,7 @@ end -- set option function view:option_set(name, enable) - -- state is not changed? + -- state not changed? enable = enable or false if self:option(name) == enable then return @@ -444,7 +444,7 @@ function view:_mark_resize() -- need resize it self:state_set("resize", true) - -- @note we need trigger on_resize() of the root view and pass it to this subview + -- @note we need to trigger on_resize() of the root view and pass it to this subview if self:parent() then self:parent():invalidate(true) end diff --git a/xmake/languages/objc++/load.lua b/xmake/languages/objc++/load.lua index 9f7a62885..9682981c6 100644 --- a/xmake/languages/objc++/load.lua +++ b/xmake/languages/objc++/load.lua @@ -67,7 +67,7 @@ function _get_apis() , "package.add_frameworks" , "package.add_rpathdirs" , "package.add_linkdirs" - , "package.add_includedirs" --@note we need not uses paths for package, see https://github.com/xmake-io/xmake/issues/717 + , "package.add_includedirs" --@note we don't need to use paths for package, see https://github.com/xmake-io/xmake/issues/717 , "package.add_sysincludedirs" , "package.add_frameworkdirs" -- toolchain.add_xxx diff --git a/xmake/modules/core/project/depend.lua b/xmake/modules/core/project/depend.lua index 78150c117..9f386c8f1 100644 --- a/xmake/modules/core/project/depend.lua +++ b/xmake/modules/core/project/depend.lua @@ -73,7 +73,7 @@ function save(dependinfo, dependfile) io.save(dependfile, dependinfo) end --- the dependent info is changed? +-- Is the dependent info changed? -- -- if not depend.is_changed(dependinfo, {filemtime = os.mtime(objectfile), values = {...}}) then -- return @@ -88,7 +88,7 @@ function is_changed(dependinfo, opt) return true end - -- check the dependent files are changed? + -- check whether the dependent files are changed local lastmtime = opt.lastmtime or 0 _g.files_mtime = _g.files_mtime or {} local files_mtime = _g.files_mtime @@ -104,7 +104,7 @@ function is_changed(dependinfo, opt) end end - -- check the dependent values are changed? + -- check whether the dependent values are changed local depvalues = values local optvalues = table.wrap(opt.values) if #depvalues ~= #optvalues then @@ -127,7 +127,7 @@ function is_changed(dependinfo, opt) end end - -- check the dependent files list are changed? + -- check whether the dependent files list are changed if opt.files then local optfiles = table.wrap(opt.files) if #files ~= #optfiles then diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index e5addc78a..e69b7d814 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -116,7 +116,7 @@ function nf_symbols(self, levels, target) -- check and add symbol output file -- - -- @note we need use `{}` to wrap it to avoid expand it + -- @note we need to use `{}` to wrap it to avoid expand it -- https://github.com/xmake-io/xmake/issues/2061#issuecomment-1042590085 local pdbflags = {"-Fd" .. (target:is_static() and symbolfile or path.join(symboldir, "compile." .. path.filename(symbolfile)))} if self:has_flags({"-FS", "-Fd" .. os.nuldev() .. ".pdb"}, "cxflags", { flagskey = "-FS -Fd" }) then @@ -163,7 +163,7 @@ function nf_optimize(self, level) none = "-Od" , faster = "-Ox" , fastest = "-O2 -fp:fast" - , smallest = "-O1 -GL" -- /GL and (/OPT:REF is on by default in linker), we need enable /ltcg + , smallest = "-O1 -GL" -- /GL and (/OPT:REF is on by default in linker), we need to enable /ltcg , aggressive = "-O2 -fp:fast" } return maps[level] @@ -521,7 +521,7 @@ end -- compile preprocessed file function _compile_preprocessed_file(program, cppinfo, opt) local outdata, errdata = vstool.iorunv(program, winos.cmdargv(table.join(cppinfo.cppflags, "-Fo" .. cppinfo.objectfile, cppinfo.cppfile)), opt) - -- we need get warning information from output + -- we need to get warning information from output cppinfo.outdata = outdata cppinfo.errdata = errdata end @@ -592,7 +592,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt) end end - -- we need show full file path to goto error position if xmake is called in vstudio + -- we need to show full file path to goto error position if xmake is called in vstudio -- https://github.com/xmake-io/xmake/issues/1049 if _is_in_vstudio() then if compflags == flags then diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index cfd5fac5c..60f6ac805 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -112,7 +112,7 @@ function nf_symbol(self, level) end return maps[level .. '_' .. kind] or maps[level] elseif kind == "ld" or kind == "sh" then - -- we need add `-g` to linker to generate pdb symbol file for mingw-gcc, llvm-clang on windows + -- we need to add `-g` to linker to generate pdb symbol file for mingw-gcc, llvm-clang on windows local plat = self:plat() if level == "debug" and (plat == "windows" or (plat == "mingw" and is_host("windows"))) then return "-g" @@ -426,7 +426,7 @@ end -- link the target file -- --- maybe we need use os.vrunv() to show link output when enable verbose information +-- maybe we need to use os.vrunv() to show link output when enable verbose information -- @see https://github.com/xmake-io/xmake/discussions/2916 -- function link(self, objectfiles, targetkind, targetfile, flags) @@ -483,7 +483,7 @@ function _preprocess(program, argv, opt) end end - -- enable "-fdirectives-only"? we need enable it manually + -- enable "-fdirectives-only"? we need to enable it manually -- -- @see https://github.com/xmake-io/xmake/issues/2603 -- https://github.com/xmake-io/xmake/issues/2425 @@ -577,7 +577,7 @@ function _preprocess(program, argv, opt) table.insert(cppflags, cppfile) table.insert(cppflags, sourcefile) - -- we need mark as it when compiling the preprocessed source file + -- we need to mark as it when compiling the preprocessed source file -- it will indicate to the preprocessor that the input file has already been preprocessed. if is_gcc then table.insert(flags, "-fpreprocessed") @@ -605,7 +605,7 @@ end -- compile preprocessed file function _compile_preprocessed_file(program, cppinfo, opt) local outdata, errdata = os.iorunv(program, table.join(cppinfo.cppflags, "-o", cppinfo.objectfile, cppinfo.cppfile), opt) - -- we need get warning information from output + -- we need to get warning information from output cppinfo.outdata = outdata cppinfo.errdata = errdata end @@ -672,7 +672,7 @@ end -- get modules cache directory function _modules_cachedir(target) - if target and target.autogendir and target:data("cxx.has_modules") then -- we need ignore option instance + if target and target.autogendir and target:data("cxx.has_modules") then -- we need to ignore option instance return path.join(target:autogendir(), "rules", "modules", "cache") end end diff --git a/xmake/modules/core/tools/ml.lua b/xmake/modules/core/tools/ml.lua index 451954601..042937ed7 100644 --- a/xmake/modules/core/tools/ml.lua +++ b/xmake/modules/core/tools/ml.lua @@ -134,7 +134,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags) try { function () - -- @note we need not uses vstool.runv to enable unicode output for ml.exe + -- @note we don't need to use vstool.runv to enable unicode output for ml.exe local program, argv = compargv(self, sourcefile, objectfile, flags) os.runv(program, argv, {envs = self:runenvs()}) end, diff --git a/xmake/modules/core/tools/rc.lua b/xmake/modules/core/tools/rc.lua index 5ef03b912..55146ee76 100644 --- a/xmake/modules/core/tools/rc.lua +++ b/xmake/modules/core/tools/rc.lua @@ -93,7 +93,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags) try { function () - -- @note we need not uses vstool.iorunv to enable unicode output for rc.exe + -- @note we don't need to use vstool.iorunv to enable unicode output for rc.exe local program, argv = compargv(self, sourcefile, objectfile, flags) local outdata, errdata = os.iorunv(program, argv, {envs = self:runenvs()}) return (outdata or "") .. (errdata or "") diff --git a/xmake/modules/detect/sdks/find_qt.lua b/xmake/modules/detect/sdks/find_qt.lua index d591a289c..f94f3556e 100644 --- a/xmake/modules/detect/sdks/find_qt.lua +++ b/xmake/modules/detect/sdks/find_qt.lua @@ -158,7 +158,7 @@ function _find_qmake(sdkdir, sdkver) end end - -- we need find the default qmake in current system + -- we need to find the default qmake in current system -- maybe we only installed qmake6 if not qmake then local suffixes = {"", "6", "-qt5"} diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua index ee06019eb..0702bee9b 100644 --- a/xmake/modules/detect/sdks/find_vstudio.lua +++ b/xmake/modules/detect/sdks/find_vstudio.lua @@ -105,7 +105,7 @@ function _load_vcvarsall(vcvarsall, vsver, arch, opt) local genvcvars_bat = os.tmpfile() .. "_genvcvars.bat" local file = io.open(genvcvars_bat, "w") file:print("@echo off") - -- @note we need get utf8 output from cmd.exe + -- @note we need to get utf8 output from cmd.exe -- because some %PATH% and other envs maybe contains unicode characters if winos.version():gt("winxp") then file:print("chcp 65001") diff --git a/xmake/modules/detect/tools/armclang/has_flags.lua b/xmake/modules/detect/tools/armclang/has_flags.lua index 0c126a26b..965644f2a 100644 --- a/xmake/modules/detect/tools/armclang/has_flags.lua +++ b/xmake/modules/detect/tools/armclang/has_flags.lua @@ -80,7 +80,7 @@ end -- get extension function _get_extension(opt) - -- @note we need detect extension for ndk/clang++.exe: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] + -- @note we need to detect extension for ndk/clang++.exe: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] return (opt.program:endswith("++") or opt.flagkind == "cxxflags") and ".cpp" or (table.wrap(language.sourcekinds()[opt.toolkind or "cc"])[1] or ".c") end diff --git a/xmake/modules/detect/tools/cl/has_flags.lua b/xmake/modules/detect/tools/cl/has_flags.lua index 99da46e63..aced6332d 100644 --- a/xmake/modules/detect/tools/cl/has_flags.lua +++ b/xmake/modules/detect/tools/cl/has_flags.lua @@ -75,7 +75,7 @@ function _check_try_running(flags, opt) return try { function () local tmpdir = os.tmpdir() local _, errs = os.iorunv(opt.program, table.join("-c", "-nologo", flags, "-Fo" .. os.nuldev(), sourcefile), - {envs = opt.envs, curdir = tmpdir}) -- we need switch to tmpdir to avoid generating some tmp files, e.g. /Zi -> vc140.pdb + {envs = opt.envs, curdir = tmpdir}) -- we need to switch to tmpdir to avoid generating some tmp files, e.g. /Zi -> vc140.pdb if errs and #errs:trim() > 0 then return false, errs end diff --git a/xmake/modules/detect/tools/clang_cl/has_flags.lua b/xmake/modules/detect/tools/clang_cl/has_flags.lua index 4917fb665..8b8d1b04d 100644 --- a/xmake/modules/detect/tools/clang_cl/has_flags.lua +++ b/xmake/modules/detect/tools/clang_cl/has_flags.lua @@ -68,7 +68,7 @@ end function _check_try_running(flags, opt) -- get extension - -- @note we need detect extension for ndk/clang++.exe: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] + -- @note we need to detect extension for ndk/clang++.exe: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] local extension = opt.program:endswith("++") and ".cpp" or (table.wrap(language.sourcekinds()[opt.toolkind or "cc"])[1] or ".c") -- make an stub source file diff --git a/xmake/modules/detect/tools/gcc/has_flags.lua b/xmake/modules/detect/tools/gcc/has_flags.lua index 3ab51f1ab..99ceb0643 100644 --- a/xmake/modules/detect/tools/gcc/has_flags.lua +++ b/xmake/modules/detect/tools/gcc/has_flags.lua @@ -81,7 +81,7 @@ end -- get extension function _get_extension(opt) - -- @note we need detect extension for ndk/clang++.exe: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] + -- @note we need to detect extension for ndk/clang++.exe: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] return (opt.program:endswith("++") or opt.flagkind == "cxxflags") and ".cpp" or (table.wrap(language.sourcekinds()[opt.toolkind or "cc"])[1] or ".c") end diff --git a/xmake/modules/detect/tools/sdcc/has_flags.lua b/xmake/modules/detect/tools/sdcc/has_flags.lua index c7c440a8a..b911124ff 100644 --- a/xmake/modules/detect/tools/sdcc/has_flags.lua +++ b/xmake/modules/detect/tools/sdcc/has_flags.lua @@ -82,7 +82,7 @@ end function _check_try_running(flags, opt, islinker) -- get extension - -- @note we need detect extension for ndk/clang++.exe: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] + -- @note we need to detect extension for ndk/clang++.exe: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] local extension = opt.program:endswith("++") and ".cpp" or (table.wrap(language.sourcekinds()[opt.toolkind or "cc"])[1] or ".c") -- make an stub source file diff --git a/xmake/modules/lib/detect/find_package.lua b/xmake/modules/lib/detect/find_package.lua index dc1c92848..3fdaf56c7 100644 --- a/xmake/modules/lib/detect/find_package.lua +++ b/xmake/modules/lib/detect/find_package.lua @@ -37,7 +37,7 @@ function _concat_packages(a, b) for k, v in pairs(result) do if k == "links" then if type(v) == "table" and #v > 1 then - -- we need ensure link orders when removing repeat values + -- we need to ensure link orders when removing repeat values v = table.reverse_unique(v) end else diff --git a/xmake/modules/lib/detect/find_toolname.lua b/xmake/modules/lib/detect/find_toolname.lua index 77ed776d2..8a9541031 100644 --- a/xmake/modules/lib/detect/find_toolname.lua +++ b/xmake/modules/lib/detect/find_toolname.lua @@ -24,7 +24,7 @@ import("core.sandbox.module") -- remove some suffix -- --- we just remove some known extension, because we need reverse others, e.g. ld.lld, ld64.lld +-- we just remove some known extension, because we need to reverse others, e.g. ld.lld, ld64.lld -- function _remove_suffix(name) local exts = hashset.of("exe", "bat", "sh", "ps1", "ps") diff --git a/xmake/modules/net/ping.lua b/xmake/modules/net/ping.lua index add89739c..023d9eaec 100644 --- a/xmake/modules/net/ping.lua +++ b/xmake/modules/net/ping.lua @@ -80,7 +80,7 @@ function main(hosts, opt) if cacheinfo then cacheinfo[host] = timeval end - vprint("pinging for the host(%s) ... %d ms", host, math.floor(timeval)) + vprint("pinging the host(%s) ... %d ms", host, math.floor(timeval)) end end end, {total = #hosts}) diff --git a/xmake/modules/package/manager/apt/find_package.lua b/xmake/modules/package/manager/apt/find_package.lua index d71a34319..0e833e2ee 100644 --- a/xmake/modules/package/manager/apt/find_package.lua +++ b/xmake/modules/package/manager/apt/find_package.lua @@ -37,7 +37,7 @@ function _find_package(dpkg, name, opt) -- get includedirs local pos = line:find("include/", 1, true) if pos then - -- we need not add includedirs, gcc/clang will use /usr/ as default sysroot + -- we don't need to add includedirs, gcc/clang will use /usr/ as default sysroot result = result or {} end diff --git a/xmake/modules/package/manager/nimble/find_package.lua b/xmake/modules/package/manager/nimble/find_package.lua index c39d6ed34..38eddefa6 100644 --- a/xmake/modules/package/manager/nimble/find_package.lua +++ b/xmake/modules/package/manager/nimble/find_package.lua @@ -61,7 +61,7 @@ function main(name, opt) end end end - -- @note we need not return links and includedirs information, + -- @note we don't need return links and includedirs information, -- because it's nim source code package and nim will find them automatically return result end diff --git a/xmake/modules/package/manager/portage/find_package.lua b/xmake/modules/package/manager/portage/find_package.lua index 9b2c21340..f08b8e39f 100644 --- a/xmake/modules/package/manager/portage/find_package.lua +++ b/xmake/modules/package/manager/portage/find_package.lua @@ -90,7 +90,7 @@ function main(name, opt) includedirs = table.unique(includedirs) result = find_package_from_pkgconfig(pkgconfig_name, {configdirs = pkgconfig_dir, linkdirs = linkdirs}) if not result and has_includes then - -- header only and hidden /usr/include? we need only return empty {} + -- header only and hidden /usr/include? we only need to return empty {} result = {} end end diff --git a/xmake/modules/package/manager/system/find_package.lua b/xmake/modules/package/manager/system/find_package.lua index 1e0d58c77..55cf839c0 100644 --- a/xmake/modules/package/manager/system/find_package.lua +++ b/xmake/modules/package/manager/system/find_package.lua @@ -158,7 +158,7 @@ function _find_package_from_xcodedirs(name, links, opt) end end if result then - -- we need not add linkdirs again if we are building target on the current platform (with -isysroot) + -- we don't need to add linkdirs again if we are building target on the current platform (with -isysroot) if config.plat() ~= opt.plat or config.arch() ~= opt.arch then result.linkdirs = linkdirs result.includedirs = includedirs diff --git a/xmake/modules/package/manager/zypper/find_package.lua b/xmake/modules/package/manager/zypper/find_package.lua index 1840de5c2..ea5651004 100644 --- a/xmake/modules/package/manager/zypper/find_package.lua +++ b/xmake/modules/package/manager/zypper/find_package.lua @@ -42,7 +42,7 @@ function _find_package(rpm, name, opt) -- get includedirs local pos = line:find("include/", 1, true) if pos then - -- we need not add includedirs, gcc/clang will use /usr/ as default sysroot + -- we don't need to add includedirs, gcc/clang will use /usr/ as default sysroot result = result or {} end diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index 13b0e03df..d30ecb52c 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -86,7 +86,7 @@ end -- get msvc function _get_msvc(package) local msvc = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}) - assert(msvc:check(), "vs not found!") -- we need check vs envs if it has been not checked yet + assert(msvc:check(), "vs not found!") -- we need to check vs envs if it has been not checked yet return msvc end @@ -506,7 +506,7 @@ function _get_configs_for_cross(package, configs, opt) envs.CMAKE_CXX_COMPILER = _translate_bin_path(cxx) end -- @note The link command line is set in Modules/CMake{C,CXX,Fortran}Information.cmake and defaults to using the compiler, not CMAKE_LINKER, - -- so we need set CMAKE_CXX_LINK_EXECUTABLE to use CMAKE_LINKER as linker. + -- so we need to set CMAKE_CXX_LINK_EXECUTABLE to use CMAKE_LINKER as linker. -- -- https://github.com/xmake-io/xmake-repo/pull/1039 -- https://stackoverflow.com/questions/1867745/cmake-use-a-custom-linker/25274328#25274328 @@ -522,7 +522,7 @@ function _get_configs_for_cross(package, configs, opt) envs.CMAKE_STATIC_LINKER_FLAGS = table.concat(table.wrap(package:build_getenv("arflags")), ' ') envs.CMAKE_EXE_LINKER_FLAGS = _get_ldflags(package, opt) envs.CMAKE_SHARED_LINKER_FLAGS = _get_shflags(package, opt) - -- we need not set it as cross compilation if we just pass toolchain + -- we don't need to set it as cross compilation if we just pass toolchain -- https://github.com/xmake-io/xmake/issues/2170 if not package:is_plat(os.subhost()) then local system_name = package:targetos() or "Linux" @@ -596,7 +596,7 @@ function _get_configs_for_host_toolchain(package, configs, opt) envs.CMAKE_STATIC_LINKER_FLAGS = table.concat(table.wrap(package:build_getenv("arflags")), ' ') envs.CMAKE_EXE_LINKER_FLAGS = _get_ldflags(package, opt) envs.CMAKE_SHARED_LINKER_FLAGS = _get_shflags(package, opt) - -- we need not set it as cross compilation if we just pass toolchain + -- we don't need to set it as cross compilation if we just pass toolchain -- https://github.com/xmake-io/xmake/issues/2170 if not package:is_plat(os.subhost()) then envs.CMAKE_SYSTEM_NAME = "Linux" @@ -719,7 +719,7 @@ end -- get build environments function buildenvs(package, opt) - -- we need bind msvc environments manually + -- we need to bind msvc environments manually -- @see https://github.com/xmake-io/xmake/issues/1057 opt = opt or {} local envs = {} @@ -727,7 +727,7 @@ function buildenvs(package, opt) envs = _get_msvc_runenvs(package) end - -- we need pass pkgconf for windows/mingw without msys2/cygwin + -- we need to pass pkgconf for windows/mingw without msys2/cygwin if package:is_plat("windows", "mingw") and is_subhost("windows") then local pkgconf = find_tool("pkgconf") if pkgconf then diff --git a/xmake/modules/package/tools/gn.lua b/xmake/modules/package/tools/gn.lua index 221ca92e9..8684482e4 100644 --- a/xmake/modules/package/tools/gn.lua +++ b/xmake/modules/package/tools/gn.lua @@ -76,7 +76,7 @@ end -- get msvc function _get_msvc(package) local msvc = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}) - assert(msvc:check(), "vs not found!") -- we need check vs envs if it has been not checked yet + assert(msvc:check(), "vs not found!") -- we need to check vs envs if it has been not checked yet return msvc end diff --git a/xmake/modules/package/tools/meson.lua b/xmake/modules/package/tools/meson.lua index 89fff1423..c4057ee32 100644 --- a/xmake/modules/package/tools/meson.lua +++ b/xmake/modules/package/tools/meson.lua @@ -310,7 +310,7 @@ end -- get msvc function _get_msvc(package) local msvc = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}) - assert(msvc:check(), "vs not found!") -- we need check vs envs if it has been not checked yet + assert(msvc:check(), "vs not found!") -- we need to check vs envs if it has been not checked yet return msvc end diff --git a/xmake/modules/package/tools/msbuild.lua b/xmake/modules/package/tools/msbuild.lua index 21fd2e693..5897c357f 100644 --- a/xmake/modules/package/tools/msbuild.lua +++ b/xmake/modules/package/tools/msbuild.lua @@ -32,7 +32,7 @@ end -- get msvc function _get_msvc(package) local msvc = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()}) - assert(msvc:check(), "vs not found!") -- we need check vs envs if it has been not checked yet + assert(msvc:check(), "vs not found!") -- we need to check vs envs if it has been not checked yet return msvc end diff --git a/xmake/modules/private/action/require/impl/actions/download.lua b/xmake/modules/private/action/require/impl/actions/download.lua index 182765e8a..a50f3b1a9 100644 --- a/xmake/modules/private/action/require/impl/actions/download.lua +++ b/xmake/modules/private/action/require/impl/actions/download.lua @@ -81,7 +81,7 @@ function _checkout(package, url, sourcedir, opt) -- remove temporary directory os.rm(sourcedir .. ".tmp") - -- we need enable longpaths on windows + -- we need to enable longpaths on windows local longpaths = package:policy("platform.longpaths") -- download package from branches? @@ -89,7 +89,7 @@ function _checkout(package, url, sourcedir, opt) local branch = package:branch() if branch then - -- we need select the correct default branch + -- we need to select the correct default branch -- @see https://github.com/xmake-io/xmake/issues/3248 if branch == "@default" then branch = nil @@ -132,7 +132,7 @@ function _download(package, url, sourcedir, opt) -- get sourcehash from the given url -- - -- we need not sourcehash and skip checksum to try download it directly if no version list in package() + -- we don't need sourcehash and skip checksum to try download it directly if no version list in package() -- @see https://github.com/xmake-io/xmake/issues/930 -- https://github.com/xmake-io/xmake/issues/1009 -- @@ -198,7 +198,7 @@ function _download(package, url, sourcedir, opt) local filedirs = os.filedirs(path.join(sourcedir_tmp, "*")) if #filedirs == 1 and os.isdir(filedirs[1]) then os.mv(filedirs[1], sourcedir) - -- we need anchor it to avoid expand it when installing package + -- we need to anchor it to avoid expand it when installing package io.writefile(path.join(sourcedir, "__sourceroot_anchor__.txt"), "") os.rm(sourcedir_tmp) else @@ -212,7 +212,7 @@ function _download(package, url, sourcedir, opt) os.mkdir(sourcedir) raise("cannot extract %s, maybe missing extractor or invalid package file!", packagefile) else - -- if it is not archive file, we need only create empty source file and use package:originfile() + -- if it is not archive file, we only need to create empty source file and use package:originfile() os.tryrm(sourcedir) os.mkdir(sourcedir) end diff --git a/xmake/modules/private/action/require/impl/actions/download_resources.lua b/xmake/modules/private/action/require/impl/actions/download_resources.lua index 129473430..194afd3e6 100644 --- a/xmake/modules/private/action/require/impl/actions/download_resources.lua +++ b/xmake/modules/private/action/require/impl/actions/download_resources.lua @@ -68,7 +68,7 @@ function _checkout(package, resource_name, resource_url, resource_revision) -- remove temporary directory os.rm(resourcedir) - -- we need enable longpaths on windows + -- we need to enable longpaths on windows local longpaths = package:policy("platform.longpaths") -- clone whole history and tags @@ -143,7 +143,7 @@ end -- download all resources of the given package function main(package) - -- we need not download it if we use the precompiled artifacts to install package + -- we don't need to download it if we use the precompiled artifacts to install package if package:is_precompiled() then return end diff --git a/xmake/modules/private/action/require/impl/actions/install.lua b/xmake/modules/private/action/require/impl/actions/install.lua index dbb4d26c9..1610d0241 100644 --- a/xmake/modules/private/action/require/impl/actions/install.lua +++ b/xmake/modules/private/action/require/impl/actions/install.lua @@ -202,7 +202,7 @@ function _fix_paths_for_precompiled_package(package) for _, file in ipairs(os.files(filepattern)) do if remote_prefix then local _, count = io.replace(file, remote_prefix, local_prefix, {plain = true}) - -- maybe we need translate path seperator + -- maybe we need to translate path seperator -- @see https://github.com/xmake-io/xmake/discussions/3008 if count == 0 and is_host("windows") then io.replace(file, (remote_prefix:gsub("\\", "/")), local_prefix:gsub("\\", "/"), {plain = true}) @@ -275,7 +275,7 @@ function _enter_workdir(package) oldir = os.cd(workdir) end - -- we need copy source codes to the working directory with short path on windows + -- we need to copy source codes to the working directory with short path on windows -- -- Because the target name and source file path of this project are too long, -- it's absolute path exceeds the windows path length limit. diff --git a/xmake/modules/private/action/require/impl/actions/patch_sources.lua b/xmake/modules/private/action/require/impl/actions/patch_sources.lua index c6ba8607d..5306fbb9a 100644 --- a/xmake/modules/private/action/require/impl/actions/patch_sources.lua +++ b/xmake/modules/private/action/require/impl/actions/patch_sources.lua @@ -30,7 +30,7 @@ function _check_sha256(patch_hash, patch_file) local ok = (patch_hash == hash.sha256(patch_file)) if not ok and is_host("windows") then -- `git pull` maybe will replace lf to crlf in the patch text automatically on windows. - -- so we need attempt to fix this sha256 + -- so we need to attempt to fix this sha256 -- -- @see -- https://github.com/xmake-io/xmake-repo/pull/67 @@ -104,7 +104,7 @@ end -- patch the given package function main(package) - -- we need not patch it if we use the precompiled artifacts to install package + -- we don't need to patch it if we use the precompiled artifacts to install package if package:is_precompiled() then return end diff --git a/xmake/modules/private/action/require/impl/environment.lua b/xmake/modules/private/action/require/impl/environment.lua index aa44dcefe..8d7dbdcc0 100644 --- a/xmake/modules/private/action/require/impl/environment.lua +++ b/xmake/modules/private/action/require/impl/environment.lua @@ -58,7 +58,7 @@ function enter() instance:envs_enter() end - -- we need force to detect and flush detect cache after loading all environments + -- we need to force to detect and flush detect cache after loading all environments if not git then find_tool("git", {force = true}) end diff --git a/xmake/modules/private/action/require/impl/install_packages.lua b/xmake/modules/private/action/require/impl/install_packages.lua index f126445e4..22dcbfe48 100644 --- a/xmake/modules/private/action/require/impl/install_packages.lua +++ b/xmake/modules/private/action/require/impl/install_packages.lua @@ -371,7 +371,7 @@ end -- install packages function _install_packages(packages_install, packages_download, installdeps) - -- we need hide wait characters if is not a tty + -- we need to hide wait characters if is not a tty local show_wait = io.isatty() -- init installed packages @@ -478,7 +478,7 @@ function _install_packages(packages_install, packages_download, installdeps) if downloaded then if not action_install(instance) then assert(instance:is_precompiled(), "package(%s) should be precompiled", instance:name()) - -- we need disable built and re-download and re-install it + -- we need to disable built and re-download and re-install it instance:fallback_build() action_download(instance) action_install(instance) @@ -628,7 +628,7 @@ function _get_package_installdeps(packages) local installdeps = {} local packagesmap = {} for _, instance in ipairs(packages) do - -- we need use alias name first for toolchain/packages + -- we need to use alias name first for toolchain/packages packagesmap[instance:alias() or instance:name()] = instance end for _, instance in ipairs(packages) do @@ -636,7 +636,7 @@ function _get_package_installdeps(packages) if instance:orderdeps() then deps = table.copy(instance:orderdeps()) end - -- patch toolchain/packages to installdeps, because we need install toolchain package first + -- patch toolchain/packages to installdeps, because we need to install toolchain package first for _, toolchain in ipairs(instance:toolchains()) do for _, packagename in ipairs(toolchain:config("packages")) do if packagesmap[packagename] ~= instance then -- avoid loop recursion @@ -766,7 +766,7 @@ function main(requires, opt) print("upgrading packages ..") end - -- some packages are modified? we need fix packages list and all deps + -- some packages are modified? we need to fix packages list and all deps if packages_modified then order_packages = {} _replace_packages(packages, packages_modified) diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index f42ea495c..6f5cc75d2 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -144,7 +144,7 @@ function _load_require(require_str, requires_extra, parentinfo) end -- get required building configurations - -- we need clone a new configs object, because the whole requireinfo will be modified later. + -- we need to clone a new configs object, because the whole requireinfo will be modified later. -- @see https://github.com/xmake-io/xmake-repo/pull/2067 local require_build_configs = table.clone(require_extra.configs or require_extra.config) if require_extra.debug then @@ -155,7 +155,7 @@ function _load_require(require_str, requires_extra, parentinfo) -- require packge in the current host platform if require_extra.host then if is_subhost(core_package.targetplat()) and os.subarch() == core_package.targetarch() then - -- we need pass plat/arch to avoid repeat installation + -- we need to pass plat/arch to avoid repeat installation -- @see https://github.com/xmake-io/xmake/issues/1579 else require_extra.plat = os.subhost() @@ -513,7 +513,7 @@ function _finish_requireinfo(requireinfo, package) requireinfo.configs.vs_runtime = "MT" end end - -- we need ensure readonly configs + -- we need to ensure readonly configs for _, name in ipairs(table.keys(requireinfo.configs)) do local current = requireinfo.configs[name] local default = package:extraconf("configs", name, "default") @@ -852,7 +852,7 @@ function _load_package(packagename, requireinfo, opt) -- check package configurations _check_package_configurations(package) - -- save artifacts info, we need add it at last before buildhash need depend on package configurations + -- save artifacts info, we need to add it at last before buildhash need depend on package configurations -- it will switch to install precompiled binary package from xmake-mirror/build-artifacts if from_repo and not option.get("build") and not requireinfo.build then local artifacts_manifest = repository.artifacts_manifest(packagename, version) @@ -1084,7 +1084,7 @@ function should_install(package, opt) if package:exists() and _compatible_with_previous_librarydeps(package, opt) then return false end - -- we need not install it if this package need only be fetched + -- we don't need to install it if this package only need to be fetched if package:is_fetchonly() then return false end diff --git a/xmake/modules/private/action/require/impl/register_packages.lua b/xmake/modules/private/action/require/impl/register_packages.lua index 613cda5a3..ae66b6e75 100644 --- a/xmake/modules/private/action/require/impl/register_packages.lua +++ b/xmake/modules/private/action/require/impl/register_packages.lua @@ -39,14 +39,14 @@ function _register_required_package_libs(instance, required_package, is_deps) if fetchinfo then fetchinfo.name = nil if is_deps then - -- we need only reserve license for root package + -- we only need reserve license for root package -- -- @note the license compatibility between the root package and -- its dependent packages is guaranteed by the root package itself -- fetchinfo.license = nil - -- we need only some infos for root package + -- we only need some infos for root package fetchinfo.version = nil fetchinfo.static = nil fetchinfo.shared = nil diff --git a/xmake/modules/private/action/require/impl/utils/requirekey.lua b/xmake/modules/private/action/require/impl/utils/requirekey.lua index c696c1b8f..e44679f92 100644 --- a/xmake/modules/private/action/require/impl/utils/requirekey.lua +++ b/xmake/modules/private/action/require/impl/utils/requirekey.lua @@ -66,7 +66,7 @@ function main(requireinfo, opt) end if opt.hash then if key == "" then - key = "_" -- we need generate a fixed hash value + key = "_" -- we need to generate a fixed hash value end return hash.uuid(key):split("-", {plain = true})[1]:lower() else diff --git a/xmake/modules/private/action/trybuild/autoconf.lua b/xmake/modules/private/action/trybuild/autoconf.lua index f46cda6ef..9b5ac71f8 100644 --- a/xmake/modules/private/action/trybuild/autoconf.lua +++ b/xmake/modules/private/action/trybuild/autoconf.lua @@ -154,7 +154,7 @@ function _get_buildenvs() name = name:gsub("g%+%+%-%d+", "ld") envs.LD = dir and path.join(dir, name) or name end - -- we need use clang++ as cxx, autoconf will use it as linker + -- we need to use clang++ as cxx, autoconf will use it as linker -- https://github.com/xmake-io/xmake/issues/2170 local cxx = envs.CXX if cxx then diff --git a/xmake/modules/private/action/trybuild/cmake.lua b/xmake/modules/private/action/trybuild/cmake.lua index f4b78fdf7..66e407ec3 100644 --- a/xmake/modules/private/action/trybuild/cmake.lua +++ b/xmake/modules/private/action/trybuild/cmake.lua @@ -52,7 +52,7 @@ end -- get msvc function _get_msvc() local msvc = toolchain.load("msvc") - assert(msvc:check(), "vs not found!") -- we need check vs envs if it has been not checked yet + assert(msvc:check(), "vs not found!") -- we need to check vs envs if it has been not checked yet return msvc end @@ -235,7 +235,7 @@ function _get_configs_for_cross(configs) envs.CMAKE_CXX_COMPILER = _translate_bin_path(dir and path.join(dir, name) or name) end -- @note The link command line is set in Modules/CMake{C,CXX,Fortran}Information.cmake and defaults to using the compiler, not CMAKE_LINKER, - -- so we need set CMAKE_CXX_LINK_EXECUTABLE to use CMAKE_LINKER as linker. + -- so we need to set CMAKE_CXX_LINK_EXECUTABLE to use CMAKE_LINKER as linker. -- -- https://github.com/xmake-io/xmake-repo/pull/1039 -- https://stackoverflow.com/questions/1867745/cmake-use-a-custom-linker/25274328#25274328 @@ -289,7 +289,7 @@ function _get_configs_for_host_toolchain(configs) envs.CMAKE_CXX_COMPILER = _translate_bin_path(dir and path.join(dir, name) or name) end -- @note The link command line is set in Modules/CMake{C,CXX,Fortran}Information.cmake and defaults to using the compiler, not CMAKE_LINKER, - -- so we need set CMAKE_CXX_LINK_EXECUTABLE to use CMAKE_LINKER as linker. + -- so we need to set CMAKE_CXX_LINK_EXECUTABLE to use CMAKE_LINKER as linker. -- -- https://github.com/xmake-io/xmake-repo/pull/1039 -- https://stackoverflow.com/questions/1867745/cmake-use-a-custom-linker/25274328#25274328 @@ -305,7 +305,7 @@ function _get_configs_for_host_toolchain(configs) envs.CMAKE_STATIC_LINKER_FLAGS = table.concat(table.wrap(_get_buildenv("arflags")), ' ') envs.CMAKE_EXE_LINKER_FLAGS = table.concat(table.wrap(_get_buildenv("ldflags")), ' ') envs.CMAKE_SHARED_LINKER_FLAGS = table.concat(table.wrap(_get_buildenv("shflags")), ' ') - -- we need not set it as cross compilation if we just pass toolchain + -- we don't need to set it as cross compilation if we just pass toolchain -- https://github.com/xmake-io/xmake/issues/2170 if not is_plat(os.subhost()) then envs.CMAKE_SYSTEM_NAME = "Linux" diff --git a/xmake/modules/private/action/trybuild/meson.lua b/xmake/modules/private/action/trybuild/meson.lua index 0530702e6..2e0d7cb20 100644 --- a/xmake/modules/private/action/trybuild/meson.lua +++ b/xmake/modules/private/action/trybuild/meson.lua @@ -81,7 +81,7 @@ function _get_cross_file(buildir) file:print("[binaries]") local cc = _get_buildenv("cc") if cc then - -- we need split it, maybe is `xcrun -sdk iphoneos clang` + -- we need to split it, maybe is `xcrun -sdk iphoneos clang` file:print("c=['%s']", table.concat(os.argv(cc), "', '")) end local cxx = _get_buildenv("cxx") diff --git a/xmake/modules/private/async/jobpool.lua b/xmake/modules/private/async/jobpool.lua index 0b20cd5f4..7f9067343 100644 --- a/xmake/modules/private/async/jobpool.lua +++ b/xmake/modules/private/async/jobpool.lua @@ -123,7 +123,7 @@ function jobpool:pop() -- update all parents nodes for _, p in ipairs(parents) do - -- we need avoid add it the leafjobs repeatly, it will cause dead-loop when poping group job + -- we need to avoid adding it to leafjobs repeatly, it will cause dead-loop when poping group job -- @see https://github.com/xmake-io/xmake/issues/2740 if not p._leaf then p._priority = math.max(p._priority or 0, priority + 1) diff --git a/xmake/modules/private/async/runjobs.lua b/xmake/modules/private/async/runjobs.lua index 66ccf61b1..98ad63747 100644 --- a/xmake/modules/private/async/runjobs.lua +++ b/xmake/modules/private/async/runjobs.lua @@ -67,7 +67,7 @@ function main(name, jobs, opt) assert(jobs, "runjobs: no jobs!") -- show waiting tips? - local showprogress = io.isatty() and (opt.progress or opt.showtips) -- we need hide wait characters if is not a tty + local showprogress = io.isatty() and (opt.progress or opt.showtips) -- we need to hide wait characters if is not a tty local progress_helper local backnum = 0 if showprogress then @@ -186,7 +186,7 @@ function main(name, jobs, opt) break end - -- priority changed? we need wait all running jobs exited + -- priority changed? we need to wait all running jobs exited priority_curr = priority or priority_prev assert(priority_curr >= priority_prev, "runjobs: invalid priority(%d < %d)!", priority_curr, priority_prev) if priority_curr > priority_prev then @@ -261,7 +261,7 @@ function main(name, jobs, opt) end end) - -- need only one job exited if be same priority + -- only need one job exited if be same priority if priority_curr == priority_prev then scheduler.co_group_wait(group_name, {limit = 1}) else diff --git a/xmake/modules/private/cache/build_cache.lua b/xmake/modules/private/cache/build_cache.lua index bac6c069b..b0960c37a 100644 --- a/xmake/modules/private/cache/build_cache.lua +++ b/xmake/modules/private/cache/build_cache.lua @@ -260,10 +260,10 @@ function build(program, argv, opt) local objectfile_cached, objectfile_infofile = get(cachekey) if objectfile_cached then os.cp(objectfile_cached, cppinfo.objectfile) - -- we need update mtime for incremental compilation + -- we need to update mtime for incremental compilation -- @see https://github.com/xmake-io/xmake/issues/2620 os.touch(cppinfo.objectfile, {mtime = os.time()}) - -- we need get outdata/errdata to show warnings, + -- we need to get outdata/errdata to show warnings, -- @see https://github.com/xmake-io/xmake/issues/2452 if objectfile_infofile and os.isfile(objectfile_infofile) then local extrainfo = io.load(objectfile_infofile) diff --git a/xmake/modules/private/check/checkers/clang/tidy.lua b/xmake/modules/private/check/checkers/clang/tidy.lua index 6498ab093..9d735e546 100644 --- a/xmake/modules/private/check/checkers/clang/tidy.lua +++ b/xmake/modules/private/check/checkers/clang/tidy.lua @@ -170,7 +170,7 @@ function main(argv) instance:envs_enter() end - -- we need force to detect and flush detect cache after loading all environments + -- we need to force detect and flush detect cache after loading all environments if not clang_tidy then clang_tidy = find_tool("clang-tidy", {force = true}) end diff --git a/xmake/modules/private/service/distcc_build/client.lua b/xmake/modules/private/service/distcc_build/client.lua index 38b2145ef..89715f024 100644 --- a/xmake/modules/private/service/distcc_build/client.lua +++ b/xmake/modules/private/service/distcc_build/client.lua @@ -53,7 +53,7 @@ function distcc_build_client:init() self._PROJECTDIR = projectdir self._WORKDIR = path.join(project_config.directory(), "distcc_build") else - raise("we need enter a project directory with xmake.lua first!") + raise("we need to enter a project directory with xmake.lua first!") end -- init timeout @@ -249,10 +249,10 @@ function distcc_build_client:compile(program, argv, opt) local objectfile_cached, objectfile_infofile = build_cache.get(cachekey) if objectfile_cached then os.cp(objectfile_cached, cppinfo.objectfile) - -- we need update mtime for incremental compilation + -- we need to update mtime for incremental compilation -- @see https://github.com/xmake-io/xmake/issues/2620 os.touch(cppinfo.objectfile, {mtime = os.time()}) - -- we need get outdata/errdata to show warnings, + -- we need to get outdata/errdata to show warnings, -- @see https://github.com/xmake-io/xmake/issues/2452 if objectfile_infofile and os.isfile(objectfile_infofile) then local extrainfo = io.load(objectfile_infofile) @@ -526,7 +526,7 @@ function distcc_build_client:_connect_host(host) return end - -- we need user authorization? + -- Do we need user authorization? local user = host.user local token = host.token if not token and user then diff --git a/xmake/modules/private/service/remote_build/client.lua b/xmake/modules/private/service/remote_build/client.lua index d63a4f9ad..65e41eaf1 100644 --- a/xmake/modules/private/service/remote_build/client.lua +++ b/xmake/modules/private/service/remote_build/client.lua @@ -52,7 +52,7 @@ function remote_build_client:init() self._PROJECTDIR = projectdir self._WORKDIR = path.join(project_config.directory(), "remote_build") else - raise("we need enter a project directory with xmake.lua first!") + raise("we need to enter a project directory with xmake.lua first!") end -- init filesync @@ -79,7 +79,7 @@ function remote_build_client:connect() return end - -- we need user authorization? + -- Do we need user authorization? local token = config.get("remote_build.token") if not token and self:user() then diff --git a/xmake/modules/private/service/remote_cache/client.lua b/xmake/modules/private/service/remote_cache/client.lua index cd3d8d7d7..b6c4d8354 100644 --- a/xmake/modules/private/service/remote_cache/client.lua +++ b/xmake/modules/private/service/remote_cache/client.lua @@ -52,7 +52,7 @@ function remote_cache_client:init() self._PROJECTDIR = projectdir self._WORKDIR = path.join(project_config.directory(), "remote_cache") else - raise("we need enter a project directory with xmake.lua first!") + raise("we need to enter a project directory with xmake.lua first!") end -- init sockets @@ -77,7 +77,7 @@ function remote_cache_client:connect() return end - -- we need user authorization? + -- Do we need user authorization? local token = config.get("remote_cache.token") if not token and self:user() then diff --git a/xmake/modules/private/service/server.lua b/xmake/modules/private/service/server.lua index 891942a03..04cf7dd5f 100644 --- a/xmake/modules/private/service/server.lua +++ b/xmake/modules/private/service/server.lua @@ -112,7 +112,7 @@ function server:known_hosts_set(hosts) self._KNOWN_HOSTS = hosts and hashset.from(hosts) or hashset.new() end --- we need verify user +-- we need to verify user function server:need_verfiy() return not self:tokens():empty() end @@ -120,7 +120,7 @@ end -- verify user function server:verify_user(token, peeraddr) if not token then - return false, "client has no authorization, we need add username to connect address or token!" + return false, "client has no authorization, we need to add username to connect address or token!" end -- check authorization diff --git a/xmake/modules/private/tools/cl/parse_deps.lua b/xmake/modules/private/tools/cl/parse_deps.lua index 5a0cfe27d..187d655cd 100644 --- a/xmake/modules/private/tools/cl/parse_deps.lua +++ b/xmake/modules/private/tools/cl/parse_deps.lua @@ -73,7 +73,7 @@ function _normailize_dep(dep, projectdir) if dep:startswith(projectdir) then return path.relative(dep, projectdir) else - -- we need also check header files outside project + -- we also need to check header files outside project -- https://github.com/xmake-io/xmake/issues/1154 return dep end diff --git a/xmake/modules/private/tools/cl/parse_deps_json.lua b/xmake/modules/private/tools/cl/parse_deps_json.lua index 459a8b112..50f728815 100644 --- a/xmake/modules/private/tools/cl/parse_deps_json.lua +++ b/xmake/modules/private/tools/cl/parse_deps_json.lua @@ -73,7 +73,7 @@ function _normailize_dep(dep, projectdir) if dep:startswith(projectdir) then return path.relative(dep, projectdir) else - -- we need also check header files outside project + -- we also need to check header files outside project -- https://github.com/xmake-io/xmake/issues/1154 return dep end @@ -132,7 +132,7 @@ function main(depsdata) -- translate it local results = hashset.new() - local projectdir = os.projectdir():lower() -- we need generate lower string, because json values are all lower + local projectdir = os.projectdir():lower() -- we need to generate lower string, because json values are all lower for _, includefile in ipairs(includes) do includefile = _normailize_dep(includefile, projectdir) if includefile then diff --git a/xmake/modules/private/tools/gcc/parse_deps.lua b/xmake/modules/private/tools/gcc/parse_deps.lua index 3bc067861..24ff67f09 100644 --- a/xmake/modules/private/tools/gcc/parse_deps.lua +++ b/xmake/modules/private/tools/gcc/parse_deps.lua @@ -35,7 +35,7 @@ function _normailize_dep(dep, projectdir) if dep:startswith(projectdir) then return path.relative(dep, projectdir) else - -- we need also check header files outside project + -- we also need to check header files outside project -- https://github.com/xmake-io/xmake/issues/1154 return dep end @@ -72,7 +72,7 @@ function main(depsdata, opt) local plain = {plain = true} line = line:replace("\\ ", space_placeholder, plain) for _, includefile in ipairs(line:split(' ', plain)) do -- it will trim all internal spaces without `{strict = true}` - -- some gcc toolchains will some invalid paths (e.g. `d\:\xxx`), we need fix it + -- some gcc toolchains will some invalid paths (e.g. `d\:\xxx`), we need to fix it -- https://github.com/xmake-io/xmake/issues/1196 if is_host("windows") and includefile:match("^%w\\:") then includefile = includefile:replace("\\:", ":", plain) diff --git a/xmake/modules/private/utils/batchcmds.lua b/xmake/modules/private/utils/batchcmds.lua index 5948fe0cf..48d169b22 100644 --- a/xmake/modules/private/utils/batchcmds.lua +++ b/xmake/modules/private/utils/batchcmds.lua @@ -236,7 +236,7 @@ function batchcmds:compile(sourcefiles, objectfile, opt) opt = opt or {} opt.target = self._TARGET - -- wrap path for sourcefiles, because we need translate path for project generator + -- wrap path for sourcefiles, because we need to translate path for project generator if type(sourcefiles) == "table" then local sourcefiles_wrap = {} for _, sourcefile in ipairs(sourcefiles) do @@ -274,7 +274,7 @@ function batchcmds:compilev(argv, opt) compiler_inst = compiler.load(sourcekind, opt) end - -- we need translate path for the project generator + -- we need to translate path for the project generator for idx, item in ipairs(argv) do if type(item) == "string" then if item:startswith("-I") then @@ -299,7 +299,7 @@ function batchcmds:link(objectfiles, targetfile, opt) opt = opt or {} opt.target = target - -- wrap path for objectfiles, because we need translate path for project generator + -- wrap path for objectfiles, because we need to translate path for project generator local objectfiles_wrap = {} for _, objectfile in ipairs(objectfiles) do table.insert(objectfiles_wrap, path(objectfile)) @@ -310,7 +310,7 @@ function batchcmds:link(objectfiles, targetfile, opt) local linker_inst = target and target:linker() or linker.load(opt.targetkind, opt.sourcekinds, opt) local program, argv = linker_inst:linkargv(objectfiles, path(targetfile), opt) - -- we need translate path for the project generator + -- we need to translate path for the project generator for idx, item in ipairs(argv) do if type(item) == "string" then if item:startswith("-L") then diff --git a/xmake/modules/private/utils/rule_groups.lua b/xmake/modules/private/utils/rule_groups.lua index f8f8181ec..ae7279e78 100644 --- a/xmake/modules/private/utils/rule_groups.lua +++ b/xmake/modules/private/utils/rule_groups.lua @@ -25,7 +25,7 @@ import("core.project.config") import("core.project.project") -- get rule --- @note we need get rule from target first, because we maybe will inject and replace builtin rule in target +-- @note we need to get rule from target first, because we maybe will inject and replace builtin rule in target function get_rule(target, rulename) local ruleinst = assert(target:rule(rulename) or project.rule(rulename) or rule.rule(rulename), "unknown rule: %s", rulename) return ruleinst diff --git a/xmake/modules/private/utils/statistics.lua b/xmake/modules/private/utils/statistics.lua index 7619526a5..615cfce79 100644 --- a/xmake/modules/private/utils/statistics.lua +++ b/xmake/modules/private/utils/statistics.lua @@ -68,7 +68,7 @@ function post() return end - -- mark as posted first, avoid to post it repeatly + -- mark as posted first, avoid posting it repeatly io.writefile(markfile, "ok") -- init argument list diff --git a/xmake/modules/private/xrepo/action/fetch.lua b/xmake/modules/private/xrepo/action/fetch.lua index 1b9071be5..b54294a68 100644 --- a/xmake/modules/private/xrepo/action/fetch.lua +++ b/xmake/modules/private/xrepo/action/fetch.lua @@ -203,7 +203,7 @@ function _fetch_packages(packages) end end if not packagefile then - -- avoid to override extra configs in add_requires/xmake.lua + -- avoid overriding extra configs in add_requires/xmake.lua if extra then local extra_str = string.serialize(extra, {indent = false, strip = true}) table.insert(require_argv, "--extra=" .. extra_str) diff --git a/xmake/modules/private/xrepo/action/install.lua b/xmake/modules/private/xrepo/action/install.lua index 99764ab77..90aff97ca 100644 --- a/xmake/modules/private/xrepo/action/install.lua +++ b/xmake/modules/private/xrepo/action/install.lua @@ -290,7 +290,7 @@ function _install_packages(packages) end end if not packagefile then - -- avoid to override extra configs in add_requires/xmake.lua + -- avoid overriding extra configs in add_requires/xmake.lua if extra then local extra_str = string.serialize(extra, {indent = false, strip = true}) table.insert(require_argv, "--extra=" .. extra_str) diff --git a/xmake/modules/private/xrepo/action/remove.lua b/xmake/modules/private/xrepo/action/remove.lua index 1ccfa140e..dd850deb6 100644 --- a/xmake/modules/private/xrepo/action/remove.lua +++ b/xmake/modules/private/xrepo/action/remove.lua @@ -177,7 +177,7 @@ function _remove_packages(packages) end end if not packagefile then - -- avoid to override extra configs in add_requires/xmake.lua + -- avoid overriding extra configs in add_requires/xmake.lua if extra then local extra_str = string.serialize(extra, {indent = false, strip = true}) table.insert(require_argv, "--extra=" .. extra_str) diff --git a/xmake/modules/target/action/install/unix.lua b/xmake/modules/target/action/install/unix.lua index 341d2ddd0..ed49460dc 100644 --- a/xmake/modules/target/action/install/unix.lua +++ b/xmake/modules/target/action/install/unix.lua @@ -52,7 +52,7 @@ function _install_shared_for_package(target, pkg, outputdir) -- rm because symlink cannot overwrite existing file os.rm(targetname) end - -- we need reserve symlink + -- we need to reserve symlink -- @see https://github.com/xmake-io/xmake/issues/1582 os.vcp(sopath, outputdir, {symlink = true}) _g.installed_libfiles[sopath] = true diff --git a/xmake/modules/utils/archive/extract.lua b/xmake/modules/utils/archive/extract.lua index 620c84d69..f1213f275 100644 --- a/xmake/modules/utils/archive/extract.lua +++ b/xmake/modules/utils/archive/extract.lua @@ -115,7 +115,7 @@ function _extract_using_7z(archivefile, outputdir, extension, opt) outputdir = os.tmpfile({ramdisk = false}) .. ".tar" end - -- on msys2/cygwin? we need translate input path to cygwin-like path + -- on msys2/cygwin? we need to translate input path to cygwin-like path if is_subhost("msys", "cygwin") and program:gsub("\\", "/"):find("/usr/bin") then archivefile = path.cygwin_path(archivefile) end @@ -331,7 +331,7 @@ function _extract_using_bzip2(archivefile, outputdir, extension, opt) outputdir = os.tmpfile({ramdisk = false}) .. ".tar" end - -- on msys2/cygwin? we need translate input path to cygwin-like path + -- on msys2/cygwin? we need to translate input path to cygwin-like path if is_subhost("msys", "cygwin") and program:gsub("\\", "/"):find("/usr/bin") then archivefile = path.cygwin_path(archivefile) end diff --git a/xmake/plugins/doxygen/main.lua b/xmake/plugins/doxygen/main.lua index 9ebaac8f3..876e747d1 100644 --- a/xmake/plugins/doxygen/main.lua +++ b/xmake/plugins/doxygen/main.lua @@ -89,7 +89,7 @@ function main() instance:envs_enter() end - -- we need force to detect and flush detect cache after loading all environments + -- we need to force detect and flush detect cache after loading all environments if not doxygen then doxygen = find_tool("doxygen", {force = true}) end diff --git a/xmake/plugins/format/main.lua b/xmake/plugins/format/main.lua index 328bcb394..297e0a851 100644 --- a/xmake/plugins/format/main.lua +++ b/xmake/plugins/format/main.lua @@ -47,7 +47,7 @@ function main() instance:envs_enter() end - -- we need force to detect and flush detect cache after loading all environments + -- we need to force detect and flush detect cache after loading all environments if not clang_format then clang_format = find_tool("clang-format", {force = true}) end diff --git a/xmake/plugins/project/clang/compile_commands.lua b/xmake/plugins/project/clang/compile_commands.lua index ded2ad3c4..e7034abe4 100644 --- a/xmake/plugins/project/clang/compile_commands.lua +++ b/xmake/plugins/project/clang/compile_commands.lua @@ -62,7 +62,7 @@ function _translate_arguments(arguments) local is_include = false local lsp = _get_lsp() for idx, arg in ipairs(arguments) do - -- convert path to string, maybe we need convert path, but not supported now. + -- convert path to string, maybe we need to convert path, but not supported now. arg = tostring(arg) -- see https://github.com/xmake-io/xmake/issues/1721 @@ -72,7 +72,7 @@ function _translate_arguments(arguments) if arg:startswith("-isystem-after", 1, true) then arg = "-I" .. arg:sub(15) elseif arg:startswith("-isystem", 1, true) then - -- clangd support `-isystem`, we need not translate it + -- clangd support `-isystem`, we don't need to translate it -- @see https://github.com/xmake-io/xmake/issues/3020 if not lsp or lsp ~= "clangd" then arg = "-I" .. arg:sub(9) diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua index 12cec5bcb..6b62ebe8a 100644 --- a/xmake/plugins/project/cmake/cmakelists.lua +++ b/xmake/plugins/project/cmake/cmakelists.lua @@ -952,7 +952,7 @@ function _add_target_custom_commands_for_batchcmds(cmakelists, target, outputdir end if suffix == "before" then -- ADD_CUSTOM_COMMAND and PRE_BUILD did not work as I expected, - -- so we need use add_dependencies and fake target to support it. + -- so we need to use add_dependencies and fake target to support it. -- -- @see https://gitlab.kitware.com/cmake/cmake/-/issues/17802 -- @@ -1052,7 +1052,7 @@ function _add_target(cmakelists, target, outputdir) _add_target_dependencies(cmakelists, target) -- add target custom commands - -- we need call it first for running all rules, these rules will change some flags, e.g. c++modules + -- we need to call it first for running all rules, these rules will change some flags, e.g. c++modules _add_target_custom_commands(cmakelists, target, outputdir) -- add target precompilied header diff --git a/xmake/plugins/project/ninja/build_ninja.lua b/xmake/plugins/project/ninja/build_ninja.lua index fd3280b43..360bb075c 100644 --- a/xmake/plugins/project/ninja/build_ninja.lua +++ b/xmake/plugins/project/ninja/build_ninja.lua @@ -435,7 +435,7 @@ function make(outputdir) -- open the build.ninja file -- - -- we need change encoding to support msvc_deps_prefix + -- we need to change encoding to support msvc_deps_prefix -- @see https://github.com/ninja-build/ninja/issues/613 -- -- TODO maybe we need support more encoding for other languages diff --git a/xmake/plugins/project/utils/target_cmds.lua b/xmake/plugins/project/utils/target_cmds.lua index e732f07d7..4c7f4f008 100644 --- a/xmake/plugins/project/utils/target_cmds.lua +++ b/xmake/plugins/project/utils/target_cmds.lua @@ -92,7 +92,7 @@ end function get_target_buildcmd_sourcegroups(target, cmds, sourcegroups, suffix) for idx, group in irpairs(sourcegroups) do for _, item in pairs(group) do - -- buildcmd scripts are always in rule, so we need ignore target item (item.target). + -- buildcmd scripts are always in rule, so we need to ignore target item (item.target). local sourcebatch = item.sourcebatch if item.rule then if not _sourcebatch_is_built(sourcebatch) then diff --git a/xmake/plugins/project/vstudio/impl/vs201x_solution.lua b/xmake/plugins/project/vstudio/impl/vs201x_solution.lua index f482c1abd..ea2d8e1fa 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x_solution.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x_solution.lua @@ -37,7 +37,7 @@ function _make_projects(slnfile, vsinfo) local targets = {} local vctool = "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942" for targetname, target in table.orderpairs(project.targets()) do - -- we need set startup project for default or binary target + -- we need to set startup project for default or binary target -- @see https://github.com/xmake-io/xmake/issues/1249 if target:get("default") == true then table.insert(targets, 1, target) diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua index b81e3bed7..1be380130 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua @@ -1114,7 +1114,7 @@ function _make_source_file_forall(vcxprojfile, vsinfo, target, sourcefile, sourc -- for *.c/cpp/cu files else - -- we need use different object directory and allow parallel building + -- we need to use different object directory and allow parallel building -- -- @see https://github.com/xmake-io/xmake/issues/2016 -- https://github.com/xmake-io/xmake/issues/1062 @@ -1246,7 +1246,7 @@ function _make_source_file_forspec(vcxprojfile, vsinfo, target, sourcefile, sour -- for *.c/cpp/cu files else - -- we need use different object directory and allow parallel building + -- we need to use different object directory and allow parallel building -- -- @see https://github.com/xmake-io/xmake/issues/2016 -- https://github.com/xmake-io/xmake/issues/1062 @@ -1347,7 +1347,7 @@ function _make_source_files(vcxprojfile, vsinfo, target) local pcheader = target.pcxxheader or target.pcheader vcxprojfile:enter("<ItemGroup>") for _, includefile in ipairs(target.headerfiles) do - -- we need ignore pcheader file to fix https://github.com/xmake-io/xmake/issues/1171 + -- we need to ignore pcheader file to fix https://github.com/xmake-io/xmake/issues/1171 if not pcheader or includefile ~= pcheader then _make_header_file(vcxprojfile, includefile, target.project_dir) end diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua index edc4a17b8..6fe8c7f90 100644 --- a/xmake/plugins/project/vsxmake/getinfo.lua +++ b/xmake/plugins/project/vsxmake/getinfo.lua @@ -541,7 +541,7 @@ function main(outputdir, vsinfo) end end - -- we need set startup project for default or binary target + -- we need to set startup project for default or binary target -- @see https://github.com/xmake-io/xmake/issues/1249 local targetnames = {} for targetname, target in table.orderpairs(project.targets()) do diff --git a/xmake/plugins/project/xcode/xcodeproj.lua b/xmake/plugins/project/xcode/xcodeproj.lua index 6e3abe3da..15ba420f8 100644 --- a/xmake/plugins/project/xcode/xcodeproj.lua +++ b/xmake/plugins/project/xcode/xcodeproj.lua @@ -22,7 +22,7 @@ import(".cmake.cmakelists") import("lib.detect.find_tool") --- TODO maybe we need implement it by myself, do not use cmake +-- TODO maybe we need to implement it by myself, do not use cmake function make(outputdir) -- check diff --git a/xmake/rules/c++/modules/modules_support/clang.lua b/xmake/rules/c++/modules/modules_support/clang.lua index 888f0f334..40bcec06e 100644 --- a/xmake/rules/c++/modules/modules_support/clang.lua +++ b/xmake/rules/c++/modules/modules_support/clang.lua @@ -163,7 +163,7 @@ function load(target) target:set("symbols", dep_symbols and dep_symbols or "none") end - -- if use libc++, we need install libc++ and libc++abi + -- if use libc++, we need to install libc++ and libc++abi -- -- on ubuntu: -- sudo apt install libc++-dev libc++abi-15-dev @@ -208,7 +208,7 @@ function _get_toolchain_includedirs_for_stlheaders(target, includedirs, clang) end -- do compile for batchcmds --- @note we need use batchcmds:compilev to translate paths in compflags for generator, e.g. -Ixx +-- @note we need to use batchcmds:compilev to translate paths in compflags for generator, e.g. -Ixx function _batchcmds_compile(batchcmds, target, sourcefile, flags) local compinst = target:compiler("cxx") local compflags = compinst:compflags({sourcefile = sourcefile, target = target}) @@ -620,7 +620,7 @@ function build_modules_for_batchjobs(target, batchjobs, objectfiles, modules, op elseif requiresflags then local cxxflags = {} for _, flag in ipairs(requiresflags) do - -- we need wrap flag to support flag with space + -- we need to wrap flag to support flag with space if type(flag) == "string" and flag:find(" ", 1, true) then table.insert(cxxflags, {flag}) else @@ -685,7 +685,7 @@ function build_modules_for_batchcmds(target, batchcmds, objectfiles, modules, op elseif requiresflags then local cxxflags = {} for _, flag in ipairs(requiresflags) do - -- we need wrap flag to support flag with space + -- we need to wrap flag to support flag with space if type(flag) == "string" and flag:find(" ", 1, true) then table.insert(cxxflags, {flag}) else diff --git a/xmake/rules/c++/modules/modules_support/common.lua b/xmake/rules/c++/modules/modules_support/common.lua index 65267bcbd..95cdc1626 100644 --- a/xmake/rules/c++/modules/modules_support/common.lua +++ b/xmake/rules/c++/modules/modules_support/common.lua @@ -544,7 +544,7 @@ function fallback_generate_dependencies(target, jsonfile, sourcefile, preprocess end end local module_depname = line:match("import%s+(.+)%s*;") - -- we need parse module interface dep in cxx/impl_unit.cpp, e.g. hello.mpp and hello_impl.cpp + -- we need to parse module interface dep in cxx/impl_unit.cpp, e.g. hello.mpp and hello_impl.cpp -- @see https://github.com/xmake-io/xmake/pull/2664#issuecomment-1213167314 if not module_depname and not has_module_extension(sourcefile) then module_depname = module_name_private diff --git a/xmake/rules/c++/modules/modules_support/gcc.lua b/xmake/rules/c++/modules/modules_support/gcc.lua index a243a8762..20b783821 100644 --- a/xmake/rules/c++/modules/modules_support/gcc.lua +++ b/xmake/rules/c++/modules/modules_support/gcc.lua @@ -110,7 +110,7 @@ function _get_toolchain_includedirs_for_stlheaders(includedirs, gcc) end -- do compile for batchcmds --- @note we need use batchcmds:compilev to translate paths in compflags for generator, e.g. -Ixx +-- @note we need to use batchcmds:compilev to translate paths in compflags for generator, e.g. -Ixx function _batchcmds_compile(batchcmds, target, flags, sourcefile) local compinst = target:compiler("cxx") local compflags = compinst:compflags({sourcefile = sourcefile}, {target = target}) diff --git a/xmake/rules/c++/modules/modules_support/msvc.lua b/xmake/rules/c++/modules/modules_support/msvc.lua index 411b32b20..703374423 100644 --- a/xmake/rules/c++/modules/modules_support/msvc.lua +++ b/xmake/rules/c++/modules/modules_support/msvc.lua @@ -71,7 +71,7 @@ function _compile(target, flags, sourcefile) end -- do compile for batchcmds --- @note we need use batchcmds:compilev to translate paths in compflags for generator, e.g. -Ixx +-- @note we need to use batchcmds:compilev to translate paths in compflags for generator, e.g. -Ixx function _batchcmds_compile(batchcmds, target, flags, sourcefile) local compinst = target:compiler("cxx") local compflags = compinst:compflags({sourcefile = sourcefile, target = target}) @@ -741,7 +741,7 @@ function get_requiresflags(target, requires, opt) local modulemap_ = _get_modulemap_from_mapper(dep) if modulemap_[name] then table.join2(flags, modulemap_[name].flag) - -- we need ignore headerunits from deps + -- we need to ignore headerunits from deps -- @see https://github.com/xmake-io/xmake/issues/3925 local skip = 0 for _, flag in ipairs(modulemap_[name].deps) do diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua index 2f9b207bf..ab90f67a7 100644 --- a/xmake/rules/c++/modules/xmake.lua +++ b/xmake/rules/c++/modules/xmake.lua @@ -91,7 +91,7 @@ rule("c++.build.modules.builder") -- build modules common.build_modules_for_batchjobs(target, batchjobs, sourcebatch, modules, opt) - -- generate headerunits and we need do it before building modules + -- generate headerunits and we need to do it before building modules local user_headerunits, stl_headerunits = common.get_headerunits(target, sourcebatch, modules) if user_headerunits or stl_headerunits then -- we need new group(headerunits) diff --git a/xmake/rules/go/env/xmake.lua b/xmake/rules/go/env/xmake.lua index ca627959a..0ef6d3d2a 100644 --- a/xmake/rules/go/env/xmake.lua +++ b/xmake/rules/go/env/xmake.lua @@ -37,7 +37,7 @@ rule("go.env") local gopkgdir = path.join(os.isdir(goroot_local) and goroot_local or goroot, "pkg", goos .. "_" .. goarch) if not os.isdir(gopkgdir) or os.emptydir(gopkgdir) then local gosrcdir = path.join(goroot, "src") - local confirm = utils.confirm({default = true, description = ("we need build go for %s_%s only once first!"):format(goos, goarch)}) + local confirm = utils.confirm({default = true, description = ("we need to build go for %s_%s only once first!"):format(goos, goarch)}) if confirm then local build_task = function () tty.erase_line_to_start().cr() @@ -47,7 +47,7 @@ rule("go.env") os.vrunv(path.join(gosrcdir, "make.bat"), {"--no-clean"}, {envs = {GOOS = goos, GOARCH = goarch, GOROOT_BOOTSTRAP = goroot}, curdir = gosrcdir}) else - -- we need copy goroot to the local directory to solving permission problem + -- we need to copy goroot to the local directory to solving permission problem if is_host("linux") then os.vcp(goroot, goroot_local) goroot = path.absolute(goroot_local) diff --git a/xmake/rules/objc++/xmake.lua b/xmake/rules/objc++/xmake.lua index bd93bfa82..9fbf392e8 100644 --- a/xmake/rules/objc++/xmake.lua +++ b/xmake/rules/objc++/xmake.lua @@ -23,7 +23,7 @@ rule("objc.build") set_sourcekinds("mm") add_deps("objc.build.pcheader", "c.build.optimization") after_load(function (target) - -- deprecated, we need only use `add_mflags("-fno-objc-arc")` to override it + -- deprecated, we only need to use `add_mflags("-fno-objc-arc")` to override it if target:values("objc.build.arc") == false then target:add("mflags", "-fno-objc-arc") end @@ -38,7 +38,7 @@ rule("objc++.build") set_sourcekinds("mxx") add_deps("objc++.build.pcheader", "c++.build.optimization") after_load(function (target) - -- deprecated, we need only use `add_mxxflags("-fno-objc-arc")` to override it + -- deprecated, we only need to use `add_mxxflags("-fno-objc-arc")` to override it if target:values("objc++.build.arc") == false then target:add("mxxflags", "-fno-objc-arc") end diff --git a/xmake/rules/platform/linux/driver/driver_modules.lua b/xmake/rules/platform/linux/driver/driver_modules.lua index 09b4c72a0..67fbb8d22 100644 --- a/xmake/rules/platform/linux/driver/driver_modules.lua +++ b/xmake/rules/platform/linux/driver/driver_modules.lua @@ -194,7 +194,7 @@ module_exit(hello_exit); end function load(target) - -- we need only need binary kind, because we will rewrite on_link + -- we only need binary kind, because we will rewrite on_link target:set("kind", "binary") target:set("extension", ".ko") end @@ -213,7 +213,7 @@ function config(target) assert(not target:rule(rulename), "target(%s) is linux driver module, it need not rule(%s)!", target:name(), rulename) end - -- we need disable includedirs from add_packages("linux-headers") + -- we need to disable includedirs from add_packages("linux-headers") if target:pkg("linux-headers") then target:pkg("linux-headers"):set("includedirs", nil) target:pkg("linux-headers"):set("sysincludedirs", nil) @@ -272,7 +272,7 @@ function link(target, opt) io.writefile(targetfile_mod, table.concat(objectfiles, "\n") .. "\n\n") -- generate .sourcename.o.cmd - -- we need only touch an empty file, otherwise modpost command will raise error. + -- we only need to touch an empty file, otherwise modpost command will raise error. for _, objectfile in ipairs(objectfiles) do local objectdir = path.directory(objectfile) local objectname = path.filename(objectfile) diff --git a/xmake/rules/protobuf/proto.lua b/xmake/rules/protobuf/proto.lua index 349864e9e..f426be350 100644 --- a/xmake/rules/protobuf/proto.lua +++ b/xmake/rules/protobuf/proto.lua @@ -56,7 +56,7 @@ function _get_grpc_cpp_plugin(target, sourcekind) return assert(grpc_cpp_plugin and grpc_cpp_plugin.program, "grpc_cpp_plugin not found!") end --- we need add some configs to export includedirs to other targets in on_load +-- we need to add some configs to export includedirs to other targets in on_load -- @see https://github.com/xmake-io/xmake/issues/2256 function load(target, sourcekind) diff --git a/xmake/rules/qt/deploy/android.lua b/xmake/rules/qt/deploy/android.lua index 2e2946194..5aea7fa02 100644 --- a/xmake/rules/qt/deploy/android.lua +++ b/xmake/rules/qt/deploy/android.lua @@ -118,7 +118,7 @@ function main(target, opt) -- install target to android-build/libs first if qt_sdkver and qt_sdkver:ge("5.14") then - -- we need copy target to android-build/libs/armeabi/libxxx_armeabi.so after Qt 5.14.0 + -- we need to copy target to android-build/libs/armeabi/libxxx_armeabi.so after Qt 5.14.0 os.cp(target:targetfile(), path.join(android_buildir, "libs", target_arch, "lib" .. target:basename() .. "_" .. target_arch .. ".so")) else os.cp(target:targetfile(), path.join(android_buildir, "libs", target_arch, path.filename(target:targetfile()))) diff --git a/xmake/rules/qt/load.lua b/xmake/rules/qt/load.lua index d9feb1059..0321e0ce4 100644 --- a/xmake/rules/qt/load.lua +++ b/xmake/rules/qt/load.lua @@ -73,7 +73,7 @@ function _find_static_links_3rd(target, linkdirs, qt_sdkver, libpattern) for _, linkdir in ipairs(linkdirs) do for _, libpath in ipairs(os.files(path.join(linkdir, libpattern))) do local basename = path.basename(libpath) - -- we need ignore qt framework libraries, e.g. libQt5xxx.a, Qt5Core.lib .. + -- we need to ignore qt framework libraries, e.g. libQt5xxx.a, Qt5Core.lib .. -- but bundled library names like libQt5Bundledxxx.a on Qt6.x -- @see https://github.com/xmake-io/xmake/issues/3572 if basename:startswith("libQt" .. qt_sdkver:major() .. "Bundled") or ( @@ -181,7 +181,7 @@ function main(target, opt) end end - -- add defines for the compile mode + -- add definitions for the compile mode if is_mode("debug") then target:add("defines", "QT_QML_DEBUG") elseif is_mode("release") then @@ -214,7 +214,7 @@ function main(target, opt) end end - -- backup the user syslinks, we need add them behind the qt syslinks + -- backup the user syslinks, we need to add them behind the qt syslinks local syslinks_user = target:get("syslinks") target:set("syslinks", nil) @@ -255,7 +255,7 @@ function main(target, opt) _add_includedirs(target, path.join(qt.includedir, private_dir, qt.sdkver)) end else - -- add defines + -- add definitions target:add("defines", "QT_" .. framework:sub(3):upper() .. "_LIB") -- add includedirs @@ -349,7 +349,7 @@ function main(target, opt) target:add("syslinks", "ws2_32", "gdi32", "ole32", "advapi32", "shell32", "user32", "opengl32", "imm32", "winmm", "iphlpapi") elseif target:is_plat("mingw") then target:set("frameworks", nil) - -- we need fix it, because gcc maybe does not work on latest mingw when `-isystem D:\a\_temp\msys64\mingw64\include` is passed. + -- we need to fix it, because gcc maybe does not work on latest mingw when `-isystem D:\a\_temp\msys64\mingw64\include` is passed. -- and qt.includedir will be this path value when Qt sdk directory just is `D:\a\_temp\msys64\mingw64` -- @see https://github.com/msys2/MINGW-packages/issues/10761#issuecomment-1044302523 if is_subhost("msys") then diff --git a/xmake/rules/qt/moc/xmake.lua b/xmake/rules/qt/moc/xmake.lua index 547c72b3b..1b90757b6 100644 --- a/xmake/rules/qt/moc/xmake.lua +++ b/xmake/rules/qt/moc/xmake.lua @@ -95,7 +95,7 @@ rule("qt.moc") batchcmds:mkdir(path.directory(sourcefile_moc)) batchcmds:vrunv(moc, table.join(user_flags, flags, path(sourcefile), "-o", path(sourcefile_moc))) - -- we need compile this moc_xxx.cpp file if exists Q_PRIVATE_SLOT, @see https://github.com/xmake-io/xmake/issues/750 + -- we need to compile this moc_xxx.cpp file if exists Q_PRIVATE_SLOT, @see https://github.com/xmake-io/xmake/issues/750 local mocdata = io.readfile(sourcefile) if mocdata and mocdata:find("Q_PRIVATE_SLOT") or sourcefile_moc:endswith(".moc") then -- add includedirs of sourcefile_moc diff --git a/xmake/rules/qt/ui/xmake.lua b/xmake/rules/qt/ui/xmake.lua index 27fbe5764..b4f769050 100644 --- a/xmake/rules/qt/ui/xmake.lua +++ b/xmake/rules/qt/ui/xmake.lua @@ -34,7 +34,7 @@ rule("qt.ui") end assert(uic and os.isexec(uic), "uic not found!") - -- add includedirs, @note we need create this directory first to suppress warning (file not found). + -- add includedirs, @note we need to create this directory first to suppress warning (file not found). -- and we muse add it in load stage to ensure `depend.on_changed` work. -- -- @see https://github.com/xmake-io/xmake/issues/1180 diff --git a/xmake/rules/utils/inherit_links/inherit_links.lua b/xmake/rules/utils/inherit_links/inherit_links.lua index 79c737503..4c38cf788 100644 --- a/xmake/rules/utils/inherit_links/inherit_links.lua +++ b/xmake/rules/utils/inherit_links/inherit_links.lua @@ -60,7 +60,7 @@ function main(target) -- rust maybe will disable inherit links, only inherit linkdirs if target:data("inherit.links.deplink") ~= false then - -- we need move target link to head + -- we need to move target link to head _add_export_value(target, "links", target:linkname()) local links = target:get("links", {rawref = true}) if links and type(links) == "table" and #links > 1 then @@ -71,14 +71,14 @@ function main(target) _add_export_value(target, "linkdirs", path.directory(targetfile)) if target:rule("go") then - -- we need add includedirs to support import modules for golang + -- we need to add includedirs to support import modules for golang _add_export_value(target, "includedirs", path.directory(targetfile)) end -- we export all links and linkdirs in self/packages/options to the parent target by default -- -- @note we only export links for static target, - -- and we need pass `{public = true}` to add_packages/add_links/... to export it if want to export links for shared target + -- and we need to pass `{public = true}` to add_packages/add_links/... to export it if want to export links for shared target -- if target:data("inherit.links.exportlinks") ~= false then if targetkind == "static" then diff --git a/xmake/rules/utils/merge_archive/xmake.lua b/xmake/rules/utils/merge_archive/xmake.lua index 6d58fe4f7..39c913804 100644 --- a/xmake/rules/utils/merge_archive/xmake.lua +++ b/xmake/rules/utils/merge_archive/xmake.lua @@ -21,7 +21,7 @@ rule("utils.merge.archive") set_extensions(".a", ".lib") after_load(function (target) - -- we need disable inherit links if all static deps have been merged + -- we need to disable inherit links if all static deps have been merged -- and we must disable it in after_load, because it will be called before rule(utils.inherit.links).on_config -- -- @see https://github.com/xmake-io/xmake/issues/3404 diff --git a/xmake/rules/vala/xmake.lua b/xmake/rules/vala/xmake.lua index a4b3f4b1e..85a74d239 100644 --- a/xmake/rules/vala/xmake.lua +++ b/xmake/rules/vala/xmake.lua @@ -21,7 +21,7 @@ rule("vala.build") set_extensions(".vala") on_load(function (target) - -- only vala source files? we need patch c source kind for linker + -- only vala source files? we need to patch c source kind for linker local sourcekinds = target:sourcekinds() if #sourcekinds == 0 then table.insert(sourcekinds, "cc") diff --git a/xmake/rules/verilator/verilator.lua b/xmake/rules/verilator/verilator.lua index eebee4121..7800bae18 100644 --- a/xmake/rules/verilator/verilator.lua +++ b/xmake/rules/verilator/verilator.lua @@ -105,7 +105,7 @@ function _get_lanuage_flags(target) end function config(target) - local toolchain = assert(target:toolchain("verilator"), 'we need set_toolchains("verilator") in target("%s")', target:name()) + local toolchain = assert(target:toolchain("verilator"), 'we need to set_toolchains("verilator") in target("%s")', target:name()) local verilator = assert(toolchain:config("verilator"), "verilator not found!") local autogendir = path.join(target:autogendir(), "rules", "verilator") local tmpdir = os.tmpfile() .. ".dir" @@ -191,7 +191,7 @@ endmodule]]) target:add("languages", "c++20") end - -- add defines for switches + -- add definitions for switches for k, v in table.orderpairs(switches) do target:add("defines", "VM_" .. k .. "=" .. v) end @@ -208,7 +208,7 @@ endmodule]]) end function build_cppfiles(target, batchjobs, sourcebatch, opt) - local toolchain = assert(target:toolchain("verilator"), 'we need set_toolchains("verilator") in target("%s")', target:name()) + local toolchain = assert(target:toolchain("verilator"), 'we need to set_toolchains("verilator") in target("%s")', target:name()) local verilator = assert(toolchain:config("verilator"), "verilator not found!") local autogendir = path.join(target:autogendir(), "rules", "verilator") local targetname = target:name() @@ -228,7 +228,7 @@ function build_cppfiles(target, batchjobs, sourcebatch, opt) local sourcefiles = sourcebatch.sourcefiles for _, sourcefile in ipairs(sourcefiles) do progress.show(opt.progress or 0, "${color.build.object}compiling.verilog %s", sourcefile) - -- we need use slashes to fix it on windows + -- we need to use slashes to fix it on windows -- @see https://github.com/verilator/verilator/issues/3873 if is_host("windows") then sourcefile = sourcefile:gsub("\\", "/") @@ -264,7 +264,7 @@ function build_cppfiles(target, batchjobs, sourcebatch, opt) end function buildcmd_vfiles(target, batchcmds, sourcebatch, opt) - local toolchain = assert(target:toolchain("verilator"), 'we need set_toolchains("verilator") in target("%s")', target:name()) + local toolchain = assert(target:toolchain("verilator"), 'we need to set_toolchains("verilator") in target("%s")', target:name()) local verilator = assert(toolchain:config("verilator"), "verilator not found!") local autogendir = path.join(target:autogendir(), "rules", "verilator") local targetname = target:name() @@ -284,7 +284,7 @@ function buildcmd_vfiles(target, batchcmds, sourcebatch, opt) for _, sourcefile in ipairs(sourcefiles) do batchcmds:show_progress(opt.progress, "${color.build.object}compiling.verilog %s", sourcefile) table.insert(argv, path(sourcefile, function (v) - -- we need use slashes to fix it on windows + -- we need to use slashes to fix it on windows -- @see https://github.com/verilator/verilator/issues/3873 if is_host("windows") then v = v:gsub("\\", "/") diff --git a/xmake/rules/wdk/env/load.lua b/xmake/rules/wdk/env/load.lua index 9b73357e2..5e13ed831 100644 --- a/xmake/rules/wdk/env/load.lua +++ b/xmake/rules/wdk/env/load.lua @@ -47,7 +47,7 @@ function umdf(target) -- get arch local arch = config.arch() - -- add defines + -- add definitions local umdfver = wdk.umdfver:split('%.') if arch == "x64" then target:add("defines", "_WIN64", "_AMD64_", "AMD64") @@ -78,7 +78,7 @@ function kmdf(target) -- get arch local arch = config.arch() - -- add defines + -- add definitions local winver = target:values("wdk.env.winver") or config.get("wdk_winver") local kmdfver = wdk.kmdfver:split('%.') if arch == "x64" then @@ -117,7 +117,7 @@ function wdm(target) -- get arch local arch = config.arch() - -- add defines + -- add definitions local winver = target:values("wdk.env.winver") or config.get("wdk_winver") local kmdfver = wdk.kmdfver:split('%.') if arch == "x64" then diff --git a/xmake/rules/wdk/env/xmake.lua b/xmake/rules/wdk/env/xmake.lua index 3260dd43c..cbf0be9fa 100644 --- a/xmake/rules/wdk/env/xmake.lua +++ b/xmake/rules/wdk/env/xmake.lua @@ -47,7 +47,7 @@ rule("wdk.env") wdk.kmdfver = kmdfver end - -- add defines for debug + -- add definitions for debug if is_mode("debug") then target:add("defines", "DBG=1") end @@ -67,7 +67,7 @@ rule("wdk.env") -- get ntddi version local ntddi_version = os_winver.ntddi_version(winver or "") or "0x0A000000" - -- add defines for winver + -- add definitions for winver target:add("defines", "_WIN32_WINNT=" .. winnt_version, "WINVER=" .. winver_version, "NTDDI_VERSION=" .. ntddi_version, "_NT_TARGET_VERSION=" .. target_version) -- set builtin version values diff --git a/xmake/rules/xcode/application/xmake.lua b/xmake/rules/xcode/application/xmake.lua index d328262c0..b4969b3df 100644 --- a/xmake/rules/xcode/application/xmake.lua +++ b/xmake/rules/xcode/application/xmake.lua @@ -27,7 +27,7 @@ rule("xcode.application") -- we must set kind before target.on_load(), may we will use target in on_load() on_load("load") - -- depend xcode.framework? we need disable `build.across_targets_in_parallel` policy + -- depend xcode.framework? we need to disable `build.across_targets_in_parallel` policy after_load(function (target) local across_targets_in_parallel for _, dep in ipairs(target:orderdeps()) do diff --git a/xmake/templates/c++/tbox.console/project/src/xmake.lua b/xmake/templates/c++/tbox.console/project/src/xmake.lua index 8664f5347..fd618b9ee 100644 --- a/xmake/templates/c++/tbox.console/project/src/xmake.lua +++ b/xmake/templates/c++/tbox.console/project/src/xmake.lua @@ -4,7 +4,7 @@ target("${TARGETNAME}") -- set kind set_kind("binary") - -- add defines + -- add definitions add_defines("__tb_prefix__=\"${TARGETNAME}\"") -- add packages diff --git a/xmake/templates/c++/tbox.shared/project/src/_library/xmake.lua b/xmake/templates/c++/tbox.shared/project/src/_library/xmake.lua index dd27e7cff..5c637ccda 100644 --- a/xmake/templates/c++/tbox.shared/project/src/_library/xmake.lua +++ b/xmake/templates/c++/tbox.shared/project/src/_library/xmake.lua @@ -4,7 +4,7 @@ target("${TARGETNAME}") -- set kind set_kind("shared") - -- add defines + -- add definitions add_defines("__tb_prefix__=\"${TARGETNAME}\"") -- add the header files for installing diff --git a/xmake/templates/c++/tbox.static/project/src/_library/xmake.lua b/xmake/templates/c++/tbox.static/project/src/_library/xmake.lua index 1c7d3ea7b..bdcf999f8 100644 --- a/xmake/templates/c++/tbox.static/project/src/_library/xmake.lua +++ b/xmake/templates/c++/tbox.static/project/src/_library/xmake.lua @@ -4,7 +4,7 @@ target("${TARGETNAME}") -- set kind set_kind("static") - -- add defines + -- add definitions add_defines("__tb_prefix__=\"${TARGETNAME}\"") -- add the header files for installing diff --git a/xmake/templates/c/tbox.console/project/src/xmake.lua b/xmake/templates/c/tbox.console/project/src/xmake.lua index 22773aad5..40847766c 100644 --- a/xmake/templates/c/tbox.console/project/src/xmake.lua +++ b/xmake/templates/c/tbox.console/project/src/xmake.lua @@ -4,7 +4,7 @@ target("${TARGETNAME}") -- set kind set_kind("binary") - -- add defines + -- add definitions add_defines("__tb_prefix__=\"${TARGETNAME}\"") -- add packages diff --git a/xmake/templates/c/tbox.shared/project/src/_library/xmake.lua b/xmake/templates/c/tbox.shared/project/src/_library/xmake.lua index 4f77e0337..0c527e2b6 100644 --- a/xmake/templates/c/tbox.shared/project/src/_library/xmake.lua +++ b/xmake/templates/c/tbox.shared/project/src/_library/xmake.lua @@ -4,7 +4,7 @@ target("${TARGETNAME}") -- set kind set_kind("shared") - -- add defines + -- add definitions add_defines("__tb_prefix__=\"${TARGETNAME}\"") -- add the header files for installing diff --git a/xmake/templates/c/tbox.static/project/src/_library/xmake.lua b/xmake/templates/c/tbox.static/project/src/_library/xmake.lua index fecf32edb..782c92616 100644 --- a/xmake/templates/c/tbox.static/project/src/_library/xmake.lua +++ b/xmake/templates/c/tbox.static/project/src/_library/xmake.lua @@ -4,7 +4,7 @@ target("${TARGETNAME}") -- set kind set_kind("static") - -- add defines + -- add definitions add_defines("__tb_prefix__=\"${TARGETNAME}\"") -- add the header files for installing diff --git a/xmake/toolchains/clang-cl/check.lua b/xmake/toolchains/clang-cl/check.lua index 7f683f2c8..a2397908e 100644 --- a/xmake/toolchains/clang-cl/check.lua +++ b/xmake/toolchains/clang-cl/check.lua @@ -27,7 +27,7 @@ import("lib.detect.find_tool") -- attempt to check vs environment function _check_vsenv(toolchain) - -- have been checked? + -- has been checked? local vs = toolchain:config("vs") or config.get("vs") if vs then vs = tostring(vs) diff --git a/xmake/toolchains/dlang/check.lua b/xmake/toolchains/dlang/check.lua index fb0dc0aaa..16bb6cc62 100644 --- a/xmake/toolchains/dlang/check.lua +++ b/xmake/toolchains/dlang/check.lua @@ -30,7 +30,7 @@ function main(toolchain) return true end - -- we need find ldc2 and gdc in the given toolchain sdk directory + -- we need to find ldc2 and gdc in the given toolchain sdk directory local sdkdir = toolchain:sdkdir() local bindir = toolchain:bindir() local cross = toolchain:cross() diff --git a/xmake/toolchains/gdc/check.lua b/xmake/toolchains/gdc/check.lua index 7df55de8b..1d9c93265 100644 --- a/xmake/toolchains/gdc/check.lua +++ b/xmake/toolchains/gdc/check.lua @@ -30,7 +30,7 @@ function main(toolchain) return true end - -- we need find gdc2 in the given toolchain sdk directory + -- we need to find gdc2 in the given toolchain sdk directory local sdkdir = toolchain:sdkdir() local bindir = toolchain:bindir() local cross = toolchain:cross() diff --git a/xmake/toolchains/ldc/check.lua b/xmake/toolchains/ldc/check.lua index 44f6a9a63..c6fb2d103 100644 --- a/xmake/toolchains/ldc/check.lua +++ b/xmake/toolchains/ldc/check.lua @@ -30,7 +30,7 @@ function main(toolchain) return true end - -- we need find ldc2 in the given toolchain sdk directory + -- we need to find ldc2 in the given toolchain sdk directory local sdkdir = toolchain:sdkdir() local bindir = toolchain:bindir() local cross = toolchain:cross() diff --git a/xmake/toolchains/ndk/check.lua b/xmake/toolchains/ndk/check.lua index 991e4e3d9..fd6dc3b99 100644 --- a/xmake/toolchains/ndk/check.lua +++ b/xmake/toolchains/ndk/check.lua @@ -58,7 +58,7 @@ function _check_ndk(toolchain) toolchain:configs_save() return true else - --[[TODO we need also add this tips when use remote ndk toolchain + --[[TODO we also need to add this tips when use remote ndk toolchain -- failed cprint("${bright color.error}please run:") cprint(" - xmake config --ndk=xxx") diff --git a/xmake/toolchains/ndk/load.lua b/xmake/toolchains/ndk/load.lua index 494558673..325c2f807 100644 --- a/xmake/toolchains/ndk/load.lua +++ b/xmake/toolchains/ndk/load.lua @@ -344,7 +344,7 @@ function main(toolchain) end toolchain:add("rcshflags", "-C link-args=\"" .. (table.concat(rcshflags, " "):gsub("%-march=.-%s", "") .. "\"")) toolchain:add("rcldflags", "-C link-args=\"" .. (table.concat(rcldflags, " "):gsub("%-march=.-%s", "") .. "\"")) - local sh = toolchain:tool("sh") -- @note we cannot use `config.get("sh")`, because we need check sh first + local sh = toolchain:tool("sh") -- @note we cannot use `config.get("sh")`, because we need to check sh first if sh then toolchain:add("rcshflags", "-C linker=" .. sh) end |
