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