mirror of
https://github.com/QuasarApp/QtDeployer.git
synced 2025-04-26 05:24:31 +00:00
added build manager
This commit is contained in:
parent
75fae751b6
commit
1d8307ea7a
1
.gitignore
vendored
1
.gitignore
vendored
@ -53,5 +53,6 @@ snap/plugins/__pycache__/
|
||||
|
||||
b/
|
||||
Build*/
|
||||
Release*/
|
||||
|
||||
*.stash
|
||||
|
37
snap/dumpSnap/snapcraft.yaml
Executable file
37
snap/dumpSnap/snapcraft.yaml
Executable file
@ -0,0 +1,37 @@
|
||||
name: qt-deployer
|
||||
version: '1.0test2'
|
||||
summary: Deploy Qt Project
|
||||
description: |
|
||||
Deploy Qt Projects. this application extract all depends library of executable and create launch script for your application.
|
||||
|
||||
grade: stable # must be 'stable' to release into candidate/stable channels
|
||||
confinement: strict # use 'strict' once you have the right plugs and slots
|
||||
|
||||
icon: snap/gui/icon.png
|
||||
|
||||
apps:
|
||||
qt-deployer:
|
||||
command: bin/qt-deployer
|
||||
|
||||
plugs: [desktop, unity7, home, opengl, x11, wayland]
|
||||
environment:
|
||||
LD_LIBRARY_PATH: $SNAP/lib
|
||||
QML_IMPORT_PATH: $SNAP/qml
|
||||
QML2_IMPORT_PATH: $SNAP/qml
|
||||
QT_PLUGIN_PATH: $SNAP/plugins
|
||||
QT_QPA_PLATFORM_PLUGIN_PATH: $SNAP/plugins/platforms
|
||||
|
||||
|
||||
parts:
|
||||
qt-deployer:
|
||||
plugin: dump
|
||||
source: app/
|
||||
|
||||
stage-packages:
|
||||
# Here for the plugins-- they're not linked in automatically.
|
||||
- libx11-xcb-dev
|
||||
- libglu1-mesa-dev
|
||||
- libxrender-dev
|
||||
- libxi-dev
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 42 KiB |
@ -38,7 +38,24 @@ const QString& BuildManager::log() const{
|
||||
return tempLog;
|
||||
}
|
||||
|
||||
bool BuildManager::initFolderName() {
|
||||
bool BuildManager::createFulder(QDir& dir, QString &path, const QString &name) const{
|
||||
|
||||
path = dir.absolutePath() + "/" + name;
|
||||
if(dir.exists(path) && !QDir(path).removeRecursively()){
|
||||
|
||||
path.clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!dir.mkdir(path)){
|
||||
path.clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BuildManager::initFolders() {
|
||||
QDir dir(m_projectdir);
|
||||
if(!dir.cd("..")) {
|
||||
return false;
|
||||
@ -72,15 +89,11 @@ bool BuildManager::initFolderName() {
|
||||
}
|
||||
projectName = proFile.mid(beginTarget, longTraget);
|
||||
|
||||
tempBuildFolder = dir.absolutePath() + "/Build-" + projectName;
|
||||
if(dir.exists(tempBuildFolder) && !QDir(tempBuildFolder).removeRecursively()){
|
||||
|
||||
tempBuildFolder.clear();
|
||||
if(!createFulder(dir, tempBuildFolder, "Build-" + projectName)){
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!dir.mkdir(tempBuildFolder)){
|
||||
tempBuildFolder.clear();
|
||||
if(!createFulder(dir, m_outputdir, "Release-" + projectName)){
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -88,7 +101,7 @@ bool BuildManager::initFolderName() {
|
||||
}
|
||||
|
||||
bool BuildManager::build(){
|
||||
if(!initQMake() || !initFolderName()){
|
||||
if(!initQMake() || !initFolders()){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,8 @@ private:
|
||||
QString projectName;
|
||||
QProcess pQMake;
|
||||
|
||||
bool initFolderName();
|
||||
bool createFulder(QDir& dir, QString& path, const QString& name) const;
|
||||
bool initFolders();
|
||||
bool initQMake();
|
||||
|
||||
private slots:
|
||||
|
@ -26,22 +26,22 @@ MainManager::MainManager(CppManager *cpp, QmlManager *qml, OutputManager *out,
|
||||
}
|
||||
|
||||
void MainManager::buildFinished(){
|
||||
emit outDirChanged();
|
||||
m_qml->start();
|
||||
m_plg->start();
|
||||
m_cpp->start(getAllExecutables());
|
||||
}
|
||||
|
||||
void MainManager::prepare(const QString &qtdir, const QString &projectdir, const QString &outdir)
|
||||
void MainManager::prepare(const QString &qtdir, const QString &projectdir)
|
||||
{
|
||||
QStringList list;
|
||||
list << qtdir << projectdir << outdir;
|
||||
list << qtdir << projectdir ;
|
||||
|
||||
for (QString &S : list)
|
||||
if (S[S.count() - 1] == '/') S.remove(S.count() - 1, 1);
|
||||
|
||||
m_qtdir = list[0];
|
||||
m_projectdir = list[1];
|
||||
m_outputdir = list[2];
|
||||
|
||||
m_bld->build();
|
||||
}
|
||||
@ -73,6 +73,10 @@ bool MainManager::pathExists(bool isdir, const QString &path)
|
||||
return QFile(path).exists();
|
||||
}
|
||||
|
||||
const QString& MainManager::outDir() const{
|
||||
return m_outputdir;
|
||||
}
|
||||
|
||||
void MainManager::setState(int state)
|
||||
{
|
||||
if (m_state == state) return;
|
||||
|
@ -13,6 +13,7 @@ class MainManager : public BaseClass
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(int state READ state WRITE setState NOTIFY stateChanged)
|
||||
Q_PROPERTY(QString outDir READ outDir NOTIFY outDirChanged)
|
||||
|
||||
CppManager *m_cpp;
|
||||
QmlManager *m_qml;
|
||||
@ -35,9 +36,10 @@ public:
|
||||
int state() const;
|
||||
|
||||
public slots:
|
||||
void prepare(const QString &qtdir, const QString &projectdir, const QString &outdir);
|
||||
void prepare(const QString &qtdir, const QString &projectdir);
|
||||
|
||||
void start(bool erase);
|
||||
const QString& outDir() const;
|
||||
|
||||
bool hasPrems(const QString &path);
|
||||
QString stringFromUrl(QString url);
|
||||
@ -47,6 +49,7 @@ public slots:
|
||||
|
||||
signals:
|
||||
void stateChanged(int state);
|
||||
void outDirChanged();
|
||||
};
|
||||
|
||||
#endif // MAINMANAGER_H
|
||||
|
@ -28,11 +28,6 @@ Page {
|
||||
title: qsTr("Project Directory")
|
||||
}
|
||||
|
||||
PathChooser {
|
||||
id: outdir
|
||||
title: qsTr("Final Output Directory")
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
@ -42,12 +37,12 @@ Page {
|
||||
text: qsTr("Next")
|
||||
Material.background: buttonColor
|
||||
Layout.alignment: Qt.AlignRight
|
||||
enabled: qtdir.confirmed && projectdir.confirmed && outdir.confirmed
|
||||
enabled: qtdir.confirmed && projectdir.confirmed
|
||||
|
||||
onClicked: {
|
||||
MainManager.prepare(qtdir.content, projectdir.content, outdir.content)
|
||||
MainManager.prepare(qtdir.content, projectdir.content)
|
||||
|
||||
prp.outdir = outdir.content
|
||||
prp.outdir = MainManager.outDir
|
||||
swipeview.currentIndex = 1
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user