From 3226821d7af1ce96347e93a3ead4e196618c54e5 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 20 Sep 2019 00:43:09 +0800 Subject: remove some files for template --- xmake/actions/create/main.lua | 17 +++++---------- xmake/actions/create/xmake.lua | 2 +- .../qt.mainwindow.files/files/mainwindowtest.cpp | 14 ------------- .../c++/qt.mainwindow.files/files/mainwindowtest.h | 22 -------------------- .../qt.mainwindow.files/files/mainwindowtest.ui | 24 ---------------------- .../templates/c++/qt.mainwindow.files/template.lua | 2 -- .../c++/qt.widget.files/files/widgettest.cpp | 14 ------------- .../c++/qt.widget.files/files/widgettest.h | 22 -------------------- .../c++/qt.widget.files/files/widgettest.ui | 21 ------------------- xmake/templates/c++/qt.widget.files/template.lua | 2 -- 10 files changed, 6 insertions(+), 134 deletions(-) delete mode 100644 xmake/templates/c++/qt.mainwindow.files/files/mainwindowtest.cpp delete mode 100644 xmake/templates/c++/qt.mainwindow.files/files/mainwindowtest.h delete mode 100644 xmake/templates/c++/qt.mainwindow.files/files/mainwindowtest.ui delete mode 100644 xmake/templates/c++/qt.mainwindow.files/template.lua delete mode 100644 xmake/templates/c++/qt.widget.files/files/widgettest.cpp delete mode 100644 xmake/templates/c++/qt.widget.files/files/widgettest.h delete mode 100644 xmake/templates/c++/qt.widget.files/files/widgettest.ui delete mode 100644 xmake/templates/c++/qt.widget.files/template.lua diff --git a/xmake/actions/create/main.lua b/xmake/actions/create/main.lua index 987d36b16..85367ad3b 100644 --- a/xmake/actions/create/main.lua +++ b/xmake/actions/create/main.lua @@ -89,15 +89,8 @@ function _create_project_or_files(language, templateid, targetname) end os.cp(path.join(os.programdir(), "scripts", "gitignore"), path.join(projectdir, ".gitignore")) table.insert(filedirs, ".gitignore") - end - - -- create files - sourcedir = path.join(tempinst:scriptdir(), "files") - if os.isdir(sourcedir) then - for _, filedir in ipairs(os.filedirs(path.join(sourcedir, "*"))) do - os.cp(filedir, projectdir) - table.insert(filedirs, path.relative(filedir, sourcedir)) - end + else + raise("template(%s): project not found!", templateid) end -- get the builtin variables @@ -123,10 +116,10 @@ function _create_project_or_files(language, templateid, targetname) for _, filedir in ipairs(filedirs) do if os.isdir(filedir) then for _, file in ipairs(os.files(path.join(filedir, "**"))) do - print(" > %s", file) + cprint(" ${green}[+]: ${clear}%s", file) end else - print(" > %s", filedir) + cprint(" ${green}[+]: ${clear}%s", filedir) end end end @@ -141,7 +134,7 @@ function main() local targetname = option.get("target") or path.basename(project.directory()) or "demo" -- trace - cprint("${bright}create %s files ...", targetname) + cprint("${bright}create %s ...", targetname) -- create project or files from template _create_project_or_files(option.get("language"), option.get("template"), targetname) diff --git a/xmake/actions/create/xmake.lua b/xmake/actions/create/xmake.lua index 2c152c34f..e0e8c75da 100644 --- a/xmake/actions/create/xmake.lua +++ b/xmake/actions/create/xmake.lua @@ -38,7 +38,7 @@ task("create") -- options , options = { - {'l', "language", "kv", "c", "The project language" + {'l', "language", "kv", "c++", "The project language" -- show the description of all languages , function () diff --git a/xmake/templates/c++/qt.mainwindow.files/files/mainwindowtest.cpp b/xmake/templates/c++/qt.mainwindow.files/files/mainwindowtest.cpp deleted file mode 100644 index 7982227fe..000000000 --- a/xmake/templates/c++/qt.mainwindow.files/files/mainwindowtest.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "mainwindowtest.h" -#include "ui_mainwindowtest.h" - -MainWindowTest::MainWindowTest(QWidget *parent) : - QMainWindow(parent), - ui(new Ui::MainWindowTest) -{ - ui->setupUi(this); -} - -MainWindowTest::~MainWindowTest() -{ - delete ui; -} diff --git a/xmake/templates/c++/qt.mainwindow.files/files/mainwindowtest.h b/xmake/templates/c++/qt.mainwindow.files/files/mainwindowtest.h deleted file mode 100644 index 53977f29c..000000000 --- a/xmake/templates/c++/qt.mainwindow.files/files/mainwindowtest.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef MAINWINDOWTEST_H -#define MAINWINDOWTEST_H - -#include - -namespace Ui { -class MainWindowTest; -} - -class MainWindowTest : public QMainWindow -{ - Q_OBJECT - -public: - explicit MainWindowTest(QWidget *parent = nullptr); - ~MainWindowTest(); - -private: - Ui::MainWindowTest *ui; -}; - -#endif // MAINWINDOWTEST_H diff --git a/xmake/templates/c++/qt.mainwindow.files/files/mainwindowtest.ui b/xmake/templates/c++/qt.mainwindow.files/files/mainwindowtest.ui deleted file mode 100644 index a231da10d..000000000 --- a/xmake/templates/c++/qt.mainwindow.files/files/mainwindowtest.ui +++ /dev/null @@ -1,24 +0,0 @@ - - - - - MainWindowTest - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/xmake/templates/c++/qt.mainwindow.files/template.lua b/xmake/templates/c++/qt.mainwindow.files/template.lua deleted file mode 100644 index 9e586ed7b..000000000 --- a/xmake/templates/c++/qt.mainwindow.files/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("qt.mainwindow.files") - diff --git a/xmake/templates/c++/qt.widget.files/files/widgettest.cpp b/xmake/templates/c++/qt.widget.files/files/widgettest.cpp deleted file mode 100644 index 67d190c93..000000000 --- a/xmake/templates/c++/qt.widget.files/files/widgettest.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "widgettest.h" -#include "ui_widgettest.h" - -WidgetTest::WidgetTest(QWidget *parent) : - QWidget(parent), - ui(new Ui::WidgetTest) -{ - ui->setupUi(this); -} - -WidgetTest::~WidgetTest() -{ - delete ui; -} diff --git a/xmake/templates/c++/qt.widget.files/files/widgettest.h b/xmake/templates/c++/qt.widget.files/files/widgettest.h deleted file mode 100644 index 8eee1e716..000000000 --- a/xmake/templates/c++/qt.widget.files/files/widgettest.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef WIDGETTEST_H -#define WIDGETTEST_H - -#include - -namespace Ui { -class WidgetTest; -} - -class WidgetTest : public QWidget -{ - Q_OBJECT - -public: - explicit WidgetTest(QWidget *parent = nullptr); - ~WidgetTest(); - -private: - Ui::WidgetTest *ui; -}; - -#endif // WIDGETTEST_H diff --git a/xmake/templates/c++/qt.widget.files/files/widgettest.ui b/xmake/templates/c++/qt.widget.files/files/widgettest.ui deleted file mode 100644 index 72b8737bb..000000000 --- a/xmake/templates/c++/qt.widget.files/files/widgettest.ui +++ /dev/null @@ -1,21 +0,0 @@ - - - - - WidgetTest - - - - 0 - 0 - 400 - 300 - - - - Form - - - - - diff --git a/xmake/templates/c++/qt.widget.files/template.lua b/xmake/templates/c++/qt.widget.files/template.lua deleted file mode 100644 index bc9180e74..000000000 --- a/xmake/templates/c++/qt.widget.files/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("qt.widget.files") - -- cgit v1.3.1