forked from qt-creator/qt-creator
ProjectExplorer: Remove Task::buildConfigurationMissingTask()
It should not be possible to trigger the condition. Except for MakeStep the function is only called from real BuildSteps, that always live in a BuildConfiguration. A MakeStep could live in a DeployConfiguration, but that belongs to a Target. That target always has a BuildConfiguration in case the project type requires one. So not having a BuildConfiguration can only happen when the project type doesn't require one, but then the situation is not an error that should be notified as a Task. Change-Id: I2a5d90fdadd3916d3dae6a0fdc6e6ab2010a8111 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -131,15 +131,10 @@ bool CMakeBuildStep::fromMap(const QVariantMap &map)
|
|||||||
return BuildStep::fromMap(map);
|
return BuildStep::fromMap(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CMakeBuildStep::init()
|
bool CMakeBuildStep::init()
|
||||||
{
|
{
|
||||||
bool canInit = true;
|
bool canInit = true;
|
||||||
CMakeBuildConfiguration *bc = cmakeBuildConfiguration();
|
CMakeBuildConfiguration *bc = cmakeBuildConfiguration();
|
||||||
if (!bc) {
|
|
||||||
emit addTask(Task::buildConfigurationMissingTask());
|
|
||||||
canInit = false;
|
|
||||||
}
|
|
||||||
if (bc && !bc->isEnabled()) {
|
if (bc && !bc->isEnabled()) {
|
||||||
emit addTask(BuildSystemTask(Task::Error,
|
emit addTask(BuildSystemTask(Task::Error,
|
||||||
tr("CMakeProjectManager::CMakeBuildStep")));
|
tr("CMakeProjectManager::CMakeBuildStep")));
|
||||||
@@ -528,12 +523,6 @@ QRadioButton *CMakeBuildStepConfigWidget::itemWidget(QListWidgetItem *item)
|
|||||||
|
|
||||||
void CMakeBuildStepConfigWidget::updateDetails()
|
void CMakeBuildStepConfigWidget::updateDetails()
|
||||||
{
|
{
|
||||||
BuildConfiguration *bc = m_buildStep->buildConfiguration();
|
|
||||||
if (!bc) {
|
|
||||||
setSummaryText(tr("<b>No build configuration found on this kit.</b>"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ProcessParameters param;
|
ProcessParameters param;
|
||||||
param.setMacroExpander(m_buildStep->macroExpander());
|
param.setMacroExpander(m_buildStep->macroExpander());
|
||||||
param.setEnvironment(m_buildStep->buildEnvironment());
|
param.setEnvironment(m_buildStep->buildEnvironment());
|
||||||
|
@@ -175,8 +175,6 @@ IosBuildStep::IosBuildStep(BuildStepList *parent, Id id)
|
|||||||
bool IosBuildStep::init()
|
bool IosBuildStep::init()
|
||||||
{
|
{
|
||||||
BuildConfiguration *bc = buildConfiguration();
|
BuildConfiguration *bc = buildConfiguration();
|
||||||
if (!bc)
|
|
||||||
emit addTask(Task::buildConfigurationMissingTask());
|
|
||||||
|
|
||||||
ToolChain *tc = ToolChainKitAspect::cxxToolChain(target()->kit());
|
ToolChain *tc = ToolChainKitAspect::cxxToolChain(target()->kit());
|
||||||
if (!tc)
|
if (!tc)
|
||||||
|
@@ -81,15 +81,11 @@ void MakeStep::setAvailableBuildTargets(const QStringList &buildTargets)
|
|||||||
|
|
||||||
bool MakeStep::init()
|
bool MakeStep::init()
|
||||||
{
|
{
|
||||||
BuildConfiguration *bc = buildConfiguration();
|
|
||||||
if (!bc)
|
|
||||||
emit addTask(Task::buildConfigurationMissingTask());
|
|
||||||
|
|
||||||
const CommandLine make = effectiveMakeCommand(Execution);
|
const CommandLine make = effectiveMakeCommand(Execution);
|
||||||
if (make.executable().isEmpty())
|
if (make.executable().isEmpty())
|
||||||
emit addTask(makeCommandMissingTask());
|
emit addTask(makeCommandMissingTask());
|
||||||
|
|
||||||
if (!bc || make.executable().isEmpty()) {
|
if (make.executable().isEmpty()) {
|
||||||
emitFaultyConfigurationMessage();
|
emitFaultyConfigurationMessage();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -81,14 +81,6 @@ Task Task::compilerMissingTask()
|
|||||||
.arg(Core::Constants::IDE_DISPLAY_NAME));
|
.arg(Core::Constants::IDE_DISPLAY_NAME));
|
||||||
}
|
}
|
||||||
|
|
||||||
Task Task::buildConfigurationMissingTask()
|
|
||||||
{
|
|
||||||
return BuildSystemTask(Task::Error,
|
|
||||||
tr("%1 needs a build configuration set up to build. "
|
|
||||||
"Configure a build configuration in the project settings.")
|
|
||||||
.arg(Core::Constants::IDE_DISPLAY_NAME));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Task::setMark(TextEditor::TextMark *mark)
|
void Task::setMark(TextEditor::TextMark *mark)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(mark, return);
|
QTC_ASSERT(mark, return);
|
||||||
|
@@ -68,7 +68,6 @@ public:
|
|||||||
Options options = AddTextMark | FlashWorthy);
|
Options options = AddTextMark | FlashWorthy);
|
||||||
|
|
||||||
static Task compilerMissingTask();
|
static Task compilerMissingTask();
|
||||||
static Task buildConfigurationMissingTask();
|
|
||||||
|
|
||||||
bool isNull() const;
|
bool isNull() const;
|
||||||
void clear();
|
void clear();
|
||||||
|
@@ -65,8 +65,6 @@ QmakeMakeStep::QmakeMakeStep(BuildStepList *bsl, Core::Id id)
|
|||||||
bool QmakeMakeStep::init()
|
bool QmakeMakeStep::init()
|
||||||
{
|
{
|
||||||
const auto bc = static_cast<QmakeBuildConfiguration *>(buildConfiguration());
|
const auto bc = static_cast<QmakeBuildConfiguration *>(buildConfiguration());
|
||||||
if (!bc)
|
|
||||||
emit addTask(Task::buildConfigurationMissingTask());
|
|
||||||
|
|
||||||
const Utils::CommandLine unmodifiedMake = effectiveMakeCommand(Execution);
|
const Utils::CommandLine unmodifiedMake = effectiveMakeCommand(Execution);
|
||||||
const Utils::FilePath makeExecutable = unmodifiedMake.executable();
|
const Utils::FilePath makeExecutable = unmodifiedMake.executable();
|
||||||
|
Reference in New Issue
Block a user