summaryrefslogtreecommitdiff
path: root/xmake/tools/go.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-06-21 08:41:22 +0800
committerruki <[email protected]>2017-06-21 08:41:22 +0800
commit45a54659f7449ead7ed073f9c0cbbe1da9fcdc06 (patch)
treea09be69c75dce6435d7584ad467aeb51e3c8d37a /xmake/tools/go.lua
parentace13f7594d5dbddd771cfe0a4004bbcb506b11c (diff)
rename shellname to program
Diffstat (limited to 'xmake/tools/go.lua')
-rw-r--r--xmake/tools/go.lua13
1 files changed, 6 insertions, 7 deletions
diff --git a/xmake/tools/go.lua b/xmake/tools/go.lua
index 472ff84ff..dc0e80f93 100644
--- a/xmake/tools/go.lua
+++ b/xmake/tools/go.lua
@@ -23,16 +23,15 @@
--
-- imports
-import("core.tool.tool")
import("core.base.option")
import("core.project.config")
import("core.project.project")
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- save the shell name
- _g.shellname = shellname or "go"
+ _g.program = program or "go"
-- save the kind
_g.kind = kind
@@ -128,9 +127,9 @@ function linkcmd(objectfiles, targetkind, targetfile, flags)
-- make it
if targetkind == "static" then
- return format("%s tool pack %s %s %s", _g.shellname, flags, targetfile, objectfiles)
+ return format("%s tool pack %s %s %s", _g.program, flags, targetfile, objectfiles)
else
- return format("%s tool link %s -o %s %s", _g.shellname, flags, targetfile, objectfiles)
+ return format("%s tool link %s -o %s %s", _g.program, flags, targetfile, objectfiles)
end
end
@@ -148,7 +147,7 @@ end
function compcmd(sourcefiles, objectfile, flags)
-- make it
- return format("%s tool compile %s -o %s %s", _g.shellname, flags, objectfile, table.concat(table.wrap(sourcefiles), " "))
+ return format("%s tool compile %s -o %s %s", _g.program, flags, objectfile, table.concat(table.wrap(sourcefiles), " "))
end
-- complie the source file
@@ -172,7 +171,7 @@ function check(flags)
io.writefile(sourcefile, "package main\nfunc main() {\n}")
-- check it
- os.run("%s tool compile %s -o %s %s", _g.shellname, ifelse(flags, flags, ""), objectfile, sourcefile)
+ os.run("%s tool compile %s -o %s %s", _g.program, ifelse(flags, flags, ""), objectfile, sourcefile)
-- remove files
os.rm(objectfile)