diff options
| author | ShifftC <[email protected]> | 2025-09-24 11:04:54 +0200 |
|---|---|---|
| committer | ShifftC <[email protected]> | 2025-09-29 11:24:56 +0200 |
| commit | 6d7e810e07d1ec1d86c829fdd3cd7b73a27dde79 (patch) | |
| tree | b5d2f3396cc912b3615967d6ccd38c71e5895045 | |
| parent | 68501abaad6a9e8a99c058fe8c4986fb4cd4e08c (diff) | |
add api checking to require action
| -rw-r--r-- | xmake/modules/private/action/require/impl/check_api.lua | 32 | ||||
| -rw-r--r-- | xmake/modules/private/action/require/impl/package.lua | 3 |
2 files changed, 35 insertions, 0 deletions
diff --git a/xmake/modules/private/action/require/impl/check_api.lua b/xmake/modules/private/action/require/impl/check_api.lua new file mode 100644 index 000000000..7fd5459c1 --- /dev/null +++ b/xmake/modules/private/action/require/impl/check_api.lua @@ -0,0 +1,32 @@ +--!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, Xmake Open Source Community. +-- +-- @author Shiffted +-- @file check_api.lua +-- + +import("private.check.checker") +import("private.check.show") + +function main(package) + local checkers = checker.checkers() + for name, info in table.orderpairs(checkers) do + if info.load then + local check = import("private.check.checkers." .. name, {anonymous = true}) + check({package = package, show = show.wshow}) + end + end +end diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index a81ba6f99..11b06d381 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -31,6 +31,7 @@ import("core.tool.toolchain") import("core.platform.platform") import("core.package.package", {alias = "core_package"}) import("devel.git") +import("private.action.require.impl.check_api") import("private.action.require.impl.repository") import("private.action.require.impl.search_packages") import("private.action.require.impl.utils.requirekey", {alias = "_get_requirekey"}) @@ -1128,6 +1129,8 @@ function _load_package(packagename, requireinfo, opt) -- load environments from the manifest to enable the environments of on_install() package:envs_load() + check_api(package) + -- save this package package to cache _memcache():set2("packages", packagekey, package) |
