From 1925d9171b2dce49cb95e5816fd38bc103a44be3 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 14 Mar 2020 00:28:36 +0800 Subject: improve go rule --- xmake/actions/build/kinds/object.lua | 2 +- xmake/rules/go/build/object.lua | 8 +------- xmake/rules/go/xmake.lua | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/xmake/actions/build/kinds/object.lua b/xmake/actions/build/kinds/object.lua index f9fcba8b1..df1347686 100644 --- a/xmake/actions/build/kinds/object.lua +++ b/xmake/actions/build/kinds/object.lua @@ -40,7 +40,7 @@ function _add_batchjobs_for_rule(batchjobs, rootjob, target, sourcebatch, suffix script(target, batchjobs, sourcebatch, {rootjob = rootjob}) else batchjobs:addjob("rule/" .. rulename .. "/" .. scriptname, function (index, total) - script(target, batchjobs, sourcebatch, {progress = (index * 100) / total}) + script(target, sourcebatch, {progress = (index * 100) / total}) end, rootjob) end else diff --git a/xmake/rules/go/build/object.lua b/xmake/rules/go/build/object.lua index e32a3f98b..697ae8f2f 100644 --- a/xmake/rules/go/build/object.lua +++ b/xmake/rules/go/build/object.lua @@ -26,7 +26,7 @@ import("core.tool.compiler") import("core.project.depend") -- build the source files -function _build_sourcefiles(target, sourcebatch, opt) +function main(target, sourcebatch, opt) -- is verbose? local verbose = option.get("verbose") @@ -95,9 +95,3 @@ function _build_sourcefiles(target, sourcebatch, opt) depend.save(dependinfo, dependfile) end --- add batch jobs to build the source files -function main(target, batchjobs, sourcebatch, opt) - return batchjobs:addjob(target:name() .. "/build_files", function (index, total) - _build_sourcefiles(target, sourcebatch, {progress = (index * 100) / total}) - end, opt.rootjob) -end diff --git a/xmake/rules/go/xmake.lua b/xmake/rules/go/xmake.lua index 87c04aece..b7610b0f6 100644 --- a/xmake/rules/go/xmake.lua +++ b/xmake/rules/go/xmake.lua @@ -21,7 +21,7 @@ -- define rule: go.build rule("go.build") set_sourcekinds("gc") - on_build_files("build.object", {batch = true}) + on_build_files("build.object") -- define rule: cpp rule("go") -- cgit v1.3.1