2020-03-11 17:03:23 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** Copyright (C) 2020 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
|
**
|
|
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2020-08-07 13:50:03 +02:00
|
|
|
#include <projectexplorer/buildstep.h>
|
2020-03-11 17:03:23 +02:00
|
|
|
|
2020-08-06 18:11:52 +02:00
|
|
|
#include <QCoreApplication>
|
2020-03-11 17:03:23 +02:00
|
|
|
|
|
|
|
|
namespace IncrediBuild {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class CommandBuilder
|
|
|
|
|
{
|
2020-08-06 18:11:52 +02:00
|
|
|
Q_DECLARE_TR_FUNCTIONS(IncrediBuild::Internal::CommandBuilder)
|
|
|
|
|
|
2020-03-11 17:03:23 +02:00
|
|
|
public:
|
|
|
|
|
CommandBuilder(ProjectExplorer::BuildStep *buildStep) : m_buildStep(buildStep) {}
|
|
|
|
|
virtual ~CommandBuilder() = default;
|
|
|
|
|
|
2020-08-07 13:50:03 +02:00
|
|
|
virtual QList<Utils::Id> migratableSteps() const { return {}; }
|
2020-03-11 17:03:23 +02:00
|
|
|
|
2020-08-06 18:11:52 +02:00
|
|
|
ProjectExplorer::BuildStep *buildStep() const { return m_buildStep; }
|
2020-03-11 17:03:23 +02:00
|
|
|
|
2020-08-06 18:11:52 +02:00
|
|
|
virtual QString id() const { return "CustomCommandBuilder"; }
|
|
|
|
|
virtual QString displayName() const { return tr("Custom Command"); }
|
2020-03-11 17:03:23 +02:00
|
|
|
|
2020-08-06 18:11:52 +02:00
|
|
|
virtual void fromMap(const QVariantMap &map);
|
2020-03-11 17:03:23 +02:00
|
|
|
virtual void toMap(QVariantMap *map) const;
|
|
|
|
|
|
2021-09-28 12:29:29 +02:00
|
|
|
virtual Utils::FilePath defaultCommand() const { return {}; }
|
2020-08-06 18:11:52 +02:00
|
|
|
virtual QString defaultArguments() const { return QString(); }
|
2020-03-11 17:03:23 +02:00
|
|
|
virtual QString setMultiProcessArg(QString args) { return args; }
|
|
|
|
|
|
2021-09-28 12:29:29 +02:00
|
|
|
Utils::FilePath command() const { return m_command; }
|
|
|
|
|
void setCommand(const Utils::FilePath &command);
|
|
|
|
|
Utils::FilePath effectiveCommand() const { return m_command.isEmpty() ? defaultCommand() : m_command; }
|
2020-03-11 17:03:23 +02:00
|
|
|
|
2020-08-06 18:11:52 +02:00
|
|
|
QString arguments() { return m_args.isEmpty() ? defaultArguments() : m_args; }
|
|
|
|
|
void setArguments(const QString &arguments);
|
2020-03-11 17:03:23 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
ProjectExplorer::BuildStep *m_buildStep{};
|
2021-09-28 12:29:29 +02:00
|
|
|
Utils::FilePath m_command;
|
2020-08-06 18:11:52 +02:00
|
|
|
QString m_args;
|
2020-03-11 17:03:23 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace IncrediBuild
|