diff options
| author | ruki <[email protected]> | 2023-02-03 00:54:16 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-02-03 00:54:16 +0800 |
| commit | 02f7c8dd80563a6737e2b65709f16b3d56fdff6a (patch) | |
| tree | 701e63dfc5d21a252f014c848df555dc20eb9c14 /xmake/plugins/check/checkers/api | |
| parent | b005057d44cf03a29613d7d1881517e59acacae1 (diff) | |
check files
Diffstat (limited to 'xmake/plugins/check/checkers/api')
4 files changed, 130 insertions, 0 deletions
diff --git a/xmake/plugins/check/checkers/api/target/configfiles.lua b/xmake/plugins/check/checkers/api/target/configfiles.lua new file mode 100644 index 000000000..5819278c0 --- /dev/null +++ b/xmake/plugins/check/checkers/api/target/configfiles.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, TBOOX Open Source Group. +-- +-- @author ruki +-- @file configfiles.lua +-- + +-- imports +import(".api_checker") + +function main() + api_checker.check_targets("configfiles", {check = function(target, value) + local configfiles = os.files(value) + if not configfiles or #configfiles == 0 then + return false, string.format("configfiles '%s' not found", value) + end + return true + end}) +end diff --git a/xmake/plugins/check/checkers/api/target/files.lua b/xmake/plugins/check/checkers/api/target/files.lua new file mode 100644 index 000000000..dfc4eda89 --- /dev/null +++ b/xmake/plugins/check/checkers/api/target/files.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, TBOOX Open Source Group. +-- +-- @author ruki +-- @file files.lua +-- + +-- imports +import(".api_checker") + +function main() + api_checker.check_targets("files", {check = function(target, value) + local files = os.files(value) + if not files or #files == 0 then + return false, string.format("files '%s' not found", value) + end + return true + end}) +end diff --git a/xmake/plugins/check/checkers/api/target/headerfiles.lua b/xmake/plugins/check/checkers/api/target/headerfiles.lua new file mode 100644 index 000000000..5777f27f8 --- /dev/null +++ b/xmake/plugins/check/checkers/api/target/headerfiles.lua @@ -0,0 +1,33 @@ +--!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 headerfiles.lua +-- + +-- imports +import(".api_checker") + +function main() + api_checker.check_targets("headerfiles", {check = function(target, value) + value = value:gsub("[()]", "") + local headerfiles = os.files(value) + if not headerfiles or #headerfiles == 0 then + return false, string.format("headerfiles '%s' not found", value) + end + return true + end}) +end diff --git a/xmake/plugins/check/checkers/api/target/installfiles.lua b/xmake/plugins/check/checkers/api/target/installfiles.lua new file mode 100644 index 000000000..cdf0a927e --- /dev/null +++ b/xmake/plugins/check/checkers/api/target/installfiles.lua @@ -0,0 +1,33 @@ +--!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 installfiles.lua +-- + +-- imports +import(".api_checker") + +function main() + api_checker.check_targets("installfiles", {check = function(target, value) + value = value:gsub("[()]", "") + local installfiles = os.files(value) + if not installfiles or #installfiles == 0 then + return false, string.format("installfiles '%s' not found", value) + end + return true + end}) +end |
