diff options
| author | ruki <[email protected]> | 2020-06-30 21:35:01 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-06-30 21:35:01 +0800 |
| commit | 7210ca7ea63dd201cee8d10081fee8f065ec6c44 (patch) | |
| tree | 5037aea812f5fab79a8c2d6c11e351db5ba66143 /xmake/modules/private/utils | |
| parent | 2b80ef232b9a17cde8b144a37eb4f8ea77266900 (diff) | |
| parent | 4c54385b422e3c191b3a2a13d849774132a601a8 (diff) | |
Merge pull request #879 from OpportunityLiu/dev
fix auto complete
Diffstat (limited to 'xmake/modules/private/utils')
| -rw-r--r-- | xmake/modules/private/utils/complete_helper.lua | 56 |
1 files changed, 56 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..4e8c38e8f --- /dev/null +++ b/xmake/modules/private/utils/complete_helper.lua @@ -0,0 +1,56 @@ +--!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") + import("core.project.config") + + -- load config + config.load() + + return table.keys(project.targets()) + end + } +end + +function runable_targets() + return try + { + function () + import("core.project.project") + import("core.project.config") + + -- load config + config.load() + + 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 |
