summaryrefslogtreecommitdiff
path: root/xmake/plugins/format/xmake.lua
diff options
context:
space:
mode:
authorA2va <[email protected]>2022-11-10 22:52:23 +0100
committerA2va <[email protected]>2022-11-10 22:52:23 +0100
commit808290756e24ce7ee70d5897477c5b20bd751981 (patch)
tree48a08ce7d45bff4afc62327f6a1aadc3f859d221 /xmake/plugins/format/xmake.lua
parentb3bec1b2ff0c27986c56f4b92f4d5e06b53c9ee1 (diff)
Add format plugin
Diffstat (limited to 'xmake/plugins/format/xmake.lua')
-rw-r--r--xmake/plugins/format/xmake.lua48
1 files changed, 48 insertions, 0 deletions
diff --git a/xmake/plugins/format/xmake.lua b/xmake/plugins/format/xmake.lua
new file mode 100644
index 000000000..980795b60
--- /dev/null
+++ b/xmake/plugins/format/xmake.lua
@@ -0,0 +1,48 @@
+--!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 format.lua
+--
+
+-- define task
+task("format")
+
+ -- set category
+ set_category("plugin")
+
+ -- on run
+ on_run("main")
+
+ -- set menu
+ set_menu {
+ -- usage
+ usage = "xmake format [options] [arguments]"
+
+ -- description
+ , description = "Format the current project."
+
+ -- options
+ , options =
+ {
+ {'s', "style", "kv", nil, "Set the path of.clang-format file, a coding style"..
+ "(LLVM, Google, Chromium, Mozilla, WebKit) or key value string" }
+ , {nil, "create-style", "kv", nil, "Create a .clang-format file from a coding style" }
+ }
+ }
+
+
+