summaryrefslogtreecommitdiff
path: root/xmake/modules/private
diff options
context:
space:
mode:
authorOpportunity <[email protected]>2020-06-30 11:48:32 +0800
committerOpportunity <[email protected]>2020-06-30 11:48:32 +0800
commit58c8e709cc4677ec6fb5fdfcec1958fab6743709 (patch)
treedce1ed26d57764f4fc3e67538106793c3e1e54b2 /xmake/modules/private
parentf03a57c21313e1f155294c8bad56cc933c71065f (diff)
fix auto complete
Diffstat (limited to 'xmake/modules/private')
-rw-r--r--xmake/modules/private/utils/complete_helper.lua46
1 files changed, 46 insertions, 0 deletions
diff --git a/xmake/modules/private/utils/complete_helper.lua b/xmake/modules/private/utils/complete_helper.lua
new file mode 100644
index 000000000..a8a547dd7
--- /dev/null
+++ b/xmake/modules/private/utils/complete_helper.lua
@@ -0,0 +1,46 @@
+--!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 OpportunityLiu
+-- @file complete_helper.lua
+--
+
+function targets()
+ return try
+ {
+ function ()
+ import("core.project.project")
+ return table.keys(project.targets())
+ end
+ }
+end
+
+function runable_targets()
+ return try
+ {
+ function ()
+ import("core.project.project")
+ local targets = project.targets()
+ local runable = {}
+ for k, v in pairs(targets) do
+ if v:script("run") or v:get("kind") == "binary" then
+ table.insert(runable, k)
+ end
+ end
+ return runable
+ end
+ }
+end \ No newline at end of file