2019-09-23 16:46:57 +03:00
|
|
|
//#
|
2021-01-05 13:17:11 +03:00
|
|
|
//# Copyright (C) 2018-2021 QuasarApp.
|
2019-09-23 16:46:57 +03:00
|
|
|
//# 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.
|
|
|
|
//#
|
|
|
|
|
2019-09-04 21:27:29 +03:00
|
|
|
#ifndef CQT_H
|
|
|
|
#define CQT_H
|
2019-12-11 18:06:54 +03:00
|
|
|
#include "deployconfig.h"
|
2019-09-15 17:38:47 +03:00
|
|
|
#include "distrostruct.h"
|
2019-09-07 12:36:20 +03:00
|
|
|
#include "envirement.h"
|
2019-09-23 10:06:22 +03:00
|
|
|
#include "ignorerule.h"
|
2021-01-19 14:26:11 +03:00
|
|
|
#include "targetdata.h"
|
2019-12-08 13:57:20 +03:00
|
|
|
#include "targetinfo.h"
|
2019-09-07 12:36:20 +03:00
|
|
|
|
2019-09-04 21:27:29 +03:00
|
|
|
#include <QJsonObject>
|
|
|
|
#include <QJsonDocument>
|
|
|
|
#include <QJsonArray>
|
2019-09-07 12:01:20 +03:00
|
|
|
#include <QStringList>
|
|
|
|
#include <QMap>
|
|
|
|
#include <QDir>
|
2019-09-09 21:19:44 +03:00
|
|
|
#include "deploy_global.h"
|
2019-09-04 21:27:29 +03:00
|
|
|
|
2020-01-04 16:39:25 +03:00
|
|
|
class FileManager;
|
|
|
|
class DependenciesScanner;
|
|
|
|
class Packing;
|
|
|
|
class iDistribution;
|
2020-07-04 18:13:32 +03:00
|
|
|
class PluginsParser;
|
2019-09-04 21:27:29 +03:00
|
|
|
|
2019-09-14 13:59:11 +03:00
|
|
|
class DEPLOYSHARED_EXPORT ConfigParser
|
2019-09-04 21:27:29 +03:00
|
|
|
{
|
2020-07-04 18:13:32 +03:00
|
|
|
public:
|
|
|
|
ConfigParser(FileManager *filemanager, PluginsParser* pluginsParser, DependenciesScanner *scaner, Packing* pac);
|
|
|
|
bool parseParams();
|
|
|
|
bool smartMoveTargets();
|
|
|
|
|
|
|
|
const DeployConfig* config() const;
|
|
|
|
friend class deploytest;
|
|
|
|
|
2019-09-04 21:27:29 +03:00
|
|
|
private:
|
|
|
|
|
2019-09-07 12:01:20 +03:00
|
|
|
DeployConfig _config;
|
2019-09-08 13:37:33 +03:00
|
|
|
FileManager *_fileManager;
|
2020-07-04 18:13:32 +03:00
|
|
|
PluginsParser *_pluginsParser;
|
2019-11-13 18:18:44 +03:00
|
|
|
DependenciesScanner *_scaner;
|
2020-01-04 16:39:25 +03:00
|
|
|
Packing * _packing;
|
2019-12-10 18:43:01 +03:00
|
|
|
|
2020-01-27 20:02:25 +03:00
|
|
|
QHash<QString, QString> _Targetpackages;
|
2019-12-10 18:43:01 +03:00
|
|
|
|
2019-09-10 15:40:12 +03:00
|
|
|
bool createFromDeploy(const QString& file) const;
|
|
|
|
bool loadFromFile(const QString& file);
|
2019-12-27 20:23:55 +03:00
|
|
|
bool initDistroStruct();
|
2020-01-27 20:02:25 +03:00
|
|
|
bool initPackages();
|
2021-01-08 22:02:50 +03:00
|
|
|
bool initRunScripts();
|
2020-01-24 13:57:55 +03:00
|
|
|
bool parseDeployMode();
|
|
|
|
bool parseInfoMode();
|
|
|
|
bool parseInitMode();
|
2021-02-26 20:24:06 +03:00
|
|
|
/**
|
|
|
|
* @brief configureTargets Sets targets data from options.
|
|
|
|
* @return true if function finishe successfull
|
|
|
|
*/
|
|
|
|
void configureTargets();
|
2020-01-24 13:57:55 +03:00
|
|
|
|
|
|
|
bool parseClearMode();
|
2019-09-07 12:01:20 +03:00
|
|
|
|
2019-11-14 17:35:21 +03:00
|
|
|
QSet<QString> getQtPathesFromTargets();
|
|
|
|
|
2019-09-07 12:36:20 +03:00
|
|
|
void setTargetDir(const QString &target = "");
|
2019-09-07 12:01:20 +03:00
|
|
|
bool setTargets(const QStringList &value);
|
2021-04-20 14:19:05 +03:00
|
|
|
QFileInfo getBinInfo(const QString& bin);
|
2019-09-07 12:01:20 +03:00
|
|
|
bool setTargetsRecursive(const QString &dir);
|
2020-12-04 17:13:12 +03:00
|
|
|
bool setTargetsInDir(const QString &dir, bool recursive = false);
|
2019-09-07 12:01:20 +03:00
|
|
|
|
|
|
|
void initIgnoreList();
|
|
|
|
void initIgnoreEnvList();
|
|
|
|
|
2019-11-02 01:00:05 +03:00
|
|
|
QString getPathFrmoQmakeLine(const QString& in) const;
|
2019-11-14 17:35:21 +03:00
|
|
|
bool initQmakePrivate(const QString& qmake);
|
|
|
|
bool initQmake();
|
2019-12-15 18:30:24 +03:00
|
|
|
bool initQmlInput();
|
|
|
|
|
2021-05-01 00:31:15 +03:00
|
|
|
void packagesErrorLog(const QString &option);
|
2020-12-07 18:30:02 +03:00
|
|
|
|
2019-11-01 15:12:03 +03:00
|
|
|
bool setQmake(const QString &value);
|
|
|
|
bool setQtDir(const QString &value);
|
2019-09-07 12:01:20 +03:00
|
|
|
|
2020-10-12 22:23:36 +03:00
|
|
|
void initExtraPath();
|
|
|
|
void initExtraNames();
|
2019-11-05 13:17:52 +03:00
|
|
|
|
2020-07-04 18:13:32 +03:00
|
|
|
bool initPlugins();
|
2019-09-07 12:01:20 +03:00
|
|
|
|
|
|
|
void initEnvirement();
|
2019-09-04 21:27:29 +03:00
|
|
|
|
2020-11-05 12:57:41 +03:00
|
|
|
/**
|
|
|
|
* @brief checkSnapPermisions This method checks the required permissions. Of all the permissions granted, this method returns true, otherwise false.
|
|
|
|
* @return
|
|
|
|
*/
|
2020-07-29 10:47:28 +03:00
|
|
|
bool checkSnapPermisions();
|
|
|
|
|
2019-09-14 15:51:23 +03:00
|
|
|
QStringList getDirsRecursive(const QString &path, int maxDepch = -1, int depch = 0);
|
2019-11-05 13:17:52 +03:00
|
|
|
QSet<QString> getSetDirsRecursive(const QString &path, int maxDepch = -1, int depch = 0);
|
2019-09-08 13:37:33 +03:00
|
|
|
|
2019-09-29 18:14:41 +03:00
|
|
|
QString getRelativeLink(const QString& from, const QString& to);
|
|
|
|
void writeKey(const QString &key, QJsonObject &, const QString &confFileDir) const;
|
|
|
|
void readKey(const QString &key, const QJsonObject &obj, const QString &confFileDir) const;
|
2020-03-15 12:48:38 +03:00
|
|
|
void readString(const QString &key, const QString &val, const QString &confFileDir) const;
|
|
|
|
|
2021-01-19 14:26:11 +03:00
|
|
|
TargetData createTarget(const QString &target);
|
2020-01-01 23:44:16 +03:00
|
|
|
QHash<QString, TargetInfo> moveTarget(TargetInfo target, const QString &newLocation);
|
|
|
|
|
2019-12-11 18:06:54 +03:00
|
|
|
|
2019-12-12 18:16:31 +03:00
|
|
|
QString readKeyArray(int separatorLvl, const QJsonArray &array, const QString &confFileDir) const;
|
|
|
|
QJsonValue writeKeyArray(int separatorLvl, const QString ¶meter, const QString &confFileDir) const;
|
2019-12-18 13:49:07 +03:00
|
|
|
QString findWindowsPath(const QString &path) const;
|
2020-01-04 16:39:25 +03:00
|
|
|
|
2020-08-15 14:38:03 +03:00
|
|
|
QList<iDistribution *> getDistribution();
|
2020-01-04 16:39:25 +03:00
|
|
|
|
2019-09-04 21:27:29 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CQT_H
|