2018-08-19 11:00:13 +03:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 QuasarApp.
|
|
|
|
* Distributed under the lgplv3 software license, see the accompanying
|
|
|
|
* Everyone is permitted to copy and distribute verbatim copies
|
|
|
|
* of this license document, but changing it is not allowed.
|
|
|
|
*/
|
|
|
|
|
2018-08-17 20:47:49 +03:00
|
|
|
#ifndef DEPLOY_H
|
|
|
|
#define DEPLOY_H
|
2018-08-18 18:37:33 +03:00
|
|
|
#include <QDir>
|
2018-08-17 20:47:49 +03:00
|
|
|
#include <QString>
|
|
|
|
#include <QStringList>
|
|
|
|
|
|
|
|
class Deploy
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
bool deployQml = false;
|
|
|
|
QString qmlScaner = "";
|
|
|
|
QString qmake = "";
|
|
|
|
QString qtDir = "";
|
|
|
|
QString target = "";
|
|
|
|
QString targetDir = "";
|
2018-08-23 21:28:47 +03:00
|
|
|
QString qmlDir = "";
|
2018-08-17 20:47:49 +03:00
|
|
|
|
|
|
|
QStringList QtLibs;
|
|
|
|
QStringList noQTLibs;
|
|
|
|
QStringList qmlLibs;
|
2018-08-18 18:37:33 +03:00
|
|
|
QStringList neededPlugins;
|
|
|
|
QStringList ignoreList;
|
2018-08-17 20:47:49 +03:00
|
|
|
|
|
|
|
bool isQtLib(const QString& lib) const;
|
|
|
|
|
|
|
|
void copyFiles(const QStringList &files, const QString &target);
|
|
|
|
bool copyFile(const QString& file, const QString &target);
|
2018-08-19 17:06:29 +03:00
|
|
|
void extract(const QString& file, bool isExtractPlugins = true);
|
2018-08-17 20:47:49 +03:00
|
|
|
|
2018-08-18 18:37:33 +03:00
|
|
|
void extractPlugins(const QString &lib);
|
|
|
|
bool copyPlugin(const QString &plugin);
|
|
|
|
void copyPlugins(const QStringList& list);
|
2018-08-19 17:06:29 +03:00
|
|
|
bool copyFolder(QDir &from, QDir &to, const QString &filter = "",
|
|
|
|
QStringList *listOfCopiedItems = nullptr);
|
2018-08-18 18:37:33 +03:00
|
|
|
|
2018-08-18 22:36:28 +03:00
|
|
|
bool extractQml();
|
2018-08-18 18:37:33 +03:00
|
|
|
|
2018-08-17 23:54:29 +03:00
|
|
|
void strip(const QString &dir);
|
|
|
|
|
2018-08-23 21:28:47 +03:00
|
|
|
QStringList extractImportsFromDir(const QString &dirpath);
|
|
|
|
QStringList findFilesInsideDir(const QString &name, const QString &dirpath);
|
|
|
|
QStringList extractImportsFromFiles(const QStringList &filepath);
|
2018-08-17 20:47:49 +03:00
|
|
|
public:
|
|
|
|
Deploy();
|
|
|
|
bool getDeployQml() const;
|
|
|
|
void setDeployQml(bool value);
|
|
|
|
|
|
|
|
QString getQmlScaner() const;
|
|
|
|
void setQmlScaner(const QString &value);
|
|
|
|
QString getQmake() const;
|
|
|
|
void setQmake(const QString &value);
|
|
|
|
QString getTarget() const;
|
|
|
|
bool setTarget(const QString &value);
|
2018-08-19 11:00:13 +03:00
|
|
|
bool createRunScript();
|
2018-08-17 20:47:49 +03:00
|
|
|
void deploy();
|
|
|
|
QString getQtDir() const;
|
|
|
|
void setQtDir(const QString &value);
|
2018-08-18 19:02:07 +03:00
|
|
|
|
|
|
|
void clear();
|
|
|
|
|
2018-08-17 20:47:49 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DEPLOY_H
|