summaryrefslogtreecommitdiff
path: root/xmake/scripts/_xmake_main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-04-29 17:03:35 +0800
committerruki <[email protected]>2015-04-29 17:03:35 +0800
commit84999518105e894be127ceb3237a3d260f23cda9 (patch)
tree73fdb3b3c6c96264cc072b94cc2e79ad565962c2 /xmake/scripts/_xmake_main.lua
parentff6f56a46a77beb841fb22c185200ab0a833f05e (diff)
add main and utils modules
Diffstat (limited to 'xmake/scripts/_xmake_main.lua')
-rw-r--r--xmake/scripts/_xmake_main.lua21
1 files changed, 7 insertions, 14 deletions
diff --git a/xmake/scripts/_xmake_main.lua b/xmake/scripts/_xmake_main.lua
index 13835b8f2..870f36276 100644
--- a/xmake/scripts/_xmake_main.lua
+++ b/xmake/scripts/_xmake_main.lua
@@ -21,27 +21,20 @@
--
-- init namespace: xmake
-xmake = xmake or {}
-
--- init some global variables for xmake
+xmake = xmake or {}
xmake._ARGV = _ARGV
xmake._VERBOSE = _VERBOSE
xmake._PROGRAM_DIR = _PROGRAM_DIR
xmake._PROJECT_DIR = _PROJECT_DIR
xmake._SCRIPTS_DIR = _PROGRAM_DIR .. "/scripts/"
--- init namespace: xmake.main
-xmake.main = {}
-local main = xmake.main
+-- init package path
+package.path = xmake._SCRIPTS_DIR .. "?.lua;" .. package.path
--- load built-in scripts
-local scripts = dofile(xmake._SCRIPTS_DIR .. "_scripts.lua")
-for i = 1, #scripts do
- dofile(xmake._SCRIPTS_DIR .. scripts[i])
-end
+-- load modules
+local main = require("base/main")
--- the main entry function
+-- the main function
function _xmake_main()
- xmake.trace("hello world!");
- return 0
+ return main.done()
end