summaryrefslogtreecommitdiff
path: root/xmake/plugins/macro/macros/package.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2016-06-01 10:35:22 +0800
committerruki <[email protected]>2016-06-01 10:35:22 +0800
commit6b64748d083be2348d46075bea288656a69f5caa (patch)
treeb6e8c19ab704eb16b0355ade0860e69ce005d524 /xmake/plugins/macro/macros/package.lua
parente720bbe224eb7aec57ca488a67e840a685fe612f (diff)
add package macro
Diffstat (limited to 'xmake/plugins/macro/macros/package.lua')
-rwxr-xr-xxmake/plugins/macro/macros/package.lua54
1 files changed, 54 insertions, 0 deletions
diff --git a/xmake/plugins/macro/macros/package.lua b/xmake/plugins/macro/macros/package.lua
new file mode 100755
index 000000000..0bf506d1d
--- /dev/null
+++ b/xmake/plugins/macro/macros/package.lua
@@ -0,0 +1,54 @@
+--!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 package.lua
+--
+
+-- imports
+import("core.platform.platform")
+
+-- package all
+--
+-- .e.g
+-- xmake m package
+-- xmake m package linux
+-- xmake m package iphoneos "--demo=false --xxx ..."
+--
+function main(argv)
+
+ -- get plat
+ local plat = argv[1] or os.host()
+
+ -- get args
+ local args = argv[2] or ""
+
+ -- package all archs
+ for _, arch in ipairs(platform.archs(plat)) do
+
+ -- package debug
+ os.exec("xmake f -p %s -a %s -m debug %s", plat, arch, args)
+ os.exec("xmake -r")
+ os.exec("xmake p")
+
+ -- package release
+ os.exec("xmake f -p %s -a %s -m release %s", plat, arch, args)
+ os.exec("xmake -r")
+ os.exec("xmake p")
+ end
+end