45 lines
1.3 KiB
C
Raw Normal View History

2019-09-23 16:46:57 +03:00
//#
2019-12-08 13:57:20 +03:00
//# Copyright (C) 2018-2020 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-04-01 22:03:37 +03:00
#ifndef QML_DEPLY_H
#define QML_DEPLY_H
2019-03-26 22:12:20 +03:00
2019-03-28 13:16:00 +03:00
#include <QSet>
2019-03-26 22:12:20 +03:00
#include <QStringList>
2019-04-02 12:46:14 +03:00
#include "deploy_global.h"
#include "deploycore.h"
2019-03-26 22:12:20 +03:00
2019-04-02 12:46:14 +03:00
class DEPLOYSHARED_EXPORT QML {
2019-03-26 22:12:20 +03:00
private:
2020-11-05 12:57:41 +03:00
2021-03-27 11:14:14 +03:00
QStringList extractImportsFromFile(const QString &filepath) const;
2020-11-05 12:57:41 +03:00
2019-03-28 16:11:13 +03:00
bool extractImportsFromDir(const QString &path, bool recursive = false);
2020-11-05 12:57:41 +03:00
2020-05-13 18:08:50 +03:00
QString getPathFromImport(const QString& import, bool checkVersions = true);
2020-11-05 12:57:41 +03:00
2019-03-28 16:11:13 +03:00
bool deployPath( const QString& path, QStringList& res);
2019-03-28 13:16:00 +03:00
bool scanQmlTree(const QString& qmlTree);
2021-03-27 11:14:14 +03:00
QStringList extractImportsFromQmlModule(const QString& module) const;
2019-03-26 22:12:20 +03:00
QString _qmlRoot = "";
2019-03-28 16:11:13 +03:00
QSet<QString> _imports;
2019-03-28 13:16:00 +03:00
QSet<QString> secondVersions;
QtMajorVersion _qtVersion = QtMajorVersion::Qt5;
2019-03-26 22:12:20 +03:00
2021-03-27 11:14:14 +03:00
QStringList extractImportLine(const QString &line) const;
2019-03-26 22:12:20 +03:00
public:
QML(const QString& qmlRoot, QtMajorVersion isQt6);
2019-03-26 22:12:20 +03:00
2019-03-28 16:11:13 +03:00
bool scan(QStringList &res, const QString &_qmlProjectDir);
void setQtVersion(const QtMajorVersion &qtVersion);
2019-03-28 16:11:13 +03:00
2019-03-26 22:12:20 +03:00
friend class deploytest;
};
2019-04-01 22:03:37 +03:00
#endif // QML_DEPLY_H