summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
authorruki <[email protected]>2020-05-31 11:25:20 +0800
committerruki <[email protected]>2020-05-31 11:25:20 +0800
commite992cc5c639e24be50a983f480068cc53386177f (patch)
tree63e3f18b0c43bb18fbe962b49143865541edc62a /xmake/plugins
parent57a56732a31fd8fbbd5a0d07020fa9c14f96496f (diff)
show build modes and rules
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/show/lists/buildmodes.lua37
-rw-r--r--xmake/plugins/show/lists/rules.lua35
-rw-r--r--xmake/plugins/show/showlist.lua2
3 files changed, 73 insertions, 1 deletions
diff --git a/xmake/plugins/show/lists/buildmodes.lua b/xmake/plugins/show/lists/buildmodes.lua
new file mode 100644
index 000000000..29c0f425c
--- /dev/null
+++ b/xmake/plugins/show/lists/buildmodes.lua
@@ -0,0 +1,37 @@
+--!A cross-platform build utility based on Lua
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015-2020, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file buildmodes.lua
+--
+
+-- imports
+import("core.project.config")
+import("core.project.rule")
+import(".showlist")
+
+-- show all platforms
+function main()
+ config.load()
+ local modes = {}
+ for _, r in pairs(rule.rules()) do
+ local rulename = r:name()
+ if rulename:startswith("mode.") then
+ table.insert(modes, rulename)
+ end
+ end
+ showlist(modes)
+end
diff --git a/xmake/plugins/show/lists/rules.lua b/xmake/plugins/show/lists/rules.lua
new file mode 100644
index 000000000..82a454d91
--- /dev/null
+++ b/xmake/plugins/show/lists/rules.lua
@@ -0,0 +1,35 @@
+--!A cross-platform build utility based on Lua
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015-2020, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file rules.lua
+--
+
+-- imports
+import("core.project.config")
+import("core.project.rule")
+import(".showlist")
+
+-- show all platforms
+function main()
+ config.load()
+ local rules = {}
+ for _, r in pairs(rule.rules()) do
+ table.insert(rules, r:name())
+ end
+ table.sort(rules)
+ showlist(rules)
+end
diff --git a/xmake/plugins/show/showlist.lua b/xmake/plugins/show/showlist.lua
index 7a7e90b54..a2b529524 100644
--- a/xmake/plugins/show/showlist.lua
+++ b/xmake/plugins/show/showlist.lua
@@ -28,7 +28,7 @@ function main(values)
local row = {}
for _, value in ipairs(values) do
table.insert(row, value)
- if #row > 10 then
+ if #row > 5 then
table.insert(tbl, row)
row = {}
end