forked from qt-creator/qt-creator
Autotools: Use new setup scheme for build steps
Change-Id: I4c228a1324e5d426ea2c288f105df2c097a972c7 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <projectexplorer/abstractprocessstep.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/buildstep.h>
|
||||
#include <projectexplorer/processparameters.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
@@ -16,8 +17,6 @@
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
@@ -109,12 +108,21 @@ Tasking::GroupItem AutogenStep::runRecipe()
|
||||
* This factory is used to create instances of AutogenStep.
|
||||
*/
|
||||
|
||||
AutogenStepFactory::AutogenStepFactory()
|
||||
class AutogenStepFactory final : public BuildStepFactory
|
||||
{
|
||||
registerStep<AutogenStep>(Constants::AUTOGEN_STEP_ID);
|
||||
setDisplayName(Tr::tr("Autogen", "Display name for AutotoolsProjectManager::AutogenStep id."));
|
||||
setSupportedProjectType(Constants::AUTOTOOLS_PROJECT_ID);
|
||||
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
||||
public:
|
||||
AutogenStepFactory()
|
||||
{
|
||||
registerStep<AutogenStep>(Constants::AUTOGEN_STEP_ID);
|
||||
setDisplayName(Tr::tr("Autogen", "Display name for AutotoolsProjectManager::AutogenStep id."));
|
||||
setSupportedProjectType(Constants::AUTOTOOLS_PROJECT_ID);
|
||||
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
||||
}
|
||||
};
|
||||
|
||||
void setupAutogenStep()
|
||||
{
|
||||
static AutogenStepFactory theAutogenStepFactory;
|
||||
}
|
||||
|
||||
} // AutotoolsProjectManager::Internal
|
||||
|
@@ -3,14 +3,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <projectexplorer/buildstep.h>
|
||||
|
||||
namespace AutotoolsProjectManager::Internal {
|
||||
|
||||
class AutogenStepFactory final : public ProjectExplorer::BuildStepFactory
|
||||
{
|
||||
public:
|
||||
AutogenStepFactory();
|
||||
};
|
||||
void setupAutogenStep();
|
||||
|
||||
} // AutotoolsProjectManager::Internal
|
||||
|
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <projectexplorer/abstractprocessstep.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/buildstep.h>
|
||||
#include <projectexplorer/processparameters.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
@@ -99,12 +100,21 @@ private:
|
||||
* The factory is used to create instances of AutoreconfStep.
|
||||
*/
|
||||
|
||||
AutoreconfStepFactory::AutoreconfStepFactory()
|
||||
class AutoreconfStepFactory final : public ProjectExplorer::BuildStepFactory
|
||||
{
|
||||
registerStep<AutoreconfStep>(Constants::AUTORECONF_STEP_ID);
|
||||
setDisplayName(Tr::tr("Autoreconf", "Display name for AutotoolsProjectManager::AutoreconfStep id."));
|
||||
setSupportedProjectType(Constants::AUTOTOOLS_PROJECT_ID);
|
||||
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
||||
public:
|
||||
AutoreconfStepFactory()
|
||||
{
|
||||
registerStep<AutoreconfStep>(Constants::AUTORECONF_STEP_ID);
|
||||
setDisplayName(Tr::tr("Autoreconf", "Display name for AutotoolsProjectManager::AutoreconfStep id."));
|
||||
setSupportedProjectType(Constants::AUTOTOOLS_PROJECT_ID);
|
||||
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
||||
}
|
||||
};
|
||||
|
||||
void setupAutoreconfStep()
|
||||
{
|
||||
static AutoreconfStepFactory theAutoreconfStepFactory;
|
||||
}
|
||||
|
||||
} // AutotoolsProjectManager::Internal
|
||||
|
@@ -3,14 +3,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <projectexplorer/buildstep.h>
|
||||
|
||||
namespace AutotoolsProjectManager::Internal {
|
||||
|
||||
class AutoreconfStepFactory final : public ProjectExplorer::BuildStepFactory
|
||||
{
|
||||
public:
|
||||
AutoreconfStepFactory();
|
||||
};
|
||||
void setupAutoreconfStep();
|
||||
|
||||
} // AutotoolsProjectManager::Internal
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#include "autotoolsprojectmanagertr.h"
|
||||
|
||||
#include <projectexplorer/buildinfo.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
@@ -22,7 +23,7 @@ namespace AutotoolsProjectManager::Internal {
|
||||
|
||||
// AutotoolsBuildConfiguration
|
||||
|
||||
class AutotoolsBuildConfiguration : public BuildConfiguration
|
||||
class AutotoolsBuildConfiguration final : public BuildConfiguration
|
||||
{
|
||||
public:
|
||||
AutotoolsBuildConfiguration(Target *target, Id id)
|
||||
@@ -49,25 +50,34 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
AutotoolsBuildConfigurationFactory::AutotoolsBuildConfigurationFactory()
|
||||
class AutotoolsBuildConfigurationFactory final : public BuildConfigurationFactory
|
||||
{
|
||||
registerBuildConfiguration<AutotoolsBuildConfiguration>
|
||||
("AutotoolsProjectManager.AutotoolsBuildConfiguration");
|
||||
public:
|
||||
AutotoolsBuildConfigurationFactory()
|
||||
{
|
||||
registerBuildConfiguration<AutotoolsBuildConfiguration>
|
||||
("AutotoolsProjectManager.AutotoolsBuildConfiguration");
|
||||
|
||||
setSupportedProjectType(Constants::AUTOTOOLS_PROJECT_ID);
|
||||
setSupportedProjectMimeTypeName(Utils::Constants::MAKEFILE_MIMETYPE);
|
||||
setSupportedProjectType(Constants::AUTOTOOLS_PROJECT_ID);
|
||||
setSupportedProjectMimeTypeName(Utils::Constants::MAKEFILE_MIMETYPE);
|
||||
|
||||
setBuildGenerator([](const Kit *, const FilePath &projectPath, bool forSetup) {
|
||||
BuildInfo info;
|
||||
info.typeName = ::ProjectExplorer::Tr::tr("Build");
|
||||
info.buildDirectory = forSetup
|
||||
? FilePath::fromString(projectPath.toFileInfo().absolutePath()) : projectPath;
|
||||
if (forSetup) {
|
||||
//: The name of the build configuration created by default for a autotools project.
|
||||
info.displayName = ::ProjectExplorer::Tr::tr("Default");
|
||||
}
|
||||
return QList<BuildInfo>{info};
|
||||
});
|
||||
setBuildGenerator([](const Kit *, const FilePath &projectPath, bool forSetup) {
|
||||
BuildInfo info;
|
||||
info.typeName = ::ProjectExplorer::Tr::tr("Build");
|
||||
info.buildDirectory = forSetup
|
||||
? FilePath::fromString(projectPath.toFileInfo().absolutePath()) : projectPath;
|
||||
if (forSetup) {
|
||||
//: The name of the build configuration created by default for a autotools project.
|
||||
info.displayName = ::ProjectExplorer::Tr::tr("Default");
|
||||
}
|
||||
return QList<BuildInfo>{info};
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
void setupAutotoolsBuildConfiguration()
|
||||
{
|
||||
static AutotoolsBuildConfigurationFactory theAutotoolsBuildConfigurationFactory;
|
||||
}
|
||||
|
||||
} // AutotoolsProjectManager::Internal
|
||||
|
@@ -3,14 +3,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
|
||||
namespace AutotoolsProjectManager::Internal {
|
||||
|
||||
class AutotoolsBuildConfigurationFactory final : public ProjectExplorer::BuildConfigurationFactory
|
||||
{
|
||||
public:
|
||||
AutotoolsBuildConfigurationFactory();
|
||||
};
|
||||
void setupAutotoolsBuildConfiguration();
|
||||
|
||||
} // AutotoolsProjectManager::Internal
|
||||
|
@@ -69,23 +69,11 @@ public:
|
||||
* - MakefileEditorFactory: Provides a specialized editor with automatic
|
||||
* syntax highlighting for Makefile.am files.
|
||||
*
|
||||
* - AutotoolsTargetFactory: Our current target is desktop.
|
||||
*
|
||||
* - AutotoolsBuildConfigurationFactory: Creates build configurations that
|
||||
* contain the steps (make, autogen, autoreconf or configure) that will
|
||||
* be executed in the build process)
|
||||
*/
|
||||
|
||||
class AutotoolsProjectPluginPrivate
|
||||
{
|
||||
public:
|
||||
AutotoolsBuildConfigurationFactory buildConfigFactory;
|
||||
MakeStepFactory makeStepFactory;
|
||||
AutogenStepFactory autogenStepFactory;
|
||||
ConfigureStepFactory configureStepFactory;
|
||||
AutoreconfStepFactory autoreconfStepFactory;
|
||||
};
|
||||
|
||||
class AutotoolsProjectPlugin final : public ExtensionSystem::IPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -94,10 +82,13 @@ class AutotoolsProjectPlugin final : public ExtensionSystem::IPlugin
|
||||
void initialize() final
|
||||
{
|
||||
ProjectManager::registerProjectType<AutotoolsProject>(Utils::Constants::MAKEFILE_MIMETYPE);
|
||||
d = std::make_unique<AutotoolsProjectPluginPrivate>();
|
||||
}
|
||||
|
||||
std::unique_ptr<AutotoolsProjectPluginPrivate> d;
|
||||
setupAutogenStep();
|
||||
setupConfigureStep();
|
||||
setupAutoreconfStep();
|
||||
setupAutotoolsMakeStep();
|
||||
setupAutotoolsBuildConfiguration();
|
||||
}
|
||||
};
|
||||
|
||||
} // AutotoolsProjectManager::Internal
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#include "autotoolsprojectmanagertr.h"
|
||||
|
||||
#include <projectexplorer/abstractprocessstep.h>
|
||||
#include <projectexplorer/buildstep.h>
|
||||
#include <projectexplorer/processparameters.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
@@ -15,8 +16,6 @@
|
||||
#include <utils/aspects.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
@@ -111,12 +110,21 @@ Tasking::GroupItem ConfigureStep::runRecipe()
|
||||
* The factory is used to create instances of ConfigureStep.
|
||||
*/
|
||||
|
||||
ConfigureStepFactory::ConfigureStepFactory()
|
||||
class ConfigureStepFactory final : public BuildStepFactory
|
||||
{
|
||||
registerStep<ConfigureStep>(Constants::CONFIGURE_STEP_ID);
|
||||
setDisplayName(Tr::tr("Configure", "Display name for AutotoolsProjectManager::ConfigureStep id."));
|
||||
setSupportedProjectType(Constants::AUTOTOOLS_PROJECT_ID);
|
||||
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
||||
public:
|
||||
ConfigureStepFactory()
|
||||
{
|
||||
registerStep<ConfigureStep>(Constants::CONFIGURE_STEP_ID);
|
||||
setDisplayName(Tr::tr("Configure", "Display name for AutotoolsProjectManager::ConfigureStep id."));
|
||||
setSupportedProjectType(Constants::AUTOTOOLS_PROJECT_ID);
|
||||
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
||||
}
|
||||
};
|
||||
|
||||
void setupConfigureStep()
|
||||
{
|
||||
static ConfigureStepFactory theConfigureStepFactory;
|
||||
}
|
||||
|
||||
} // AutotoolsProjectManager::Internal
|
||||
|
@@ -3,14 +3,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <projectexplorer/buildstep.h>
|
||||
|
||||
namespace AutotoolsProjectManager::Internal {
|
||||
|
||||
class ConfigureStepFactory final : public ProjectExplorer::BuildStepFactory
|
||||
{
|
||||
public:
|
||||
ConfigureStepFactory();
|
||||
};
|
||||
void setupConfigureStep();
|
||||
|
||||
} // AutotoolsProjectManager::Internal
|
||||
|
@@ -5,17 +5,20 @@
|
||||
#include "autotoolsprojectconstants.h"
|
||||
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/makestep.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace AutotoolsProjectManager::Internal {
|
||||
|
||||
// MakeStep
|
||||
|
||||
class MakeStep : public ProjectExplorer::MakeStep
|
||||
class AutotoolsMakeStep final : public MakeStep
|
||||
{
|
||||
public:
|
||||
MakeStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id)
|
||||
: ProjectExplorer::MakeStep(bsl, id)
|
||||
AutotoolsMakeStep(BuildStepList *bsl, Utils::Id id)
|
||||
: MakeStep(bsl, id)
|
||||
{
|
||||
setAvailableBuildTargets({"all", "clean"});
|
||||
if (bsl->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) {
|
||||
@@ -29,11 +32,20 @@ public:
|
||||
|
||||
// MakeStepFactory
|
||||
|
||||
MakeStepFactory::MakeStepFactory()
|
||||
class MakeStepFactory final : public BuildStepFactory
|
||||
{
|
||||
registerStep<MakeStep>(Constants::MAKE_STEP_ID);
|
||||
setDisplayName(ProjectExplorer::MakeStep::defaultDisplayName());
|
||||
setSupportedProjectType(Constants::AUTOTOOLS_PROJECT_ID);
|
||||
public:
|
||||
MakeStepFactory()
|
||||
{
|
||||
registerStep<AutotoolsMakeStep>(Constants::MAKE_STEP_ID);
|
||||
setDisplayName(ProjectExplorer::MakeStep::defaultDisplayName());
|
||||
setSupportedProjectType(Constants::AUTOTOOLS_PROJECT_ID);
|
||||
}
|
||||
};
|
||||
|
||||
void setupAutotoolsMakeStep()
|
||||
{
|
||||
static MakeStepFactory theAutotoolsMakestepFactory;
|
||||
}
|
||||
|
||||
} // AutotoolsProjectManager::Internal
|
||||
|
@@ -3,14 +3,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <projectexplorer/makestep.h>
|
||||
|
||||
namespace AutotoolsProjectManager::Internal {
|
||||
|
||||
class MakeStepFactory final : public ProjectExplorer::BuildStepFactory
|
||||
{
|
||||
public:
|
||||
MakeStepFactory();
|
||||
};
|
||||
void setupAutotoolsMakeStep();
|
||||
|
||||
} // AutotoolsProjectManager::Internal
|
||||
|
Reference in New Issue
Block a user