summaryrefslogtreecommitdiff
path: root/xmake/core/base/task.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-11-12 23:10:19 +0800
committerruki <[email protected]>2018-11-12 13:01:54 +0800
commit0d6defd8520b2a93e02a5872a067a611d1b839cc (patch)
treee65c3bd8a99326bd33ec5010f56d3a8fe0939f7c /xmake/core/base/task.lua
parent377840c51da27c07f9d94caf458f99eb197798e3 (diff)
lazy loading platform
Diffstat (limited to 'xmake/core/base/task.lua')
-rw-r--r--xmake/core/base/task.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/xmake/core/base/task.lua b/xmake/core/base/task.lua
index b6a5d7d15..b2b5b25a0 100644
--- a/xmake/core/base/task.lua
+++ b/xmake/core/base/task.lua
@@ -437,7 +437,10 @@ function task.menu(tasks)
menu.main = function ()
-- translate main menu
- local mainmenu = task._translate_menu(taskinst:get("menu"))
+ local mainmenu, errors = task._translate_menu(taskinst:get("menu"))
+ if not mainmenu then
+ os.raise(errors)
+ end
-- make tasks for the main menu
mainmenu.tasks = {}
@@ -464,7 +467,11 @@ function task.menu(tasks)
-- delay to load task menu
menu[taskname] = function ()
- return task._translate_menu(taskinst:get("menu"))
+ local taskmenu, errors = task._translate_menu(taskinst:get("menu"))
+ if not taskmenu then
+ os.raise(errors)
+ end
+ return taskmenu
end
end
end