Commit ee4a04a2 authored by Tobias Hunger's avatar Tobias Hunger

Refactor deployment

 * Add a DeployConfiguration class to hold settings related
   to deployment.
 * Add BuildStepsList to hold a list of buildsteps
 * Update BuildConfiguration to use BuildStepLists instead of
   manageing lists of buildsteps itself.
 * Update BuildManager to use BuildStepLists in its interfaces
 * Fix fallout introduced by API changes
 * Update .user file to new way of storing settings

Task-number: QTCREATORBUG-1427
Task-number: QTCREATORBUG-1428
Task-number: QTCREATORBUG-1811
Task-number: QTCREATORBUG-1930
parent cc93a08b
......@@ -34,6 +34,7 @@
#include "cmaketarget.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/buildsteplist.h>
#include <utils/qtcassert.h>
#include <QtGui/QInputDialog>
......@@ -61,6 +62,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(CMakeTarget *parent, CMakeBuild
m_buildDirectory(source->m_buildDirectory),
m_msvcVersion(source->m_msvcVersion)
{
Q_ASSERT(parent);
cloneSteps(source);
}
......@@ -217,11 +219,14 @@ CMakeBuildConfiguration *CMakeBuildConfigurationFactory::create(ProjectExplorer:
CMakeBuildConfiguration *bc = new CMakeBuildConfiguration(cmtarget);
bc->setDisplayName(buildConfigurationName);
MakeStep *makeStep = new MakeStep(bc);
bc->insertStep(ProjectExplorer::BuildStep::Build, 0, makeStep);
ProjectExplorer::BuildStepList *buildSteps = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
ProjectExplorer::BuildStepList *cleanSteps = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN);
MakeStep *cleanMakeStep = new MakeStep(bc);
bc->insertStep(ProjectExplorer::BuildStep::Clean, 0, cleanMakeStep);
MakeStep *makeStep = new MakeStep(buildSteps);
buildSteps->insertStep(0, makeStep);
MakeStep *cleanMakeStep = new MakeStep(cleanSteps);
cleanSteps->insertStep(0, cleanMakeStep);
cleanMakeStep->setAdditionalArguments(QStringList() << "clean");
cleanMakeStep->setClean(true);
......
......@@ -38,6 +38,7 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/buildenvironmentwidget.h>
#include <projectexplorer/buildsteplist.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/qtcassert.h>
......@@ -410,7 +411,7 @@ QString CMakeProject::displayName() const
QString CMakeProject::id() const
{
return QLatin1String("CMakeProjectManager.CMakeProject");
return QLatin1String(Constants::CMAKEPROJECT_ID);
}
Core::IFile *CMakeProject::file() const
......@@ -521,7 +522,7 @@ bool CMakeProject::fromMap(const QVariantMap &map)
if (!hasUserFile && hasBuildTarget("all")) {
MakeStep *makeStep = qobject_cast<MakeStep *>(
activeTarget()->activeBuildConfiguration()->steps(ProjectExplorer::BuildStep::Build).at(0));
activeTarget()->activeBuildConfiguration()->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD)->at(0));
Q_ASSERT(makeStep);
makeStep->setBuildTarget("all", true);
}
......
......@@ -38,6 +38,10 @@ const char * const CMAKEMIMETYPE = "text/x-cmake"; // TOOD check that this is c
const char * const CMAKE_EDITOR_ID = "CMakeProject.CMakeEditor";
const char * const CMAKE_EDITOR_DISPLAY_NAME = "CMake Editor";
const char * const C_CMAKEEDITOR = "CMakeProject.Context.CMakeEditor";
// Project
const char * const CMAKEPROJECT_ID = "CMakeProjectManager.CMakeProject";
} // namespace Constants
} // namespace CMakeProjectManager
......
......@@ -34,7 +34,10 @@
#include "cmakerunconfiguration.h"
#include "cmakebuildconfiguration.h"
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/deployconfiguration.h>
#include <projectexplorer/customexecutablerunconfiguration.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <QtGui/QApplication>
#include <QtGui/QStyle>
......@@ -58,7 +61,8 @@ QString displayNameForId(const QString &id) {
CMakeTarget::CMakeTarget(CMakeProject *parent) :
ProjectExplorer::Target(parent, QLatin1String(DEFAULT_CMAKE_TARGET_ID)),
m_buildConfigurationFactory(new CMakeBuildConfigurationFactory(this))
m_buildConfigurationFactory(new CMakeBuildConfigurationFactory(this)),
m_deployConfigurationFactory(new ProjectExplorer::DeployConfigurationFactory(this))
{
setDisplayName(displayNameForId(id()));
setIcon(qApp->style()->standardIcon(QStyle::SP_ComputerIcon));
......@@ -81,7 +85,12 @@ CMakeBuildConfiguration *CMakeTarget::activeBuildConfiguration() const
CMakeBuildConfigurationFactory *CMakeTarget::buildConfigurationFactory() const
{
return m_buildConfigurationFactory;
return m_buildConfigurationFactory;
}
ProjectExplorer::DeployConfigurationFactory *CMakeTarget::deployConfigurationFactory() const
{
return m_deployConfigurationFactory;
}
QString CMakeTarget::defaultBuildDirectory() const
......@@ -187,16 +196,21 @@ CMakeTarget *CMakeTargetFactory::create(ProjectExplorer::Project *parent, const
CMakeBuildConfiguration *bc(new CMakeBuildConfiguration(t));
bc->setDisplayName("all");
ProjectExplorer::BuildStepList *buildSteps = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
ProjectExplorer::BuildStepList *cleanSteps = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN);
// Now create a standard build configuration
bc->insertStep(ProjectExplorer::BuildStep::Build, 0, new MakeStep(bc));
buildSteps->insertStep(0, new MakeStep(buildSteps));
MakeStep *cleanMakeStep = new MakeStep(bc);
bc->insertStep(ProjectExplorer::BuildStep::Clean, 0, cleanMakeStep);
MakeStep *cleanMakeStep = new MakeStep(cleanSteps);
cleanSteps->insertStep(0, cleanMakeStep);
cleanMakeStep->setAdditionalArguments(QStringList() << "clean");
cleanMakeStep->setClean(true);
t->addBuildConfiguration(bc);
t->addDeployConfiguration(t->deployConfigurationFactory()->create(t, ProjectExplorer::Constants::DEFAULT_DEPLOYCONFIGURATION_ID));
t->updateRunConfigurations();
return t;
......
......@@ -58,6 +58,7 @@ public:
CMakeBuildConfiguration *activeBuildConfiguration() const;
CMakeBuildConfigurationFactory *buildConfigurationFactory() const;
ProjectExplorer::DeployConfigurationFactory *deployConfigurationFactory() const;
QString defaultBuildDirectory() const;
......@@ -69,6 +70,7 @@ private slots:
private:
CMakeBuildConfigurationFactory *m_buildConfigurationFactory;
ProjectExplorer::DeployConfigurationFactory *m_deployConfigurationFactory;
};
class CMakeTargetFactory : public ProjectExplorer::ITargetFactory
......
......@@ -34,6 +34,7 @@
#include "cmaketarget.h"
#include "cmakebuildconfiguration.h"
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/gnumakeparser.h>
......@@ -57,22 +58,22 @@ const char * const ADDITIONAL_ARGUMENTS_KEY("CMakeProjectManager.MakeStep.Additi
// TODO: Move progress information into an IOutputParser!
MakeStep::MakeStep(BuildConfiguration *bc) :
AbstractProcessStep(bc, QLatin1String(MS_ID)), m_clean(false),
MakeStep::MakeStep(BuildStepList *bsl) :
AbstractProcessStep(bsl, QLatin1String(MS_ID)), m_clean(false),
m_futureInterface(0)
{
ctor();
}
MakeStep::MakeStep(BuildConfiguration *bc, const QString &id) :
AbstractProcessStep(bc, id), m_clean(false),
MakeStep::MakeStep(BuildStepList *bsl, const QString &id) :
AbstractProcessStep(bsl, id), m_clean(false),
m_futureInterface(0)
{
ctor();
}
MakeStep::MakeStep(BuildConfiguration *bc, MakeStep *bs) :
AbstractProcessStep(bc, bs),
MakeStep::MakeStep(BuildStepList *bsl, MakeStep *bs) :
AbstractProcessStep(bsl, bs),
m_clean(bs->m_clean),
m_futureInterface(0),
m_buildTargets(bs->m_buildTargets),
......@@ -317,42 +318,41 @@ MakeStepFactory::~MakeStepFactory()
{
}
bool MakeStepFactory::canCreate(BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, const QString &id) const
bool MakeStepFactory::canCreate(BuildStepList *parent, const QString &id) const
{
Q_UNUSED(type)
if (!qobject_cast<CMakeBuildConfiguration *>(parent))
if (parent->target()->project()->id() != QLatin1String(Constants::CMAKEPROJECT_ID))
return false;
return QLatin1String(MS_ID) == id;
}
BuildStep *MakeStepFactory::create(BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, const QString &id)
BuildStep *MakeStepFactory::create(BuildStepList *parent, const QString &id)
{
if (!canCreate(parent, type, id))
if (!canCreate(parent, id))
return 0;
return new MakeStep(parent);
}
bool MakeStepFactory::canClone(BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, BuildStep *source) const
bool MakeStepFactory::canClone(BuildStepList *parent, BuildStep *source) const
{
return canCreate(parent, type, source->id());
return canCreate(parent, source->id());
}
BuildStep *MakeStepFactory::clone(BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, BuildStep *source)
BuildStep *MakeStepFactory::clone(BuildStepList *parent, BuildStep *source)
{
if (!canClone(parent, type, source))
if (!canClone(parent, source))
return 0;
return new MakeStep(parent, static_cast<MakeStep *>(source));
}
bool MakeStepFactory::canRestore(BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, const QVariantMap &map) const
bool MakeStepFactory::canRestore(BuildStepList *parent, const QVariantMap &map) const
{
QString id(ProjectExplorer::idFromMap(map));
return canCreate(parent, type, id);
return canCreate(parent, id);
}
BuildStep *MakeStepFactory::restore(BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, const QVariantMap &map)
BuildStep *MakeStepFactory::restore(BuildStepList *parent, const QVariantMap &map)
{
if (!canRestore(parent, type, map))
if (!canRestore(parent, map))
return 0;
MakeStep *bs(new MakeStep(parent));
if (bs->fromMap(map))
......@@ -361,12 +361,11 @@ BuildStep *MakeStepFactory::restore(BuildConfiguration *parent, ProjectExplorer:
return 0;
}
QStringList MakeStepFactory::availableCreationIds(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type) const
QStringList MakeStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const
{
Q_UNUSED(type)
if (!qobject_cast<CMakeBuildConfiguration *>(parent))
return QStringList();
return QStringList() << QLatin1String(MS_ID);
if (parent->target()->project()->id() == QLatin1String(Constants::CMAKEPROJECT_ID))
return QStringList() << QLatin1String(MS_ID);
return QStringList();
}
QString MakeStepFactory::displayNameForId(const QString &id) const
......
......@@ -52,7 +52,7 @@ class MakeStep : public ProjectExplorer::AbstractProcessStep
// This is for modifying internal data
public:
MakeStep(ProjectExplorer::BuildConfiguration *bc);
MakeStep(ProjectExplorer::BuildStepList *bsl);
virtual ~MakeStep();
CMakeBuildConfiguration *cmakeBuildConfiguration() const;
......@@ -73,8 +73,8 @@ public:
QVariantMap toMap() const;
protected:
MakeStep(ProjectExplorer::BuildConfiguration *bc, MakeStep *bs);
MakeStep(ProjectExplorer::BuildConfiguration *bc, const QString &id);
MakeStep(ProjectExplorer::BuildStepList *bsl, MakeStep *bs);
MakeStep(ProjectExplorer::BuildStepList *bsl, const QString &id);
bool fromMap(const QVariantMap &map);
......@@ -119,14 +119,14 @@ public:
explicit MakeStepFactory(QObject *parent = 0);
virtual ~MakeStepFactory();
virtual bool canCreate(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, const QString &id) const;
virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, const QString &id);
virtual bool canClone(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, ProjectExplorer::BuildStep *source) const;
virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, ProjectExplorer::BuildStep *source);
virtual bool canRestore(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, const QVariantMap &map) const;
virtual ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildConfiguration *parent, ProjectExplorer::BuildStep::Type type, const QVariantMap &map);
virtual bool canCreate(ProjectExplorer::BuildStepList *parent, const QString &id) const;
virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const QString &id);
virtual bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const;
virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source);
virtual bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
virtual ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
virtual QStringList availableCreationIds(ProjectExplorer::BuildConfiguration *bc, ProjectExplorer::BuildStep::Type type) const;
virtual QStringList availableCreationIds(ProjectExplorer::BuildStepList *bc) const;
virtual QString displayNameForId(const QString &id) const;
};
......
......@@ -33,6 +33,8 @@
#include "genericproject.h"
#include "generictarget.h"
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <utils/qtcassert.h>
#include <QtGui/QInputDialog>
......@@ -182,8 +184,10 @@ BuildConfiguration *GenericBuildConfigurationFactory::create(ProjectExplorer::Ta
GenericBuildConfiguration *bc = new GenericBuildConfiguration(target);
bc->setDisplayName(buildConfigurationName);
GenericMakeStep *makeStep = new GenericMakeStep(bc);
bc->insertStep(ProjectExplorer::BuildStep::Build, 0, makeStep);
ProjectExplorer::BuildStepList *buildSteps = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
Q_ASSERT(buildSteps);
GenericMakeStep *makeStep = new GenericMakeStep(buildSteps);
buildSteps->insertStep(0, makeStep);
makeStep->setBuildTarget("all", /* on = */ true);
target->addBuildConfiguration(bc); // also makes the name unique...
......
......@@ -35,6 +35,7 @@
#include "genericbuildconfiguration.h"
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/gnumakeparser.h>
......@@ -60,20 +61,20 @@ const char * const MAKE_ARGUMENTS_KEY("GenericProjectManager.GenericMakeStep.Mak
const char * const MAKE_COMMAND_KEY("GenericProjectManager.GenericMakeStep.MakeCommand");
}
GenericMakeStep::GenericMakeStep(ProjectExplorer::BuildConfiguration *bc) :
AbstractProcessStep(bc, QLatin1String(GENERIC_MS_ID))
GenericMakeStep::GenericMakeStep(ProjectExplorer::BuildStepList *parent) :
AbstractProcessStep(parent, QLatin1String(GENERIC_MS_ID))
{
ctor();
}
GenericMakeStep::GenericMakeStep(ProjectExplorer::BuildConfiguration *bc, const QString &id) :
AbstractProcessStep(bc, id)
GenericMakeStep::GenericMakeStep(ProjectExplorer::BuildStepList *parent, const QString &id) :
AbstractProcessStep(parent, id)
{
ctor();
}
GenericMakeStep::GenericMakeStep(ProjectExplorer::BuildConfiguration *bc, GenericMakeStep *bs) :
AbstractProcessStep(bc, bs),
GenericMakeStep::GenericMakeStep(ProjectExplorer::BuildStepList *parent, GenericMakeStep *bs) :
AbstractProcessStep(parent, bs),
m_buildTargets(bs->m_buildTargets),
m_makeArguments(bs->m_makeArguments),
m_makeCommand(bs->m_makeCommand)
......@@ -307,57 +308,50 @@ GenericMakeStepFactory::~GenericMakeStepFactory()
{
}
bool GenericMakeStepFactory::canCreate(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::BuildStep::Type type,
bool GenericMakeStepFactory::canCreate(ProjectExplorer::BuildStepList *parent,
const QString &id) const
{
Q_UNUSED(type)
if (!qobject_cast<GenericBuildConfiguration *>(parent))
if (parent->target()->project()->id() != QLatin1String(Constants::GENERICPROJECT_ID))
return false;
return id == QLatin1String(GENERIC_MS_ID);
}
ProjectExplorer::BuildStep *GenericMakeStepFactory::create(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::BuildStep::Type type,
ProjectExplorer::BuildStep *GenericMakeStepFactory::create(ProjectExplorer::BuildStepList *parent,
const QString &id)
{
if (!canCreate(parent, type, id))
if (!canCreate(parent, id))
return 0;
return new GenericMakeStep(parent);
}
bool GenericMakeStepFactory::canClone(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::BuildStep::Type type,
bool GenericMakeStepFactory::canClone(ProjectExplorer::BuildStepList *parent,
ProjectExplorer::BuildStep *source) const
{
const QString id(source->id());
return canCreate(parent, type, id);
return canCreate(parent, id);
}
ProjectExplorer::BuildStep *GenericMakeStepFactory::clone(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::BuildStep::Type type,
ProjectExplorer::BuildStep *GenericMakeStepFactory::clone(ProjectExplorer::BuildStepList *parent,
ProjectExplorer::BuildStep *source)
{
if (!canClone(parent, type, source))
if (!canClone(parent, source))
return 0;
GenericMakeStep *old(qobject_cast<GenericMakeStep *>(source));
Q_ASSERT(old);
return new GenericMakeStep(parent, old);
}
bool GenericMakeStepFactory::canRestore(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::BuildStep::Type type,
bool GenericMakeStepFactory::canRestore(ProjectExplorer::BuildStepList *parent,
const QVariantMap &map) const
{
QString id(ProjectExplorer::idFromMap(map));
return canCreate(parent, type, id);
return canCreate(parent, id);
}
ProjectExplorer::BuildStep *GenericMakeStepFactory::restore(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::BuildStep::Type type,
ProjectExplorer::BuildStep *GenericMakeStepFactory::restore(ProjectExplorer::BuildStepList *parent,
const QVariantMap &map)
{
if (!canRestore(parent, type, map))
if (!canRestore(parent, map))
return 0;
GenericMakeStep *bs(new GenericMakeStep(parent));
if (bs->fromMap(map))
......@@ -366,11 +360,9 @@ ProjectExplorer::BuildStep *GenericMakeStepFactory::restore(ProjectExplorer::Bui
return 0;
}
QStringList GenericMakeStepFactory::availableCreationIds(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::BuildStep::Type type) const
QStringList GenericMakeStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const
{
Q_UNUSED(type)
if (!qobject_cast<GenericBuildConfiguration *>(parent))
if (parent->target()->project()->id() != QLatin1String(Constants::GENERICPROJECT_ID))
return QStringList();
return QStringList() << QLatin1String(GENERIC_MS_ID);
}
......
......@@ -54,7 +54,7 @@ class GenericMakeStep : public ProjectExplorer::AbstractProcessStep
friend class GenericMakeStepFactory;
public:
GenericMakeStep(ProjectExplorer::BuildConfiguration *bc);
GenericMakeStep(ProjectExplorer::BuildStepList *parent);
virtual ~GenericMakeStep();
GenericBuildConfiguration *genericBuildConfiguration() const;
......@@ -73,8 +73,8 @@ public:
QVariantMap toMap() const;
protected:
GenericMakeStep(ProjectExplorer::BuildConfiguration *bc, GenericMakeStep *bs);
GenericMakeStep(ProjectExplorer::BuildConfiguration *bc, const QString &id);
GenericMakeStep(ProjectExplorer::BuildStepList *parent, GenericMakeStep *bs);
GenericMakeStep(ProjectExplorer::BuildStepList *parent, const QString &id);
virtual bool fromMap(const QVariantMap &map);
private:
......@@ -113,27 +113,20 @@ public:
explicit GenericMakeStepFactory(QObject *parent = 0);
virtual ~GenericMakeStepFactory();
virtual bool canCreate(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::BuildStep::Type type,
virtual bool canCreate(ProjectExplorer::BuildStepList *parent,
const QString &id) const;
virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::BuildStep::Type type,
virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent,
const QString &id);
virtual bool canClone(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::BuildStep::Type type,
virtual bool canClone(ProjectExplorer::BuildStepList *parent,
ProjectExplorer::BuildStep *source) const;
virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::BuildStep::Type type,
virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent,
ProjectExplorer::BuildStep *source);
virtual bool canRestore(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::BuildStep::Type type,
virtual bool canRestore(ProjectExplorer::BuildStepList *parent,
const QVariantMap &map) const;
virtual ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildConfiguration *parent,
ProjectExplorer::BuildStep::Type type,
virtual ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent,
const QVariantMap &map);
virtual QStringList availableCreationIds(ProjectExplorer::BuildConfiguration *bc,
ProjectExplorer::BuildStep::Type type) const;
virtual QStringList availableCreationIds(ProjectExplorer::BuildStepList *bc) const;
virtual QString displayNameForId(const QString &id) const;
};
......
......@@ -375,7 +375,7 @@ QString GenericProject::displayName() const
QString GenericProject::id() const
{
return QLatin1String("GenericProjectManager.GenericProject");
return QLatin1String(Constants::GENERICPROJECT_ID);
}
Core::IFile *GenericProject::file() const
......
......@@ -54,6 +54,9 @@ const char *const INCLUDES_MIMETYPE = "application/vnd.nokia.qt.generic.include
const char *const CONFIG_EDITOR = ".config Editor";
const char *const CONFIG_MIMETYPE = "application/vnd.nokia.qt.generic.config";
// Project
const char *const GENERICPROJECT_ID = "GenericProjectManager.GenericProject";
} // namespace Constants
} // namespace GenericProjectManager
......
......@@ -33,7 +33,10 @@
#include "genericproject.h"
#include "genericmakestep.h"
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/customexecutablerunconfiguration.h>
#include <projectexplorer/deployconfiguration.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <QtGui/QApplication>
#include <QtGui/QStyle>
......@@ -51,7 +54,8 @@ using namespace GenericProjectManager::Internal;
GenericTarget::GenericTarget(GenericProject *parent) :
ProjectExplorer::Target(parent, QLatin1String(GENERIC_DESKTOP_TARGET_ID)),
m_buildConfigurationFactory(new GenericBuildConfigurationFactory(this))
m_buildConfigurationFactory(new GenericBuildConfigurationFactory(this)),
m_deployConfigurationFactory(new ProjectExplorer::DeployConfigurationFactory(this))
{
setDisplayName(QApplication::translate("GenericProjectManager::GenericTarget",
GENERIC_DESKTOP_TARGET_DISPLAY_NAME,
......@@ -73,6 +77,11 @@ GenericBuildConfigurationFactory *GenericTarget::buildConfigurationFactory() con
return m_buildConfigurationFactory;
}
ProjectExplorer::DeployConfigurationFactory *GenericTarget::deployConfigurationFactory() const
{
return m_deployConfigurationFactory;
}
GenericBuildConfiguration *GenericTarget::activeBuildConfiguration() const
{
return static_cast<GenericBuildConfiguration *>(Target::activeBuildConfiguration());
......@@ -136,8 +145,9 @@ GenericTarget *GenericTargetFactory::create(ProjectExplorer::Project *parent, co
GenericBuildConfiguration *bc = new GenericBuildConfiguration(t);
bc->setDisplayName("all");
GenericMakeStep *makeStep = new GenericMakeStep(bc);
bc->insertStep(ProjectExplorer::BuildStep::Build, 0, makeStep);
ProjectExplorer::BuildStepList *buildSteps = bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
GenericMakeStep *makeStep = new GenericMakeStep(buildSteps);
buildSteps->insertStep(0, makeStep);
makeStep->setBuildTarget("all", /* on = */ true);
......@@ -145,6 +155,8 @@ GenericTarget *GenericTargetFactory::create(ProjectExplorer::Project *parent, co
t->addBuildConfiguration(bc);
t->addDeployConfiguration(t->deployConfigurationFactory()->create(t, ProjectExplorer::Constants::DEFAULT_DEPLOYCONFIGURATION_ID));
// Add a runconfiguration. The CustomExecutableRC one will query the user
// for its settings, so it is a good choice here.
t->addRunConfiguration(new ProjectExplorer::CustomExecutableRunConfiguration(t));
......
......@@ -64,6 +64,7 @@ public:
GenericProject *genericProject() const;
GenericBuildConfigurationFactory *buildConfigurationFactory() const;
ProjectExplorer::DeployConfigurationFactory *deployConfigurationFactory() const;
GenericBuildConfiguration *activeBuildConfiguration() const;