summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
authorruki <[email protected]>2023-02-03 00:54:16 +0800
committerruki <[email protected]>2023-02-03 00:54:16 +0800
commit02f7c8dd80563a6737e2b65709f16b3d56fdff6a (patch)
tree701e63dfc5d21a252f014c848df555dc20eb9c14 /xmake/plugins
parentb005057d44cf03a29613d7d1881517e59acacae1 (diff)
check files
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/check/checker.lua4
-rw-r--r--xmake/plugins/check/checkers/api/target/configfiles.lua32
-rw-r--r--xmake/plugins/check/checkers/api/target/files.lua32
-rw-r--r--xmake/plugins/check/checkers/api/target/headerfiles.lua33
-rw-r--r--xmake/plugins/check/checkers/api/target/installfiles.lua33
5 files changed, 134 insertions, 0 deletions
diff --git a/xmake/plugins/check/checker.lua b/xmake/plugins/check/checker.lua
index 9d0526bd4..c81bd8591 100644
--- a/xmake/plugins/check/checker.lua
+++ b/xmake/plugins/check/checker.lua
@@ -37,6 +37,10 @@ function checkers()
["api.target.vectorexts"] = {description = "Check vectorexts configuration in target."},
["api.target.exceptions"] = {description = "Check exceptions configuration in target."},
["api.target.packages"] = {description = "Check packages configuration in target."},
+ ["api.target.files"] = {description = "Check files configuration in target."},
+ ["api.target.headerfiles"] = {description = "Check header files configuration in target."},
+ ["api.target.installfiles"] = {description = "Check install files configuration in target."},
+ ["api.target.configfiles"] = {description = "Check config files configuration in target."},
["api.target.linkdirs"] = {description = "Check linkdirs configuration in target."},
["api.target.includedirs"] = {description = "Check includedirs configuration in target."},
["api.target.frameworkdirs"] = {description = "Check frameworkdirs configuration in target."},
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