summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-02-01 00:58:18 +0800
committerruki <[email protected]>2023-02-01 00:58:18 +0800
commit6634f41bb5f20a6b35fe3d07d4141717bd7677a2 (patch)
tree50410e344deed9d374ba8502c00aca07fa48569c
parent8fcfa349daf5add9d1be7ab5091eab4c5b89ea76 (diff)
check languages values
-rw-r--r--xmake/plugins/check/checkers/api/api_checker.lua22
-rw-r--r--xmake/plugins/check/checkers/api/target/languages.lua20
-rw-r--r--xmake/plugins/check/checkers/api/target/packages.lua1
3 files changed, 41 insertions, 2 deletions
diff --git a/xmake/plugins/check/checkers/api/api_checker.lua b/xmake/plugins/check/checkers/api/api_checker.lua
new file mode 100644
index 000000000..d57d0f094
--- /dev/null
+++ b/xmake/plugins/check/checkers/api/api_checker.lua
@@ -0,0 +1,22 @@
+--!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 api_checker.lua
+--
+
+function check()
+end
diff --git a/xmake/plugins/check/checkers/api/target/languages.lua b/xmake/plugins/check/checkers/api/target/languages.lua
index c401f5584..77bbf345f 100644
--- a/xmake/plugins/check/checkers/api/target/languages.lua
+++ b/xmake/plugins/check/checkers/api/target/languages.lua
@@ -18,6 +18,24 @@
-- @file languages.lua
--
+-- imports
+import(".api_checker")
+
function main()
- print("check languages ..")
+ local values = {
+ "ansi", "c89", "c90", "c99", "c11", "c17", "clatest",
+ "cxx98", "cxx11", "cxx14", "cxx17", "cxx1z", "cxx20", "cxx2a", "cxx23", "cxx2b", "cxxlatest"
+ }
+ local languages = {}
+ for _, value in ipairs(values) do
+ table.insert(languages, value)
+ if value:find("xx", 1, true) then
+ table.insert(languages, (value:gsub("xx", "++")))
+ end
+ if value:startswith("c") then
+ table.insert(languages, "gnu" .. value:sub(2))
+ end
+ end
+ print(languages)
+ api_checker.check({values = languages})
end
diff --git a/xmake/plugins/check/checkers/api/target/packages.lua b/xmake/plugins/check/checkers/api/target/packages.lua
index 900948e3d..fe3de2f01 100644
--- a/xmake/plugins/check/checkers/api/target/packages.lua
+++ b/xmake/plugins/check/checkers/api/target/packages.lua
@@ -19,5 +19,4 @@
--
function main()
- print("check packages ..")
end