summaryrefslogtreecommitdiff
path: root/xmake/core/sandbox/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2016-03-22 20:24:24 +0800
committerruki <[email protected]>2016-03-22 20:24:31 +0800
commitaca0257d26134ff95889acb419d49701fee4ec61 (patch)
treec1a2f332156aba8295b0522fa70f08783e9633c6 /xmake/core/sandbox/modules
parentc1460e5be7f4b4e3356a8bda99703828c356cbfb (diff)
impl lua action
Diffstat (limited to 'xmake/core/sandbox/modules')
-rw-r--r--xmake/core/sandbox/modules/import/core/platform/platform.lua44
-rw-r--r--xmake/core/sandbox/modules/import/core/project/config.lua5
-rw-r--r--xmake/core/sandbox/modules/print.lua2
-rw-r--r--xmake/core/sandbox/modules/utils.lua10
4 files changed, 54 insertions, 7 deletions
diff --git a/xmake/core/sandbox/modules/import/core/platform/platform.lua b/xmake/core/sandbox/modules/import/core/platform/platform.lua
new file mode 100644
index 000000000..f16ee8df2
--- /dev/null
+++ b/xmake/core/sandbox/modules/import/core/platform/platform.lua
@@ -0,0 +1,44 @@
+--!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) 2015 - 2016, ruki All rights reserved.
+--
+-- @author ruki
+-- @file platform.lua
+--
+
+-- define module
+local sandbox_core_platform_platform = sandbox_core_platform_platform or {}
+
+-- load modules
+local platform = require("platform/platform")
+local raise = require("sandbox/modules/raise")
+
+-- load the current platform
+function sandbox_core_platform_platform.load(plat)
+
+ -- check
+ assert(plat)
+
+ -- load the platform configure
+ if not platform.load(plat) then
+ raise("load platform: %s failed!", plat)
+ end
+end
+
+
+-- return module
+return sandbox_core_platform_platform
diff --git a/xmake/core/sandbox/modules/import/core/project/config.lua b/xmake/core/sandbox/modules/import/core/project/config.lua
index 9eb77847c..2d2820f4a 100644
--- a/xmake/core/sandbox/modules/import/core/project/config.lua
+++ b/xmake/core/sandbox/modules/import/core/project/config.lua
@@ -126,11 +126,6 @@ function sandbox_core_project_config.probe()
raise("probe the project configure failed!")
end
- -- make the platform configure
- if not platform.make() then
- raise("make platform configure: %s failed!", config.get("plat"))
- end
-
end
-- dump the configure
diff --git a/xmake/core/sandbox/modules/print.lua b/xmake/core/sandbox/modules/print.lua
index 9e8502c16..7ed930575 100644
--- a/xmake/core/sandbox/modules/print.lua
+++ b/xmake/core/sandbox/modules/print.lua
@@ -21,5 +21,5 @@
--
-- load module
-return print
+return require("sandbox/modules/utils").print
diff --git a/xmake/core/sandbox/modules/utils.lua b/xmake/core/sandbox/modules/utils.lua
index f0cb95db9..395642268 100644
--- a/xmake/core/sandbox/modules/utils.lua
+++ b/xmake/core/sandbox/modules/utils.lua
@@ -21,6 +21,7 @@
--
-- load modules
+local io = require("base/io")
local utils = require("base/utils")
local vformat = require("sandbox/modules/vformat")
@@ -34,11 +35,18 @@ for k, v in pairs(utils) do
end
end
+-- print with the builtin variables and newline
+function sandbox_utils.print(format, ...)
+
+ -- done
+ return io.write(vformat(format, ...) .. "\n")
+end
+
-- printf with the builtin variables
function sandbox_utils.printf(format, ...)
-- done
- return print(vformat(format, ...))
+ return io.write(vformat(format, ...))
end
-- return module