forked from qt-creator/qt-creator
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: Alessandro Portale <alessandro.portale@theqtcompany.com> Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
|
||||
#include "projectexplorer_export.h"
|
||||
|
||||
#include "buildconfiguration.h"
|
||||
#include "task.h"
|
||||
|
||||
#include <coreplugin/id.h>
|
||||
@@ -54,6 +55,14 @@ public:
|
||||
QString typeName;
|
||||
Utils::FileName buildDirectory;
|
||||
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,
|
||||
const QString &buildDir) const
|
||||
|
@@ -31,7 +31,6 @@
|
||||
#include "qbsbuildconfiguration.h"
|
||||
|
||||
#include "qbsbuildconfigurationwidget.h"
|
||||
#include "qbsbuildinfo.h"
|
||||
#include "qbsbuildstep.h"
|
||||
#include "qbscleanstep.h"
|
||||
#include "qbsinstallstep.h"
|
||||
@@ -41,6 +40,7 @@
|
||||
#include <coreplugin/documentmanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <projectexplorer/buildinfo.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/kit.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
@@ -374,10 +374,10 @@ bool QbsBuildConfigurationFactory::canHandle(const Target *t) const
|
||||
BuildInfo *QbsBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
||||
BuildConfiguration::BuildType type) const
|
||||
{
|
||||
QbsBuildInfo *info = new QbsBuildInfo(this);
|
||||
auto info = new ProjectExplorer::BuildInfo(this);
|
||||
info->typeName = tr("Build");
|
||||
info->kitId = k->id();
|
||||
info->type = type;
|
||||
info->buildType = type;
|
||||
return info;
|
||||
}
|
||||
|
||||
@@ -441,11 +441,9 @@ BuildConfiguration *QbsBuildConfigurationFactory::create(Target *parent, const B
|
||||
QTC_ASSERT(info->kitId == parent->kit()->id(), return 0);
|
||||
QTC_ASSERT(!info->displayName.isEmpty(), return 0);
|
||||
|
||||
const QbsBuildInfo *qbsInfo = static_cast<const QbsBuildInfo *>(info);
|
||||
|
||||
QVariantMap configData;
|
||||
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_RELEASE));
|
||||
|
||||
|
@@ -1,53 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 = \
|
||||
propertyprovider.h \
|
||||
qbsbuildconfiguration.h \
|
||||
qbsbuildconfigurationwidget.h \
|
||||
qbsbuildinfo.h \
|
||||
qbsbuildstep.h \
|
||||
qbscleanstep.h \
|
||||
qbsdeployconfigurationfactory.h \
|
||||
|
@@ -68,7 +68,6 @@ QtcPlugin {
|
||||
"qbsbuildconfiguration.h",
|
||||
"qbsbuildconfigurationwidget.cpp",
|
||||
"qbsbuildconfigurationwidget.h",
|
||||
"qbsbuildinfo.h",
|
||||
"qbsbuildstep.cpp",
|
||||
"qbsbuildstep.h",
|
||||
"qbsbuildstepconfigwidget.ui",
|
||||
|
@@ -599,7 +599,7 @@ QmakeBuildInfo *QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
||||
} else {
|
||||
info->buildDirectory = defaultBuildDirectory(projectPath, k, suffix);
|
||||
}
|
||||
info->type = type;
|
||||
info->buildType = type;
|
||||
return info;
|
||||
}
|
||||
|
||||
@@ -654,7 +654,7 @@ void QmakeBuildConfigurationFactory::configureBuildConfiguration(Target *parent,
|
||||
BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(parent->kit());
|
||||
|
||||
BaseQtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
|
||||
if (qmakeInfo->type == BuildConfiguration::Debug)
|
||||
if (qmakeInfo->buildType == BuildConfiguration::Debug)
|
||||
config |= QtSupport::BaseQtVersion::DebugBuild;
|
||||
else
|
||||
config &= ~QtSupport::BaseQtVersion::DebugBuild;
|
||||
|
@@ -46,17 +46,12 @@ class QmakeBuildInfo : public ProjectExplorer::BuildInfo
|
||||
public:
|
||||
QmakeBuildInfo(const QmakeBuildConfigurationFactory *f) : ProjectExplorer::BuildInfo(f) { }
|
||||
|
||||
ProjectExplorer::BuildConfiguration::BuildType type = ProjectExplorer::BuildConfiguration::Unknown;
|
||||
QString additionalArguments;
|
||||
QString makefile;
|
||||
QMakeStepConfig config;
|
||||
|
||||
bool operator==(const QmakeBuildInfo &o) {
|
||||
return displayName == o.displayName
|
||||
&& typeName == o.typeName
|
||||
&& buildDirectory == o.buildDirectory
|
||||
&& kitId == o.kitId
|
||||
&& type == o.type
|
||||
return ProjectExplorer::BuildInfo::operator==(o)
|
||||
&& additionalArguments == o.additionalArguments
|
||||
&& config == o.config;
|
||||
}
|
||||
|
@@ -220,10 +220,10 @@ QList<BuildInfo *> QmakeProjectImporter::import(const FileName &importPath, bool
|
||||
QmakeBuildInfo *info = new QmakeBuildInfo(factory);
|
||||
BaseQtVersion::QmakeBuildConfigs buildConfig = parse.effectiveBuildConfig(version->defaultBuildConfig());
|
||||
if (buildConfig & BaseQtVersion::DebugBuild) {
|
||||
info->type = BuildConfiguration::Debug;
|
||||
info->buildType = BuildConfiguration::Debug;
|
||||
info->displayName = QCoreApplication::translate("QmakeProjectManager::Internal::QmakeProjectImporter", "Debug");
|
||||
} else {
|
||||
info->type = BuildConfiguration::Release;
|
||||
info->buildType = BuildConfiguration::Release;
|
||||
info->displayName = QCoreApplication::translate("QmakeProjectManager::Internal::QmakeProjectImporter", "Release");
|
||||
}
|
||||
info->kitId = k->id();
|
||||
|
Reference in New Issue
Block a user