diff options
| author | ruki <[email protected]> | 2022-07-23 00:28:49 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-07-23 00:28:49 +0800 |
| commit | 9fce77f97024a1c76fd60d41bc52fc3c3ceb329a (patch) | |
| tree | 20173f3e644b44252fd4f4b793caeddbcf06b1bd | |
| parent | 67a7d807940ff5ebdda3a5054265422f31fca6a8 (diff) | |
add watch plugin stub
| -rw-r--r-- | xmake/plugins/watch/main.lua | 27 | ||||
| -rw-r--r-- | xmake/plugins/watch/xmake.lua | 47 |
2 files changed, 74 insertions, 0 deletions
diff --git a/xmake/plugins/watch/main.lua b/xmake/plugins/watch/main.lua new file mode 100644 index 000000000..9e297a02a --- /dev/null +++ b/xmake/plugins/watch/main.lua @@ -0,0 +1,27 @@ +--!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 main.lua +-- + +-- imports +import("core.base.option") +import("core.base.fwatcher") + +function main() + +end diff --git a/xmake/plugins/watch/xmake.lua b/xmake/plugins/watch/xmake.lua new file mode 100644 index 000000000..f5a48ba09 --- /dev/null +++ b/xmake/plugins/watch/xmake.lua @@ -0,0 +1,47 @@ +--!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 xmake.lua +-- + +task("watch") + set_category("plugin") + on_run("main") + set_menu { + usage = "xmake watch [options] [arguments]" + , description = "Watch the project directories and run command." + , options = + { + {'c', "command" , "kv" , nil , "Run the given command instead of the default build command.", + "e.g.", + " $ xmake watch -c 'xmake -rv'", + " $ xmake watch -c 'xmake -vD; xmake run hello'"}, + {'s', "script" , "kv" , nil , "Run the given lua script file.", + "e.g.", + " $ xmake watch -s /tmp/watch.lua"}, + {'d', "dir" , "kv" , nil , "Set the given watch directories, the project directories will be watched by default.", + "e.g.", + " $ xmake watch -d src", + " $ xmake watch -d 'src/*" .. path.envsep() .. "tests/**/subdir'"}, + {'r', "recursion" , "k" , nil , "Recursively watch directories."}, + {'t', "target" , "kv" , nil , "Build the given target.", + values = function (complete, opt) return import("private.utils.complete_helper.targets")(complete, opt) end } + } + } + + + |
