2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2009-03-10 14:20:07 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2009-03-10 14:20:07 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2009-03-10 14:20:07 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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
|
2016-01-15 14:57:40 +01:00
|
|
|
** 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.
|
2009-03-10 14:20:07 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** 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.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2009-03-10 14:20:07 +01:00
|
|
|
|
2009-03-18 15:58:36 +01:00
|
|
|
#ifndef GENERICMAKESTEP_H
|
|
|
|
|
#define GENERICMAKESTEP_H
|
2009-03-10 14:20:07 +01:00
|
|
|
|
2009-12-09 13:54:46 +01:00
|
|
|
#include <projectexplorer/abstractprocessstep.h>
|
2009-03-10 14:20:07 +01:00
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QListWidgetItem;
|
2009-03-19 11:35:25 +01:00
|
|
|
QT_END_NAMESPACE
|
2009-03-18 15:58:36 +01:00
|
|
|
|
2009-03-10 14:20:07 +01:00
|
|
|
namespace GenericProjectManager {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2009-10-15 19:06:51 +02:00
|
|
|
class GenericMakeStepConfigWidget;
|
2010-01-14 17:41:29 +01:00
|
|
|
class GenericMakeStepFactory;
|
2011-11-24 13:00:01 +01:00
|
|
|
namespace Ui { class GenericMakeStep; }
|
2009-03-10 14:20:07 +01:00
|
|
|
|
2009-12-09 13:54:46 +01:00
|
|
|
class GenericMakeStep : public ProjectExplorer::AbstractProcessStep
|
2009-03-10 14:20:07 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2011-11-24 13:00:01 +01:00
|
|
|
|
2012-05-03 16:07:58 +02:00
|
|
|
friend class GenericMakeStepConfigWidget;
|
2010-01-14 17:41:29 +01:00
|
|
|
friend class GenericMakeStepFactory;
|
|
|
|
|
|
2009-03-10 14:20:07 +01:00
|
|
|
public:
|
2015-11-13 11:06:27 +01:00
|
|
|
explicit GenericMakeStep(ProjectExplorer::BuildStepList *parent);
|
2010-01-14 17:41:29 +01:00
|
|
|
|
2015-11-13 12:19:35 +01:00
|
|
|
bool init(QList<const BuildStep *> &earlierSteps) override;
|
2015-11-13 11:06:27 +01:00
|
|
|
void run(QFutureInterface<bool> &fi) override;
|
2009-03-10 14:20:07 +01:00
|
|
|
|
2015-11-13 11:06:27 +01:00
|
|
|
ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
|
|
|
|
|
bool immutable() const override;
|
2009-10-27 14:16:28 +01:00
|
|
|
bool buildsTarget(const QString &target) const;
|
|
|
|
|
void setBuildTarget(const QString &target, bool on);
|
2010-11-12 17:23:55 +01:00
|
|
|
QString allArguments() const;
|
2012-09-11 15:59:17 +02:00
|
|
|
QString makeCommand(const Utils::Environment &environment) const;
|
2009-10-15 19:06:51 +02:00
|
|
|
|
2011-11-08 19:28:05 +01:00
|
|
|
void setClean(bool clean);
|
|
|
|
|
bool isClean() const;
|
|
|
|
|
|
2015-11-13 11:06:27 +01:00
|
|
|
QVariantMap toMap() const override;
|
2010-01-14 17:41:29 +01:00
|
|
|
|
|
|
|
|
protected:
|
2010-07-16 14:00:41 +02:00
|
|
|
GenericMakeStep(ProjectExplorer::BuildStepList *parent, GenericMakeStep *bs);
|
2014-07-01 11:08:26 +02:00
|
|
|
GenericMakeStep(ProjectExplorer::BuildStepList *parent, Core::Id id);
|
2015-11-13 11:06:27 +01:00
|
|
|
bool fromMap(const QVariantMap &map) override;
|
2010-01-14 17:41:29 +01:00
|
|
|
|
2009-03-10 14:20:07 +01:00
|
|
|
private:
|
2010-01-14 17:41:29 +01:00
|
|
|
void ctor();
|
|
|
|
|
|
2009-10-27 14:16:28 +01:00
|
|
|
QStringList m_buildTargets;
|
2010-10-19 11:14:03 +02:00
|
|
|
QString m_makeArguments;
|
2009-10-27 14:16:28 +01:00
|
|
|
QString m_makeCommand;
|
2011-11-08 19:28:05 +01:00
|
|
|
bool m_clean;
|
2009-03-10 14:20:07 +01:00
|
|
|
};
|
|
|
|
|
|
2012-08-14 15:37:38 +02:00
|
|
|
class GenericMakeStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
|
2009-03-10 14:20:07 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2012-08-14 15:37:38 +02:00
|
|
|
|
2009-03-10 14:20:07 +01:00
|
|
|
public:
|
2009-03-18 13:33:00 +01:00
|
|
|
GenericMakeStepConfigWidget(GenericMakeStep *makeStep);
|
2012-07-13 14:26:50 +02:00
|
|
|
~GenericMakeStepConfigWidget();
|
2012-08-14 15:37:38 +02:00
|
|
|
QString displayName() const;
|
|
|
|
|
QString summaryText() const;
|
|
|
|
|
|
2009-03-10 14:20:07 +01:00
|
|
|
private slots:
|
2012-08-14 15:37:38 +02:00
|
|
|
void itemChanged(QListWidgetItem *item);
|
2009-03-18 15:58:36 +01:00
|
|
|
void makeLineEditTextEdited();
|
|
|
|
|
void makeArgumentsLineEditTextEdited();
|
2009-08-12 17:02:28 +02:00
|
|
|
void updateMakeOverrrideLabel();
|
2009-08-06 18:31:46 +02:00
|
|
|
void updateDetails();
|
2012-08-14 15:37:38 +02:00
|
|
|
|
2009-08-17 18:19:16 +02:00
|
|
|
private:
|
2009-03-18 15:58:36 +01:00
|
|
|
Ui::GenericMakeStep *m_ui;
|
2009-03-18 13:33:00 +01:00
|
|
|
GenericMakeStep *m_makeStep;
|
2009-08-06 18:31:46 +02:00
|
|
|
QString m_summaryText;
|
2009-03-10 14:20:07 +01:00
|
|
|
};
|
|
|
|
|
|
2009-03-18 13:33:00 +01:00
|
|
|
class GenericMakeStepFactory : public ProjectExplorer::IBuildStepFactory
|
2009-03-10 14:20:07 +01:00
|
|
|
{
|
2010-01-14 17:41:29 +01:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit GenericMakeStepFactory(QObject *parent = 0);
|
2012-03-15 17:17:40 +01:00
|
|
|
|
2016-01-29 12:28:31 +01:00
|
|
|
bool canCreate(ProjectExplorer::BuildStepList *parent, Core::Id id) const override;
|
|
|
|
|
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, Core::Id id) override;
|
2012-03-15 17:17:40 +01:00
|
|
|
bool canClone(ProjectExplorer::BuildStepList *parent,
|
2016-01-29 12:28:31 +01:00
|
|
|
ProjectExplorer::BuildStep *source) const override;
|
2012-03-15 17:17:40 +01:00
|
|
|
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent,
|
2016-01-29 12:28:31 +01:00
|
|
|
ProjectExplorer::BuildStep *source) override;
|
|
|
|
|
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const override;
|
2012-03-15 17:17:40 +01:00
|
|
|
ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent,
|
2016-01-29 12:28:31 +01:00
|
|
|
const QVariantMap &map) override;
|
2012-03-15 17:17:40 +01:00
|
|
|
|
2016-01-29 12:28:31 +01:00
|
|
|
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const override;
|
|
|
|
|
QString displayNameForId(Core::Id id) const override;
|
2009-03-10 14:20:07 +01:00
|
|
|
};
|
|
|
|
|
|
2009-03-18 12:18:59 +01:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace GenericProjectManager
|
2009-03-10 14:20:07 +01:00
|
|
|
|
2009-03-18 15:58:36 +01:00
|
|
|
#endif // GENERICMAKESTEP_H
|