summaryrefslogtreecommitdiff
path: root/xmake/scripts/base
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/base
parentff6f56a46a77beb841fb22c185200ab0a833f05e (diff)
add main and utils modules
Diffstat (limited to 'xmake/scripts/base')
-rw-r--r--xmake/scripts/base/main.lua36
-rw-r--r--xmake/scripts/base/utils.lua (renamed from xmake/scripts/base/prefix.lua)16
2 files changed, 47 insertions, 5 deletions
diff --git a/xmake/scripts/base/main.lua b/xmake/scripts/base/main.lua
new file mode 100644
index 000000000..a049bee11
--- /dev/null
+++ b/xmake/scripts/base/main.lua
@@ -0,0 +1,36 @@
+--!The Automatic Cross-platform Build Tool
+--
+-- XMake is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU Lesser General Public License as published by
+-- the Free Software Foundation; either version 2.1 of the License, or
+-- (at your option) any later version.
+--
+-- XMake is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public License
+-- along with XMake;
+-- If not, see <a href="http://www.gnu.org/licenses/"> http://www.gnu.org/licenses/</a>
+--
+-- Copyright (C) 2009 - 2015, ruki All rights reserved.
+--
+-- @author ruki
+-- @file main.lua
+--
+
+-- define module: main
+local main = {}
+
+-- load modules
+local utils = require("base/utils")
+
+-- the main function
+function main.done()
+ utils.trace("hello world!")
+ return 0
+end
+
+-- return module: main
+return main
diff --git a/xmake/scripts/base/prefix.lua b/xmake/scripts/base/utils.lua
index 3784e9433..59769c260 100644
--- a/xmake/scripts/base/prefix.lua
+++ b/xmake/scripts/base/utils.lua
@@ -17,27 +17,33 @@
-- Copyright (C) 2009 - 2015, ruki All rights reserved.
--
-- @author ruki
--- @file prefix.lua
+-- @file utils.lua
--
+-- define module: utils
+local utils = {}
+
-- the trace function
-function xmake.trace(msg, ...)
+function utils.trace(msg, ...)
print(string.format(msg, ...))
end
-- the verbose function
-function xmake.verbose(msg, ...)
+function utils.verbose(msg, ...)
if xmake._VERBOSE then
print(string.format(msg, ...))
end
end
-- the error function
-function xmake.error(msg, ...)
+function utils.error(msg, ...)
print("error: " .. string.format(msg, ...))
end
-- the warning function
-function xmake.warning(msg, ...)
+function utils.warning(msg, ...)
print("warning: " .. string.format(msg, ...))
end
+
+-- return module: utils
+return utils