summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-03-12 00:37:21 +0800
committerruki <[email protected]>2024-03-12 00:37:21 +0800
commit86f3b19fe2cbaec44a1334285d6aa63db0254684 (patch)
tree3d5e0e396f5be56e4361ad4ee0178af3fd2af168
parent16e8c3532b8ff54dadea579cc9525e63bfbf013d (diff)
remove ifelse
-rw-r--r--xmake/core/base/utils.lua5
-rw-r--r--xmake/core/sandbox/modules/ifelse.lua23
-rw-r--r--xmake/core/sandbox/modules/interpreter/ifelse.lua26
-rw-r--r--xmake/core/sandbox/modules/utils.lua1
4 files changed, 0 insertions, 55 deletions
diff --git a/xmake/core/base/utils.lua b/xmake/core/base/utils.lua
index c1b78af4d..e8b6401f6 100644
--- a/xmake/core/base/utils.lua
+++ b/xmake/core/base/utils.lua
@@ -270,11 +270,6 @@ function utils.show_warnings()
end
end
--- ifelse, a? b : c
-function utils.ifelse(a, b, c)
- if a then return b else return c end
-end
-
-- try to call script
function utils.trycall(script, traceback, ...)
return xpcall(script, function (errors)
diff --git a/xmake/core/sandbox/modules/ifelse.lua b/xmake/core/sandbox/modules/ifelse.lua
deleted file mode 100644
index 2c417b478..000000000
--- a/xmake/core/sandbox/modules/ifelse.lua
+++ /dev/null
@@ -1,23 +0,0 @@
---!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 ifelse.lua
---
-
--- load module
-return require("sandbox/modules/utils").ifelse
-
diff --git a/xmake/core/sandbox/modules/interpreter/ifelse.lua b/xmake/core/sandbox/modules/interpreter/ifelse.lua
deleted file mode 100644
index 4885d5710..000000000
--- a/xmake/core/sandbox/modules/interpreter/ifelse.lua
+++ /dev/null
@@ -1,26 +0,0 @@
---!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 ifelse.lua
---
-
-return function (...)
- local utils = require("base/utils")
- local deprecated = require("base/deprecated")
- deprecated.add("(a and b or c)", "ifelse(a, b, c)")
- return utils.ifelse(...)
-end
diff --git a/xmake/core/sandbox/modules/utils.lua b/xmake/core/sandbox/modules/utils.lua
index d010f2c22..9278f59b7 100644
--- a/xmake/core/sandbox/modules/utils.lua
+++ b/xmake/core/sandbox/modules/utils.lua
@@ -39,7 +39,6 @@ sandbox_utils.confirm = utils.confirm
sandbox_utils.error = utils.error
sandbox_utils.warning = utils.warning
sandbox_utils.trycall = utils.trycall
-sandbox_utils.ifelse = utils.ifelse
-- print each arguments
function sandbox_utils._print(...)