2009-03-10 14:20:07 +01:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2012-01-26 18:33:46 +01:00
|
|
|
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
2009-03-10 14:20:07 +01:00
|
|
|
**
|
2012-07-19 12:26:56 +02:00
|
|
|
** Contact: http://www.qt-project.org/
|
2009-03-10 14:20:07 +01:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** This file may be used under the terms of the GNU Lesser General Public
|
|
|
|
|
** License version 2.1 as published by the Free Software Foundation and
|
|
|
|
|
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
|
|
|
|
** Please review the following information to ensure the GNU Lesser General
|
|
|
|
|
** Public License version 2.1 requirements will be met:
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2009-03-10 14:20:07 +01:00
|
|
|
**
|
2010-12-17 16:01:08 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-04-13 08:42:33 +02:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2011-04-13 08:42:33 +02:00
|
|
|
** Other Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
|
**
|
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-11-26 14:43:27 +01:00
|
|
|
class GenericBuildConfiguration;
|
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:
|
2010-07-16 14:00:41 +02:00
|
|
|
GenericMakeStep(ProjectExplorer::BuildStepList *parent);
|
2012-08-14 15:37:38 +02:00
|
|
|
~GenericMakeStep();
|
2010-01-14 17:41:29 +01:00
|
|
|
|
2009-11-26 14:43:27 +01:00
|
|
|
GenericBuildConfiguration *genericBuildConfiguration() const;
|
|
|
|
|
|
2012-08-14 15:37:38 +02:00
|
|
|
bool init();
|
|
|
|
|
void run(QFutureInterface<bool> &fi);
|
2009-03-10 14:20:07 +01:00
|
|
|
|
2012-08-14 15:37:38 +02:00
|
|
|
ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
|
|
|
|
|
bool immutable() const;
|
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;
|
2009-10-27 14:16:28 +01:00
|
|
|
QString makeCommand() const;
|
2009-10-15 19:06:51 +02:00
|
|
|
|
2011-11-08 19:28:05 +01:00
|
|
|
void setClean(bool clean);
|
|
|
|
|
bool isClean() const;
|
|
|
|
|
|
2010-01-14 17:41:29 +01:00
|
|
|
QVariantMap toMap() const;
|
|
|
|
|
|
|
|
|
|
protected:
|
2010-07-16 14:00:41 +02:00
|
|
|
GenericMakeStep(ProjectExplorer::BuildStepList *parent, GenericMakeStep *bs);
|
2012-03-15 17:17:40 +01:00
|
|
|
GenericMakeStep(ProjectExplorer::BuildStepList *parent, const Core::Id id);
|
2012-08-14 15:37:38 +02:00
|
|
|
bool fromMap(const QVariantMap &map);
|
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
|
|
|
|
|
|
|
|
bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const;
|
|
|
|
|
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
|
|
|
|
|
bool canClone(ProjectExplorer::BuildStepList *parent,
|
|
|
|
|
ProjectExplorer::BuildStep *source) const;
|
|
|
|
|
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent,
|
|
|
|
|
ProjectExplorer::BuildStep *source);
|
|
|
|
|
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
|
|
|
|
|
ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent,
|
|
|
|
|
const QVariantMap &map);
|
|
|
|
|
|
|
|
|
|
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const;
|
|
|
|
|
QString displayNameForId(const Core::Id id) const;
|
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
|