2009-02-25 09:15:00 +01:00
|
|
|
/**************************************************************************
|
2008-12-02 12:01:29 +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).
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-07-19 12:26:56 +02:00
|
|
|
** Contact: http://www.qt-project.org/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
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.
|
2008-12-02 14:17:16 +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.
|
|
|
|
|
**
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
**************************************************************************/
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#ifndef MAKESTEP_H
|
|
|
|
|
#define MAKESTEP_H
|
|
|
|
|
|
2011-07-21 15:05:52 +02:00
|
|
|
#include "qt4projectmanager_global.h"
|
|
|
|
|
|
2009-12-09 13:54:46 +01:00
|
|
|
#include <projectexplorer/abstractprocessstep.h>
|
2010-03-17 17:45:33 +01:00
|
|
|
#include <projectexplorer/buildstep.h>
|
2011-03-24 12:43:45 +01:00
|
|
|
#include <projectexplorer/task.h>
|
2010-03-17 17:45:33 +01:00
|
|
|
|
2009-04-20 16:25:48 +02:00
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
class BuildStep;
|
|
|
|
|
class IBuildStepFactory;
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
namespace Qt4ProjectManager {
|
2011-11-24 13:00:01 +01:00
|
|
|
|
2009-11-26 14:43:27 +01:00
|
|
|
class Qt4BuildConfiguration;
|
2012-05-16 11:48:23 +02:00
|
|
|
class MakeStepConfigWidget;
|
2009-11-26 14:43:27 +01:00
|
|
|
|
2010-12-06 13:29:18 +01:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2011-11-24 13:00:01 +01:00
|
|
|
namespace Ui { class MakeStep; }
|
|
|
|
|
|
2011-08-30 16:53:03 +02:00
|
|
|
class MakeStepFactory : public ProjectExplorer::IBuildStepFactory
|
2009-04-20 16:25:48 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2010-01-14 17:41:29 +01:00
|
|
|
|
2009-04-20 16:25:48 +02:00
|
|
|
public:
|
2010-01-14 17:41:29 +01:00
|
|
|
explicit MakeStepFactory(QObject *parent = 0);
|
2009-04-20 16:25:48 +02:00
|
|
|
virtual ~MakeStepFactory();
|
2010-01-14 17:41:29 +01:00
|
|
|
|
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);
|
2010-07-16 14:00:41 +02:00
|
|
|
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);
|
|
|
|
|
|
2012-03-15 17:17:40 +01:00
|
|
|
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
|
|
|
|
|
QString displayNameForId(const Core::Id id) const;
|
2009-04-20 16:25:48 +02:00
|
|
|
};
|
2009-11-26 14:43:27 +01:00
|
|
|
} //namespace Internal
|
2009-04-20 16:25:48 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
class Qt4Project;
|
|
|
|
|
|
2011-08-30 16:53:03 +02:00
|
|
|
class QT4PROJECTMANAGER_EXPORT MakeStep : public ProjectExplorer::AbstractProcessStep
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2010-01-14 17:41:29 +01:00
|
|
|
friend class Internal::MakeStepFactory;
|
2012-05-16 11:48:23 +02:00
|
|
|
friend class MakeStepConfigWidget;
|
2010-01-14 17:41:29 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
public:
|
2010-07-16 14:00:41 +02:00
|
|
|
explicit MakeStep(ProjectExplorer::BuildStepList *bsl);
|
2010-01-14 17:41:29 +01:00
|
|
|
virtual ~MakeStep();
|
2009-11-26 14:43:27 +01:00
|
|
|
|
2010-12-06 13:29:18 +01:00
|
|
|
Qt4BuildConfiguration *qt4BuildConfiguration() const;
|
2009-11-26 14:43:27 +01:00
|
|
|
|
2009-10-27 14:16:28 +01:00
|
|
|
virtual bool init();
|
2008-12-02 12:01:29 +01:00
|
|
|
virtual void run(QFutureInterface<bool> &);
|
2010-04-09 15:04:20 +02:00
|
|
|
bool processSucceeded(int exitCode, QProcess::ExitStatus status);
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
|
|
|
|
|
virtual bool immutable() const;
|
2010-10-19 11:14:03 +02:00
|
|
|
QString userArguments();
|
|
|
|
|
void setUserArguments(const QString &arguments);
|
2009-12-03 18:37:27 +01:00
|
|
|
void setClean(bool clean);
|
2011-03-14 14:39:02 +01:00
|
|
|
bool isClean() const;
|
2012-05-03 16:15:38 +02:00
|
|
|
QString makeCommand() const;
|
2009-10-15 19:06:51 +02:00
|
|
|
|
2010-01-14 17:41:29 +01:00
|
|
|
QVariantMap toMap() const;
|
2009-10-15 19:06:51 +02:00
|
|
|
|
2009-07-24 18:53:54 +02:00
|
|
|
signals:
|
2009-11-30 19:30:51 +01:00
|
|
|
void userArgumentsChanged();
|
2010-01-14 17:41:29 +01:00
|
|
|
|
|
|
|
|
protected:
|
2010-07-16 14:00:41 +02:00
|
|
|
MakeStep(ProjectExplorer::BuildStepList *bsl, MakeStep *bs);
|
2012-03-15 17:17:40 +01:00
|
|
|
MakeStep(ProjectExplorer::BuildStepList *bsl, const Core::Id id);
|
2010-01-14 17:41:29 +01:00
|
|
|
virtual bool fromMap(const QVariantMap &map);
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
private:
|
2010-01-14 17:41:29 +01:00
|
|
|
void ctor();
|
2012-05-16 11:48:23 +02:00
|
|
|
void setMakeCommand(const QString &make);
|
2009-10-15 19:06:51 +02:00
|
|
|
bool m_clean;
|
2012-01-12 15:00:21 +01:00
|
|
|
bool m_scriptTarget;
|
2011-03-25 17:20:27 +01:00
|
|
|
QString m_makeFileToCheck;
|
2010-10-19 11:14:03 +02:00
|
|
|
QString m_userArgs;
|
2009-10-27 14:16:28 +01:00
|
|
|
QString m_makeCmd;
|
2011-03-24 12:43:45 +01:00
|
|
|
QList<ProjectExplorer::Task> m_tasks;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class MakeStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2010-03-17 17:45:33 +01:00
|
|
|
explicit MakeStepConfigWidget(MakeStep *makeStep);
|
|
|
|
|
virtual ~MakeStepConfigWidget();
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
QString displayName() const;
|
2009-08-06 15:31:32 +02:00
|
|
|
QString summaryText() const;
|
2008-12-02 12:01:29 +01:00
|
|
|
private slots:
|
2009-12-03 18:37:27 +01:00
|
|
|
// User changes to our widgets
|
|
|
|
|
void makeEdited();
|
|
|
|
|
void makeArgumentsLineEdited();
|
|
|
|
|
|
2009-08-13 11:47:34 +02:00
|
|
|
void updateDetails();
|
2009-11-30 19:30:51 +01:00
|
|
|
void userArgumentsChanged();
|
2012-01-13 16:29:38 +01:00
|
|
|
void activeBuildConfigurationChanged();
|
2008-12-02 12:01:29 +01:00
|
|
|
private:
|
2012-04-24 15:49:09 +02:00
|
|
|
void setSummaryText(const QString &text);
|
|
|
|
|
|
2011-11-23 15:15:01 +00:00
|
|
|
Internal::Ui::MakeStep *m_ui;
|
2008-12-02 12:01:29 +01:00
|
|
|
MakeStep *m_makeStep;
|
2009-08-06 15:31:32 +02:00
|
|
|
QString m_summaryText;
|
2012-01-13 16:29:38 +01:00
|
|
|
ProjectExplorer::BuildConfiguration *m_bc;
|
2009-11-30 19:30:51 +01:00
|
|
|
bool m_ignoreChange;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // Qt4ProjectManager
|
|
|
|
|
|
|
|
|
|
#endif // MAKESTEP_H
|