summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-02-02 22:39:09 +0800
committerruki <[email protected]>2023-02-02 22:39:09 +0800
commit18737c1434786ebf43d37191c52ddb24847bae6d (patch)
tree9a568be9a2b51ed2552c42a3a5f6e6461346b969
parent7f8eefb8a113cdf8881aa3ed1c4cd4caa1ffb981 (diff)
add includedirs checker
-rw-r--r--xmake/plugins/check/checker.lua25
-rw-r--r--xmake/plugins/check/checkers/api/target/frameworkdirs.lua31
-rw-r--r--xmake/plugins/check/checkers/api/target/includedirs.lua31
-rw-r--r--xmake/plugins/check/checkers/api/target/linkdirs.lua31
-rw-r--r--xmake/plugins/check/checkers/api/target/version.lua2
5 files changed, 108 insertions, 12 deletions
diff --git a/xmake/plugins/check/checker.lua b/xmake/plugins/check/checker.lua
index 0f003537c..cbde9c236 100644
--- a/xmake/plugins/check/checker.lua
+++ b/xmake/plugins/check/checker.lua
@@ -27,18 +27,21 @@ function checkers()
if not checkers then
checkers = {
-- target api checkers
- ["api.target.version"] = {description = "Check version configuration in target."},
- ["api.target.strip"] = {description = "Check strip configuration in target."},
- ["api.target.optimize"] = {description = "Check optimize configuration in target."},
- ["api.target.symbols"] = {description = "Check symbols configuration in target."},
- ["api.target.fpmodels"] = {description = "Check fpmodels configuration in target."},
- ["api.target.warnings"] = {description = "Check warnings configuration in target."},
- ["api.target.languages"] = {description = "Check languages configuration in target."},
- ["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.version"] = {description = "Check version configuration in target."},
+ ["api.target.strip"] = {description = "Check strip configuration in target."},
+ ["api.target.optimize"] = {description = "Check optimize configuration in target."},
+ ["api.target.symbols"] = {description = "Check symbols configuration in target."},
+ ["api.target.fpmodels"] = {description = "Check fpmodels configuration in target."},
+ ["api.target.warnings"] = {description = "Check warnings configuration in target."},
+ ["api.target.languages"] = {description = "Check languages configuration in target."},
+ ["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.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."},
-- clang tidy checker
- ["clang.tidy"] = {description = "Check project code using clang-tidy.", showstats = false}
+ ["clang.tidy"] = {description = "Check project code using clang-tidy.", showstats = false}
}
_g._CHECKERS = checkers
end
diff --git a/xmake/plugins/check/checkers/api/target/frameworkdirs.lua b/xmake/plugins/check/checkers/api/target/frameworkdirs.lua
new file mode 100644
index 000000000..f21629fe5
--- /dev/null
+++ b/xmake/plugins/check/checkers/api/target/frameworkdirs.lua
@@ -0,0 +1,31 @@
+--!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 frameworkdirs.lua
+--
+
+-- imports
+import(".api_checker")
+
+function main()
+ api_checker.check_targets("frameworkdirs", {check = function(target, value)
+ if not os.isdir(value) then
+ return false, string.format("frameworkdir '%s' not found", value)
+ end
+ return true
+ end})
+end
diff --git a/xmake/plugins/check/checkers/api/target/includedirs.lua b/xmake/plugins/check/checkers/api/target/includedirs.lua
new file mode 100644
index 000000000..5fcafef0f
--- /dev/null
+++ b/xmake/plugins/check/checkers/api/target/includedirs.lua
@@ -0,0 +1,31 @@
+--!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 includedirs.lua
+--
+
+-- imports
+import(".api_checker")
+
+function main()
+ api_checker.check_targets("includedirs", {check = function(target, value)
+ if not os.isdir(value) then
+ return false, string.format("includedir '%s' not found", value)
+ end
+ return true
+ end})
+end
diff --git a/xmake/plugins/check/checkers/api/target/linkdirs.lua b/xmake/plugins/check/checkers/api/target/linkdirs.lua
new file mode 100644
index 000000000..3980f2eae
--- /dev/null
+++ b/xmake/plugins/check/checkers/api/target/linkdirs.lua
@@ -0,0 +1,31 @@
+--!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 linkdirs.lua
+--
+
+-- imports
+import(".api_checker")
+
+function main()
+ api_checker.check_targets("linkdirs", {check = function(target, value)
+ if not os.isdir(value) then
+ return false, string.format("linkdir '%s' not found", value)
+ end
+ return true
+ end})
+end
diff --git a/xmake/plugins/check/checkers/api/target/version.lua b/xmake/plugins/check/checkers/api/target/version.lua
index d4759aee4..e476cd8d4 100644
--- a/xmake/plugins/check/checkers/api/target/version.lua
+++ b/xmake/plugins/check/checkers/api/target/version.lua
@@ -15,7 +15,7 @@
-- Copyright (C) 2015-present, TBOOX Open Source Group.
--
-- @author ruki
--- @file packages.lua
+-- @file version.lua
--
-- imports