自动编译框架
This commit is contained in:
parent
43e6daefec
commit
f43a264c78
|
@ -8,16 +8,6 @@ CONFIG -= app_bundle
|
||||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
LexFoundation.cpp \
|
|
||||||
ParseFrame.cpp \
|
|
||||||
StoryBoardDocumentParser.cpp \
|
|
||||||
StoryChainDocumentParser.cpp \
|
|
||||||
StoryOutlineDocumentParser.cpp \
|
|
||||||
StoryTool.cpp \
|
|
||||||
StoryUnitDocumentParser.cpp \
|
|
||||||
SyntaxBase.cpp \
|
|
||||||
WordsPeak.cpp \
|
|
||||||
XSyntaxBase.cpp \
|
|
||||||
main.cpp
|
main.cpp
|
||||||
|
|
||||||
TRANSLATIONS += \
|
TRANSLATIONS += \
|
||||||
|
@ -31,20 +21,17 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
!isEmpty(target.path): INSTALLS += target
|
!isEmpty(target.path): INSTALLS += target
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
ComnDef.h \
|
|
||||||
LexFoundation.h \
|
|
||||||
ParseFrame.h \
|
|
||||||
StoryBoardDocumentParser.h \
|
|
||||||
StoryChainDocumentParser.h \
|
|
||||||
StoryOutlineDocumentParser.h \
|
|
||||||
StoryTool.h \
|
|
||||||
StoryUnitDocumentParser.h \
|
|
||||||
SyntaxBase.h \
|
|
||||||
WordsPeak.h \
|
|
||||||
XSyntaxBase.h
|
|
||||||
|
|
||||||
DISTFILES += \
|
DISTFILES += \
|
||||||
example.storyboard \
|
example.storyboard \
|
||||||
example.storychain \
|
example.storychain \
|
||||||
example.storyunit \
|
example.storyunit \
|
||||||
example.storyvolume
|
example.storyvolume
|
||||||
|
|
||||||
|
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../libParse/release/ -llibParse
|
||||||
|
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../libParse/debug/ -llibParse
|
||||||
|
else:unix: LIBS += -L$$OUT_PWD/../libParse/ -llibParse
|
||||||
|
|
||||||
|
INCLUDEPATH += $$PWD/../libParse
|
||||||
|
DEPENDPATH += $$PWD/../libParse
|
||||||
|
|
|
@ -2,12 +2,7 @@
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include "StoryChainDocumentParser.h"
|
#include <StoryTool.h>
|
||||||
#include "StoryUnitDocumentParser.h"
|
|
||||||
#include "StoryBoardDocumentParser.h"
|
|
||||||
#include "StoryOutlineDocumentParser.h"
|
|
||||||
#include "ParseFrame.h"
|
|
||||||
#include "StoryTool.h"
|
|
||||||
|
|
||||||
using namespace Parse;
|
using namespace Parse;
|
||||||
using namespace Parse::Result;
|
using namespace Parse::Result;
|
||||||
|
@ -41,7 +36,7 @@ int main(int argc, char *argv[])
|
||||||
// auto retlist = frame.analysis(&doc, "D:\\Projects\\Cpp\\QtNovelDesc\\DesParser\\example.storyboard");
|
// auto retlist = frame.analysis(&doc, "D:\\Projects\\Cpp\\QtNovelDesc\\DesParser\\example.storyboard");
|
||||||
|
|
||||||
|
|
||||||
ParseCore core("empty");
|
ParseCore core;
|
||||||
Make::StoryTool tool(&core);
|
Make::StoryTool tool(&core);
|
||||||
|
|
||||||
auto path = "D:\\Projects\\Cpp\\QtNovelDesc\\DesParser\\example.storyvolume";
|
auto path = "D:\\Projects\\Cpp\\QtNovelDesc\\DesParser\\example.storyvolume";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE QtCreatorProject>
|
<!DOCTYPE QtCreatorProject>
|
||||||
<!-- Written by QtCreator 4.15.0, 2022-11-15T01:50:08. -->
|
<!-- Written by QtCreator 4.15.0, 2022-11-15T20:57:04. -->
|
||||||
<qtcreator>
|
<qtcreator>
|
||||||
<data>
|
<data>
|
||||||
<variable>EnvironmentId</variable>
|
<variable>EnvironmentId</variable>
|
||||||
|
|
|
@ -9,10 +9,12 @@ CONFIG += c++11
|
||||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
|
SensitiveFramework.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
mainwindow.cpp
|
mainwindow.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
SensitiveFramework.h \
|
||||||
mainwindow.h
|
mainwindow.h
|
||||||
|
|
||||||
TRANSLATIONS += \
|
TRANSLATIONS += \
|
||||||
|
@ -38,3 +40,10 @@ else:unix: LIBS += -L$$OUT_PWD/../libProjectManager/ -llibProjectManager
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/../libProjectManager
|
INCLUDEPATH += $$PWD/../libProjectManager
|
||||||
DEPENDPATH += $$PWD/../libProjectManager
|
DEPENDPATH += $$PWD/../libProjectManager
|
||||||
|
|
||||||
|
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../libParse/release/ -llibParse
|
||||||
|
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../libParse/debug/ -llibParse
|
||||||
|
else:unix: LIBS += -L$$OUT_PWD/../libParse/ -llibParse
|
||||||
|
|
||||||
|
INCLUDEPATH += $$PWD/../libParse
|
||||||
|
DEPENDPATH += $$PWD/../libParse
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
|
|
||||||
using namespace Project;
|
using namespace Project;
|
||||||
|
using namespace Make;
|
||||||
|
using namespace Parse::Result;
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent)
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
: QMainWindow(parent),
|
: QMainWindow(parent),
|
||||||
|
@ -23,10 +25,12 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
bottom_funcs(new QTabWidget(this)),
|
bottom_funcs(new QTabWidget(this)),
|
||||||
project_view(new QTreeView(this)),
|
project_view(new QTreeView(this)),
|
||||||
errors_present(new QTableView(this)),
|
errors_present(new QTableView(this)),
|
||||||
project_manager(new XMLProjectManager(this))
|
project_manager(new XMLProjectManager(this)),
|
||||||
|
syntax_core(new ParseCore()),
|
||||||
|
make_tool(new StoryTool(syntax_core))
|
||||||
{
|
{
|
||||||
setMinimumSize(1000, 600);
|
setMinimumSize(1000, 600);
|
||||||
setWindowTitle("提线木偶文学项目集成开发工具");
|
setWindowTitle("提线木偶集成开发工具");
|
||||||
|
|
||||||
auto xtool = new QToolBar(this);
|
auto xtool = new QToolBar(this);
|
||||||
addToolBar(Qt::ToolBarArea::TopToolBarArea, xtool);
|
addToolBar(Qt::ToolBarArea::TopToolBarArea, xtool);
|
||||||
|
@ -42,6 +46,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
_xnew->addAction("故事单元");
|
_xnew->addAction("故事单元");
|
||||||
_xnew->addAction("故事大纲");
|
_xnew->addAction("故事大纲");
|
||||||
_xnew->addAction("叙事大纲");
|
_xnew->addAction("叙事大纲");
|
||||||
|
_xnew->addSeparator();
|
||||||
_xnew->addAction("小说章节");
|
_xnew->addAction("小说章节");
|
||||||
project->addSeparator();
|
project->addSeparator();
|
||||||
auto sav = project->addAction("保存");
|
auto sav = project->addAction("保存");
|
||||||
|
@ -137,6 +142,9 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
exp->addSeparator();
|
exp->addSeparator();
|
||||||
exp->addAction("导出TXT内容");
|
exp->addAction("导出TXT内容");
|
||||||
exp->addAction("导出TXT大纲");
|
exp->addAction("导出TXT大纲");
|
||||||
|
tool->addAction("编译", [this](){
|
||||||
|
this->build_internal();
|
||||||
|
});
|
||||||
|
|
||||||
// 窗口菜单
|
// 窗口菜单
|
||||||
auto window = mbar->addMenu("窗口");
|
auto window = mbar->addMenu("窗口");
|
||||||
|
@ -172,3 +180,22 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::build_internal()
|
||||||
|
{
|
||||||
|
auto chains = project_manager->filesWithEnds("storychain");
|
||||||
|
for(auto &it : chains)
|
||||||
|
make_tool->compile(it);
|
||||||
|
|
||||||
|
auto units = project_manager->filesWithEnds("storyunit");
|
||||||
|
for(auto &it : units)
|
||||||
|
make_tool->compile(it);
|
||||||
|
|
||||||
|
auto storys = project_manager->filesWithEnds("storyboard");
|
||||||
|
for(auto &it : storys)
|
||||||
|
make_tool->compile(it);
|
||||||
|
|
||||||
|
auto volumes = project_manager->filesWithEnds("storyvolume");
|
||||||
|
for(auto &it : volumes)
|
||||||
|
make_tool->compile(it);
|
||||||
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include <QSplitter>
|
#include <QSplitter>
|
||||||
#include <QTableView>
|
#include <QTableView>
|
||||||
#include <ProjectManager.h>
|
#include <ProjectManager.h>
|
||||||
|
#include <StoryTool.h>
|
||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
|
|
||||||
class MainWindow : public QMainWindow
|
class MainWindow : public QMainWindow
|
||||||
|
@ -28,5 +29,11 @@ private:
|
||||||
QTableView *const errors_present;
|
QTableView *const errors_present;
|
||||||
|
|
||||||
Project::ProjectManager *const project_manager;
|
Project::ProjectManager *const project_manager;
|
||||||
|
Parse::Result::ParseCore *const syntax_core;
|
||||||
|
Make::StoryTool *const make_tool;
|
||||||
|
|
||||||
|
// 内部逻辑 ===========================================
|
||||||
|
void build_internal();
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
|
Loading…
Reference in New Issue