diff options
| author | ruki <[email protected]> | 2020-02-06 23:25:22 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-02-07 22:45:57 +0800 |
| commit | 86dcc1f78cd9e84b9e09673eb602ca77661841cf (patch) | |
| tree | ff024e06a864c817c1fb3409222c702dc44660e5 | |
| parent | 36ee7b8a95969aa4bfbf1d354da13dc3ba6da81d (diff) | |
move process module to core.base.process
| -rw-r--r-- | tests/modules/process/sched_process.lua | 1 | ||||
| -rw-r--r-- | tests/modules/process/sched_process_pipe.lua | 1 | ||||
| -rw-r--r-- | tests/modules/process/test.lua | 1 | ||||
| -rw-r--r-- | xmake/actions/build/cleaner.lua | 1 | ||||
| -rw-r--r-- | xmake/actions/build/statistics.lua | 1 | ||||
| -rw-r--r-- | xmake/actions/update/main.lua | 1 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/import/core/base/process.lua (renamed from xmake/core/sandbox/modules/process.lua) | 20 |
7 files changed, 16 insertions, 10 deletions
diff --git a/tests/modules/process/sched_process.lua b/tests/modules/process/sched_process.lua index a94e25b65..ec5794eef 100644 --- a/tests/modules/process/sched_process.lua +++ b/tests/modules/process/sched_process.lua @@ -1,3 +1,4 @@ +import("core.base.process") import("core.base.scheduler") function _session(id, program, ...) diff --git a/tests/modules/process/sched_process_pipe.lua b/tests/modules/process/sched_process_pipe.lua index de87f5f4e..02bf70a93 100644 --- a/tests/modules/process/sched_process_pipe.lua +++ b/tests/modules/process/sched_process_pipe.lua @@ -1,5 +1,6 @@ import("core.base.pipe") import("core.base.bytes") +import("core.base.process") import("core.base.scheduler") function _session_read_pipe(id, rpipeopt) diff --git a/tests/modules/process/test.lua b/tests/modules/process/test.lua index 3835272b4..bafd619c0 100644 --- a/tests/modules/process/test.lua +++ b/tests/modules/process/test.lua @@ -1,3 +1,4 @@ +import("core.base.process") import("core.base.scheduler") local inftimeout = 5000 diff --git a/xmake/actions/build/cleaner.lua b/xmake/actions/build/cleaner.lua index 7d629b978..596ee9315 100644 --- a/xmake/actions/build/cleaner.lua +++ b/xmake/actions/build/cleaner.lua @@ -21,6 +21,7 @@ -- imports import("core.base.option") import("core.base.global") +import("core.base.process") import("core.project.config") import("core.package.package") import("core.platform.platform") diff --git a/xmake/actions/build/statistics.lua b/xmake/actions/build/statistics.lua index 1e29cb666..729af55e7 100644 --- a/xmake/actions/build/statistics.lua +++ b/xmake/actions/build/statistics.lua @@ -20,6 +20,7 @@ -- imports import("core.base.option") +import("core.base.process") import("core.project.config") import("core.platform.platform") import("core.platform.environment") diff --git a/xmake/actions/update/main.lua b/xmake/actions/update/main.lua index 33e726e17..b4216c632 100644 --- a/xmake/actions/update/main.lua +++ b/xmake/actions/update/main.lua @@ -22,6 +22,7 @@ import("core.base.semver") import("core.base.option") import("core.base.task") +import("core.base.process") import("net.http") import("devel.git") import("devel.git.submodule") diff --git a/xmake/core/sandbox/modules/process.lua b/xmake/core/sandbox/modules/import/core/base/process.lua index 6b9a16728..b05939028 100644 --- a/xmake/core/sandbox/modules/process.lua +++ b/xmake/core/sandbox/modules/import/core/base/process.lua @@ -25,12 +25,12 @@ local raise = require("sandbox/modules/raise") local vformat = require("sandbox/modules/vformat") -- define module -local sandbox_process = sandbox_process or {} -local sandbox_process_subprocess = sandbox_process_subprocess or {} -sandbox_process._subprocess = sandbox_process._subprocess or process._subprocess +local sandbox_core_base_process = sandbox_core_base_process or {} +local sandbox_core_base_instance = sandbox_core_base_instance or {} +sandbox_core_base_process._subprocess = sandbox_core_base_process._subprocess or process._subprocess -- wait subprocess -function sandbox_process_subprocess.wait(proc, timeout) +function sandbox_core_base_instance.wait(proc, timeout) local ok, status, errors = proc:_wait(timeout) if errors then raise(errors) @@ -39,7 +39,7 @@ function sandbox_process_subprocess.wait(proc, timeout) end -- close subprocess -function sandbox_process_subprocess.close(proc) +function sandbox_core_base_instance.close(proc) local ok, errors = proc:_close() if not ok then raise(errors) @@ -51,7 +51,7 @@ end -- @param command the command -- @param opt the arguments option, {outpath = "", errpath = "", envs = {"PATH=xxx", "XXX=yyy"} -- -function sandbox_process.open(command, opt) +function sandbox_core_base_process.open(command, opt) -- check assert(command) @@ -67,7 +67,7 @@ function sandbox_process.open(command, opt) -- hook subprocess interfaces local hooked = {} - for name, func in pairs(sandbox_process_subprocess) do + for name, func in pairs(sandbox_core_base_instance) do if not name:startswith("_") and type(func) == "function" then hooked["_" .. name] = proc["_" .. name] or proc[name] hooked[name] = func @@ -85,7 +85,7 @@ end -- @param argv the command arguments -- @param opt the arguments option, {outpath = "", errpath = "", envs = {"PATH=xxx", "XXX=yyy"} -- -function sandbox_process.openv(filename, argv, opt) +function sandbox_core_base_process.openv(filename, argv, opt) -- check assert(argv) @@ -101,7 +101,7 @@ function sandbox_process.openv(filename, argv, opt) -- hook subprocess interfaces local hooked = {} - for name, func in pairs(sandbox_process_subprocess) do + for name, func in pairs(sandbox_core_base_instance) do if not name:startswith("_") and type(func) == "function" then hooked["_" .. name] = proc["_" .. name] or proc[name] hooked[name] = func @@ -114,4 +114,4 @@ function sandbox_process.openv(filename, argv, opt) end -- return module -return sandbox_process +return sandbox_core_base_process |
