diff options
| author | ruki <[email protected]> | 2019-09-20 00:43:09 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-09-19 22:18:57 +0800 |
| commit | 3226821d7af1ce96347e93a3ead4e196618c54e5 (patch) | |
| tree | 4015848dc9c48fb6f4c43a39b6966c2437982418 | |
| parent | a838d8561e98342ed2c793c239f495357e4179c1 (diff) | |
remove some files for template
10 files changed, 6 insertions, 134 deletions
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 <QMainWindow>
-
-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 @@ -<ui version="4.0">
- <author/>
- <comment/>
- <exportmacro/>
- <class>MainWindowTest</class>
- <widget class="QMainWindow" name="MainWindowTest">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>800</width>
- <height>600</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>MainWindow</string>
- </property>
- <widget class="QMenuBar" name="menubar"/>
- <widget class="QWidget" name="centralwidget"/>
- <widget class="QStatusBar" name="statusbar"/>
- </widget>
- <pixmapfunction/>
- <connections/>
-</ui>
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 <QWidget>
-
-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 @@ -<ui version="4.0">
- <author/>
- <comment/>
- <exportmacro/>
- <class>WidgetTest</class>
- <widget class="QWidget" name="WidgetTest">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>400</width>
- <height>300</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Form</string>
- </property>
- </widget>
- <pixmapfunction/>
- <connections/>
-</ui>
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") - |
