diff options
| author | ruki <[email protected]> | 2025-04-05 18:35:59 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-04-08 15:31:57 +0800 |
| commit | e6a81c6a5c84842d6f5b54cfd6d4cdd97f45eef9 (patch) | |
| tree | 44955bd6074031bbf8d28927ba968a8d306bb517 /xmake/modules/private/utils/rule.lua | |
| parent | 1839ec9aebb573adc36803bf3d632f97410f3666 (diff) | |
rename to add_orders
Diffstat (limited to 'xmake/modules/private/utils/rule.lua')
| -rw-r--r-- | xmake/modules/private/utils/rule.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/xmake/modules/private/utils/rule.lua b/xmake/modules/private/utils/rule.lua new file mode 100644 index 000000000..19706ad04 --- /dev/null +++ b/xmake/modules/private/utils/rule.lua @@ -0,0 +1,34 @@ +--!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-present, TBOOX Open Source Group. +-- +-- @author ruki +-- @file rule.lua +-- + +-- imports +import("core.base.option") +import("core.project.rule") +import("core.project.config") +import("core.project.project") + +-- get rule +-- @note we need to get rule from target first, because we maybe will inject and replace builtin rule in target +function get_rule(target, rulename) + local ruleinst = assert(target:rule(rulename) or project.rule(rulename, {namespace = target:namespace()}) or + rule.rule(rulename), "unknown rule: %s", rulename) + return ruleinst +end + |
