diff options
Diffstat (limited to 'xmake/core/sandbox')
| -rw-r--r-- | xmake/core/sandbox/modules/import/core/tool/compiler.lua | 4 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/os.lua | 34 |
2 files changed, 26 insertions, 12 deletions
diff --git a/xmake/core/sandbox/modules/import/core/tool/compiler.lua b/xmake/core/sandbox/modules/import/core/tool/compiler.lua index 340b32734..779bfe696 100644 --- a/xmake/core/sandbox/modules/import/core/tool/compiler.lua +++ b/xmake/core/sandbox/modules/import/core/tool/compiler.lua @@ -42,7 +42,7 @@ function sandbox_core_tool_compiler.compcmd(sourcefile, objectfile, target) end -- compile source file -function sandbox_core_tool_compiler.compile(sourcefile, objectfile, incdepfile, target, multitasking) +function sandbox_core_tool_compiler.compile(sourcefile, objectfile, incdepfile, target) -- get the compiler instance local instance, errors = compiler.load(compiler.kind_of_file(sourcefile)) @@ -51,7 +51,7 @@ function sandbox_core_tool_compiler.compile(sourcefile, objectfile, incdepfile, end -- compile it - local ok, errors = instance:compile(sourcefile, objectfile, incdepfile, target, multitasking) + local ok, errors = instance:compile(sourcefile, objectfile, incdepfile, target) if not ok then raise(errors) end diff --git a/xmake/core/sandbox/modules/os.lua b/xmake/core/sandbox/modules/os.lua index f4d6efb6e..7486e5d25 100644 --- a/xmake/core/sandbox/modules/os.lua +++ b/xmake/core/sandbox/modules/os.lua @@ -166,6 +166,17 @@ function sandbox_os.tmpdir() return tmpdir end +-- get the temporary file +function sandbox_os.tmpfile() + + -- get it + local tmpfile = os.tmpfile() + assert(tmpfile) + + -- ok + return tmpfile +end + -- get the tools directory function sandbox_os.toolsdir() @@ -221,33 +232,36 @@ function sandbox_os.runv(shellname, argv) end end --- run shell with io +-- run shell and return output and error data function sandbox_os.iorun(cmd, ...) -- make command cmd = vformat(cmd, ...) -- run it - local ok, results = os.iorun(cmd) + local ok, outdata, errdata = os.iorun(cmd) if not ok then - os.raise(results) + os.raise(errdata) end -- ok - return results + return outdata, errdata end --- run shell with coroutine -function sandbox_os.corun(cmd, ...) +-- run shell and return output and error data +function sandbox_os.iorunv(shellname, argv) - -- make command - cmd = vformat(cmd, ...) + -- make shellname + shellname = vformat(shellname) -- run it - local ok, errors = os.corun(cmd) + local ok, outdata, errdata = os.iorunv(shellname, argv) if not ok then - os.raise(errors) + os.raise(errdata) end + + -- ok + return outdata, errdata end -- execute shell |
