1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
/*
Copyright 2017 Aleix Pol Gonzalez <aleixpol@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef FLATPAKRUNTIME_H
#define FLATPAKRUNTIME_H
#include <interfaces/iruntime.h>
#include <util/path.h>
class KJob;
class FlatpakPlugin;
class FlatpakRuntime : public KDevelop::IRuntime
{
Q_OBJECT
public:
FlatpakRuntime(const KDevelop::Path &buildDirectory, const KDevelop::Path &file, const QString &arch);
~FlatpakRuntime() override;
QString name() const override;
void setEnabled(bool enabled) override;
void startProcess(KProcess *process) const override;
void startProcess(QProcess *process) const override;
KDevelop::Path pathInHost(const KDevelop::Path & runtimePath) const override;
KDevelop::Path pathInRuntime(const KDevelop::Path & localPath) const override;
QString findExecutable(const QString& executableName) const override;
QByteArray getenv(const QByteArray &varname) const override;
static KJob* createBuildDirectory(const KDevelop::Path &path, const KDevelop::Path &file, const QString &arch);
KJob* rebuild();
QList<KJob*> exportBundle(const QString &path) const;
KJob* executeOnDevice(const QString &host, const QString &path) const;
static QJsonObject config(const KDevelop::Path& path);
KDevelop::Path buildPath() const override;
private:
void refreshJson();
QJsonObject config() const;
const KDevelop::Path m_file;
const KDevelop::Path m_buildDirectory;
const QString m_arch;
QStringList m_finishArgs;
KDevelop::Path m_sdkPath;
};
#endif
|