From 8ee46b185347f31fa6f4380c887974cdbafbb1d1 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 2 Mar 2016 10:29:35 +0800 Subject: add hello plugin --- xmake/actions/config/main.lua | 22 ------------------- xmake/actions/config/test.lua | 36 ------------------------------- xmake/plugins/hello/xmake.lua | 49 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 58 deletions(-) delete mode 100755 xmake/actions/config/test.lua create mode 100755 xmake/plugins/hello/xmake.lua diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua index 68f100cc2..b213e5e7d 100755 --- a/xmake/actions/config/main.lua +++ b/xmake/actions/config/main.lua @@ -20,30 +20,8 @@ -- @file main.lua -- -import("test") -import("core") -import("core.project") - -print("global") -print(project) -print(core.project) -print("test", test) - -function hello() - - print("hello") - print(project) - print(core.project) - test.test2() -end - function main() print("main") - print(project) - print(core.project) - - -- hello - hello() end diff --git a/xmake/actions/config/test.lua b/xmake/actions/config/test.lua deleted file mode 100755 index 1c02385eb..000000000 --- a/xmake/actions/config/test.lua +++ /dev/null @@ -1,36 +0,0 @@ ---!The Automatic Cross-platform Build Tool --- --- XMake is free software; you can redistribute it and/or modify --- it under the terms of the GNU Lesser General Public License as published by --- the Free Software Foundation; either version 2.1 of the License, or --- (at your option) any later version. --- --- XMake is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU Lesser General Public License for more details. --- --- You should have received a copy of the GNU Lesser General Public License --- along with XMake; --- If not, see http://www.gnu.org/licenses/ --- --- Copyright (C) 2015 - 2016, ruki All rights reserved. --- --- @author ruki --- @file test.lua --- - -import("core") -import("core.project") - -print("global") -print(project) -print(core.project) - -function test2() - - print("test2") - print(project) - print(core.project) -end - diff --git a/xmake/plugins/hello/xmake.lua b/xmake/plugins/hello/xmake.lua new file mode 100755 index 000000000..9289c2b14 --- /dev/null +++ b/xmake/plugins/hello/xmake.lua @@ -0,0 +1,49 @@ +--!The Automatic Cross-platform Build Tool +-- +-- XMake is free software; you can redistribute it and/or modify +-- it under the terms of the GNU Lesser General Public License as published by +-- the Free Software Foundation; either version 2.1 of the License, or +-- (at your option) any later version. +-- +-- XMake is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public License +-- along with XMake; +-- If not, see http://www.gnu.org/licenses/ +-- +-- Copyright (C) 2015 - 2016, ruki All rights reserved. +-- +-- @author ruki +-- @file hello.lua +-- + +-- define task +task("hello") + + -- set category + set_task_category("plugin") + + -- on run + on_task_run(function () + + -- trace + print("hello xmake!") + + end) + + -- set menu + set_task_menu({ + -- usage + usage = "xmake hello [options]" + + -- description + , description = "Hello xmake!" + + -- options + , options = {} + }) + + -- cgit v1.3.1