Commit 63468357 authored by Tobias Hunger's avatar Tobias Hunger

BuildInfo: Add BuildConfiguration::BuildType

Remove QbsBuildInfo, which only adds the same information over
the normal BuildInfo.

Change QmakeBuildInfo to use the buildType as provided by
its base class.

Change-Id: Iddb86487c85893988f78bbfaf549823a19f13b5b
Reviewed-by: default avatarAlessandro Portale <alessandro.portale@theqtcompany.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent e4517a42
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "projectexplorer_export.h" #include "projectexplorer_export.h"
#include "buildconfiguration.h"
#include "task.h" #include "task.h"
#include <coreplugin/id.h> #include <coreplugin/id.h>
...@@ -54,6 +55,14 @@ public: ...@@ -54,6 +55,14 @@ public:
QString typeName; QString typeName;
Utils::FileName buildDirectory; Utils::FileName buildDirectory;
Core::Id kitId; Core::Id kitId;
BuildConfiguration::BuildType buildType = BuildConfiguration::Unknown;
bool operator==(const BuildInfo &o)
{
return displayName == o.displayName && typeName == o.typeName
&& buildDirectory == o.buildDirectory && kitId == o.kitId
&& buildType == o.buildType;
}
virtual QList<Task> reportIssues(const QString &projectPath, virtual QList<Task> reportIssues(const QString &projectPath,
const QString &buildDir) const const QString &buildDir) const
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "qbsbuildconfiguration.h" #include "qbsbuildconfiguration.h"
#include "qbsbuildconfigurationwidget.h" #include "qbsbuildconfigurationwidget.h"
#include "qbsbuildinfo.h"
#include "qbsbuildstep.h" #include "qbsbuildstep.h"
#include "qbscleanstep.h" #include "qbscleanstep.h"
#include "qbsinstallstep.h" #include "qbsinstallstep.h"
...@@ -41,6 +40,7 @@ ...@@ -41,6 +40,7 @@
#include <coreplugin/documentmanager.h> #include <coreplugin/documentmanager.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <projectexplorer/buildinfo.h>
#include <projectexplorer/buildsteplist.h> #include <projectexplorer/buildsteplist.h>
#include <projectexplorer/kit.h> #include <projectexplorer/kit.h>
#include <projectexplorer/kitinformation.h> #include <projectexplorer/kitinformation.h>
...@@ -374,10 +374,10 @@ bool QbsBuildConfigurationFactory::canHandle(const Target *t) const ...@@ -374,10 +374,10 @@ bool QbsBuildConfigurationFactory::canHandle(const Target *t) const
BuildInfo *QbsBuildConfigurationFactory::createBuildInfo(const Kit *k, BuildInfo *QbsBuildConfigurationFactory::createBuildInfo(const Kit *k,
BuildConfiguration::BuildType type) const BuildConfiguration::BuildType type) const
{ {
QbsBuildInfo *info = new QbsBuildInfo(this); auto info = new ProjectExplorer::BuildInfo(this);
info->typeName = tr("Build"); info->typeName = tr("Build");
info->kitId = k->id(); info->kitId = k->id();
info->type = type; info->buildType = type;
return info; return info;
} }
...@@ -441,13 +441,11 @@ BuildConfiguration *QbsBuildConfigurationFactory::create(Target *parent, const B ...@@ -441,13 +441,11 @@ BuildConfiguration *QbsBuildConfigurationFactory::create(Target *parent, const B
QTC_ASSERT(info->kitId == parent->kit()->id(), return 0); QTC_ASSERT(info->kitId == parent->kit()->id(), return 0);
QTC_ASSERT(!info->displayName.isEmpty(), return 0); QTC_ASSERT(!info->displayName.isEmpty(), return 0);
const QbsBuildInfo *qbsInfo = static_cast<const QbsBuildInfo *>(info);
QVariantMap configData; QVariantMap configData;
configData.insert(QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY), configData.insert(QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY),
(qbsInfo->type == BuildConfiguration::Debug) (info->buildType == BuildConfiguration::Debug)
? QLatin1String(Constants::QBS_VARIANT_DEBUG) ? QLatin1String(Constants::QBS_VARIANT_DEBUG)
: QLatin1String(Constants::QBS_VARIANT_RELEASE)); : QLatin1String(Constants::QBS_VARIANT_RELEASE));
Utils::FileName buildDir = info->buildDirectory; Utils::FileName buildDir = info->buildDirectory;
if (buildDir.isEmpty()) if (buildDir.isEmpty())
......
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms and
** conditions see http://www.qt.io/terms-conditions. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef QBSBUILDINFO_H
#define QBSBUILDINFO_H
#include "qbsbuildconfiguration.h"
#include <projectexplorer/buildinfo.h>
#include <qtsupport/baseqtversion.h>
namespace QbsProjectManager {
namespace Internal {
class QbsBuildInfo : public ProjectExplorer::BuildInfo
{
public:
QbsBuildInfo(const QbsBuildConfigurationFactory *f) : ProjectExplorer::BuildInfo(f) { }
ProjectExplorer::BuildConfiguration::BuildType type;
};
} // namespace Internal
} // namespace QbsProjectManager
#endif // QBSBUILDINFO_H
...@@ -23,7 +23,6 @@ HEADERS = \ ...@@ -23,7 +23,6 @@ HEADERS = \
propertyprovider.h \ propertyprovider.h \
qbsbuildconfiguration.h \ qbsbuildconfiguration.h \
qbsbuildconfigurationwidget.h \ qbsbuildconfigurationwidget.h \
qbsbuildinfo.h \
qbsbuildstep.h \ qbsbuildstep.h \
qbscleanstep.h \ qbscleanstep.h \
qbsdeployconfigurationfactory.h \ qbsdeployconfigurationfactory.h \
......
...@@ -68,7 +68,6 @@ QtcPlugin { ...@@ -68,7 +68,6 @@ QtcPlugin {
"qbsbuildconfiguration.h", "qbsbuildconfiguration.h",
"qbsbuildconfigurationwidget.cpp", "qbsbuildconfigurationwidget.cpp",
"qbsbuildconfigurationwidget.h", "qbsbuildconfigurationwidget.h",
"qbsbuildinfo.h",
"qbsbuildstep.cpp", "qbsbuildstep.cpp",
"qbsbuildstep.h", "qbsbuildstep.h",
"qbsbuildstepconfigwidget.ui", "qbsbuildstepconfigwidget.ui",
......
...@@ -599,7 +599,7 @@ QmakeBuildInfo *QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k, ...@@ -599,7 +599,7 @@ QmakeBuildInfo *QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k,
} else { } else {
info->buildDirectory = defaultBuildDirectory(projectPath, k, suffix); info->buildDirectory = defaultBuildDirectory(projectPath, k, suffix);
} }
info->type = type; info->buildType = type;
return info; return info;
} }
...@@ -654,7 +654,7 @@ void QmakeBuildConfigurationFactory::configureBuildConfiguration(Target *parent, ...@@ -654,7 +654,7 @@ void QmakeBuildConfigurationFactory::configureBuildConfiguration(Target *parent,
BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(parent->kit()); BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(parent->kit());
BaseQtVersion::QmakeBuildConfigs config = version->defaultBuildConfig(); BaseQtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
if (qmakeInfo->type == BuildConfiguration::Debug) if (qmakeInfo->buildType == BuildConfiguration::Debug)
config |= QtSupport::BaseQtVersion::DebugBuild; config |= QtSupport::BaseQtVersion::DebugBuild;
else else
config &= ~QtSupport::BaseQtVersion::DebugBuild; config &= ~QtSupport::BaseQtVersion::DebugBuild;
......
...@@ -46,17 +46,12 @@ class QmakeBuildInfo : public ProjectExplorer::BuildInfo ...@@ -46,17 +46,12 @@ class QmakeBuildInfo : public ProjectExplorer::BuildInfo
public: public:
QmakeBuildInfo(const QmakeBuildConfigurationFactory *f) : ProjectExplorer::BuildInfo(f) { } QmakeBuildInfo(const QmakeBuildConfigurationFactory *f) : ProjectExplorer::BuildInfo(f) { }
ProjectExplorer::BuildConfiguration::BuildType type = ProjectExplorer::BuildConfiguration::Unknown;
QString additionalArguments; QString additionalArguments;
QString makefile; QString makefile;
QMakeStepConfig config; QMakeStepConfig config;
bool operator==(const QmakeBuildInfo &o) { bool operator==(const QmakeBuildInfo &o) {
return displayName == o.displayName return ProjectExplorer::BuildInfo::operator==(o)
&& typeName == o.typeName
&& buildDirectory == o.buildDirectory
&& kitId == o.kitId
&& type == o.type
&& additionalArguments == o.additionalArguments && additionalArguments == o.additionalArguments
&& config == o.config; && config == o.config;
} }
......
...@@ -220,10 +220,10 @@ QList<BuildInfo *> QmakeProjectImporter::import(const FileName &importPath, bool ...@@ -220,10 +220,10 @@ QList<BuildInfo *> QmakeProjectImporter::import(const FileName &importPath, bool
QmakeBuildInfo *info = new QmakeBuildInfo(factory); QmakeBuildInfo *info = new QmakeBuildInfo(factory);
BaseQtVersion::QmakeBuildConfigs buildConfig = parse.effectiveBuildConfig(version->defaultBuildConfig()); BaseQtVersion::QmakeBuildConfigs buildConfig = parse.effectiveBuildConfig(version->defaultBuildConfig());
if (buildConfig & BaseQtVersion::DebugBuild) { if (buildConfig & BaseQtVersion::DebugBuild) {
info->type = BuildConfiguration::Debug; info->buildType = BuildConfiguration::Debug;
info->displayName = QCoreApplication::translate("QmakeProjectManager::Internal::QmakeProjectImporter", "Debug"); info->displayName = QCoreApplication::translate("QmakeProjectManager::Internal::QmakeProjectImporter", "Debug");
} else { } else {
info->type = BuildConfiguration::Release; info->buildType = BuildConfiguration::Release;
info->displayName = QCoreApplication::translate("QmakeProjectManager::Internal::QmakeProjectImporter", "Release"); info->displayName = QCoreApplication::translate("QmakeProjectManager::Internal::QmakeProjectImporter", "Release");
} }
info->kitId = k->id(); info->kitId = k->id();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment