Commit 24967cbb authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/4.0'

Change-Id: Ied9fbfc655aac9e04df16f2ad9b4f22fe05a1ba9
parents 4d91194e 84dd6230
......@@ -228,6 +228,7 @@ struct DummyReduce {
};
template <>
struct DummyReduce<void> {
void operator()() const { } // needed for resultType<DummyReduce> with MSVC2013
};
template <typename ReduceResult>
......@@ -242,7 +243,13 @@ QFuture<ReduceResult>
mapReduce(Iterator begin, Iterator end, const InitFunction &init, const MapFunction &map,
const ReduceFunction &reduce, const CleanUpFunction &cleanup, int size = -1)
{
return runAsync(Internal::blockingIteratorMapReduce<Iterator, InitFunction, MapFunction, ReduceResult, ReduceFunction, CleanUpFunction>,
return runAsync(Internal::blockingIteratorMapReduce<
Iterator,
typename std::decay<InitFunction>::type,
typename std::decay<MapFunction>::type,
typename std::decay<ReduceResult>::type,
typename std::decay<ReduceFunction>::type,
typename std::decay<CleanUpFunction>::type>,
begin, end, init, map, reduce, cleanup, size);
}
......@@ -285,7 +292,13 @@ QFuture<ReduceResult>
mapReduce(const Container &container, const InitFunction &init, const MapFunction &map,
const ReduceFunction &reduce, const CleanUpFunction &cleanup)
{
return runAsync(Internal::blockingContainerMapReduce<Container, InitFunction, MapFunction, ReduceResult, ReduceFunction, CleanUpFunction>,
return runAsync(Internal::blockingContainerMapReduce<
typename std::decay<Container>::type,
typename std::decay<InitFunction>::type,
typename std::decay<MapFunction>::type,
typename std::decay<ReduceResult>::type,
typename std::decay<ReduceFunction>::type,
typename std::decay<CleanUpFunction>::type>,
container, init, map, reduce, cleanup);
}
......@@ -296,10 +309,10 @@ QFuture<MapResult>
map(const Container &container, const MapFunction &map)
{
return mapReduce(container,
&Internal::dummyInit<MapResult>,
Internal::dummyInit<MapResult>,
map,
Internal::DummyReduce<MapResult>(),
&Internal::dummyCleanup<MapResult>);
Internal::dummyCleanup<MapResult>);
}
} // Utils
{
\"Name\" : \"AnalyzerBase\",
\"Version\" : \"$$QTCREATOR_VERSION\",
\"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\",
\"Vendor\" : \"The Qt Company Ltd\",
\"Copyright\" : \"(C) 2016 The Qt Company Ltd\",
\"License\" : [ \"Commercial Usage\",
\"\",
\"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt 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.\",
\"\",
\"GNU General Public License Usage\",
\"\",
\"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\"
],
\"Category\" : \"Code Analyzer\",
\"Description\" : \"Code Analyzer Base Plugin.\",
\"Url\" : \"http://www.qt.io\",
$$dependencyList
}
DEFINES += ANALYZERBASE_LIBRARY
include(../../qtcreatorplugin.pri)
QT += network
# AnalyzerBase files
SOURCES += \
ianalyzertool.cpp \
analyzerplugin.cpp \
analyzerruncontrol.cpp \
analyzermanager.cpp \
analyzerrunconfigwidget.cpp \
analyzerutils.cpp \
detailederrorview.cpp \
diagnosticlocation.cpp \
startremotedialog.cpp
HEADERS += \
ianalyzertool.h \
analyzerbase_global.h \
analyzerconstants.h \
analyzerplugin.h \
analyzerruncontrol.h \
analyzermanager.h \
analyzerstartparameters.h \
analyzerrunconfigwidget.h \
analyzerutils.h \
detailederrorview.h \
diagnosticlocation.h \
startremotedialog.h \
analyzericons.h
RESOURCES += \
analyzerbase.qrc
import qbs 1.0
QtcPlugin {
name: "AnalyzerBase"
Depends { name: "Qt.widgets" }
Depends { name: "Utils" }
Depends { name: "QtcSsh" }
Depends { name: "Core" }
Depends { name: "CppTools" }
Depends { name: "ProjectExplorer" }
Depends { name: "TextEditor" }
files: [
"analyzerbase.qrc",
"analyzerbase_global.h",
"analyzerconstants.h",
"analyzericons.h",
"analyzermanager.cpp",
"analyzermanager.h",
"analyzerplugin.cpp",
"analyzerplugin.h",
"analyzerrunconfigwidget.cpp",
"analyzerrunconfigwidget.h",
"analyzerruncontrol.cpp",
"analyzerruncontrol.h",
"analyzerstartparameters.h",
"analyzerutils.cpp",
"analyzerutils.h",
"detailederrorview.cpp",
"detailederrorview.h",
"diagnosticlocation.cpp",
"diagnosticlocation.h",
"ianalyzertool.cpp",
"ianalyzertool.h",
"startremotedialog.cpp",
"startremotedialog.h",
]
Group {
name: "Images"
prefix: "images/"
files: ["*.png"]
}
Export {
Depends { name: "CPlusPlus" }
}
}
QTC_PLUGIN_NAME = AnalyzerBase
QTC_LIB_DEPENDS += \
cplusplus \
extensionsystem \
ssh \
utils
QTC_PLUGIN_DEPENDS += \
coreplugin \
projectexplorer \
texteditor \
cpptools
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Author: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@kdab.com)
** Contact: https://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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "analyzerplugin.h"
#include "analyzerconstants.h"
#include "analyzermanager.h"
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/taskhub.h>
#include <QtPlugin>
using namespace Analyzer;
using namespace Analyzer::Internal;
static AnalyzerPlugin *m_instance = 0;
////////////////////////////////////////////////////////////////////////
//
// AnalyzerPlugin
//
////////////////////////////////////////////////////////////////////////
AnalyzerPlugin::AnalyzerPlugin()
{
m_instance = this;
}
AnalyzerPlugin::~AnalyzerPlugin()
{
m_instance = 0;
}
bool AnalyzerPlugin::initialize(const QStringList &arguments, QString *errorString)
{
Q_UNUSED(arguments)
Q_UNUSED(errorString)
(void) new AnalyzerManager(this);
// Task integration.
//: Category under which Analyzer tasks are listed in Issues view
ProjectExplorer::TaskHub::addCategory(Constants::ANALYZERTASK_ID, tr("Analyzer"));
return true;
}
ExtensionSystem::IPlugin::ShutdownFlag AnalyzerPlugin::aboutToShutdown()
{
AnalyzerManager::shutdown();
return SynchronousShutdown;
}
AnalyzerPlugin *AnalyzerPlugin::instance()
{
return m_instance;
}
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Author: Nicolas Arnaud-Cormos, KDAB (nicolas.arnaud-cormos@kdab.com)
** Contact: https://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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#ifndef ANALYZERPLUGIN_H
#define ANALYZERPLUGIN_H
#include <extensionsystem/iplugin.h>
namespace Analyzer {
namespace Internal {
class AnalyzerPlugin : public ExtensionSystem::IPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "AnalyzerBase.json")
public:
static AnalyzerPlugin *instance();
AnalyzerPlugin();
virtual ~AnalyzerPlugin();
bool initialize(const QStringList &arguments, QString *errorString);
void extensionsInitialized() {}
ShutdownFlag aboutToShutdown();
};
} // namespace Internal
} // namespace Analyzer
#endif // ANALYZERPLUGIN_H
......@@ -4,7 +4,6 @@ QtcPlugin {
name: "Android"
Depends { name: "Qt"; submodules: ["widgets", "xml", "network"] }
Depends { name: "AnalyzerBase" }
Depends { name: "Core" }
Depends { name: "Debugger" }
Depends { name: "ProjectExplorer" }
......
......@@ -4,8 +4,7 @@ QTC_PLUGIN_DEPENDS += \
debugger \
projectexplorer \
qtsupport \
texteditor \
analyzerbase
texteditor
QTC_LIB_DEPENDS += \
extensionsystem \
......
......@@ -28,10 +28,10 @@
#include "androidrunner.h"
#include "androidmanager.h"
#include <analyzerbase/ianalyzertool.h>
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerruncontrol.h>
#include <analyzerbase/analyzerstartparameters.h>
#include <debugger/analyzer/ianalyzertool.h>
#include <debugger/analyzer/analyzermanager.h>
#include <debugger/analyzer/analyzerruncontrol.h>
#include <debugger/analyzer/analyzerstartparameters.h>
#include <projectexplorer/target.h>
#include <projectexplorer/project.h>
......
......@@ -40,9 +40,9 @@
#include <projectexplorer/toolchain.h>
#include <projectexplorer/project.h>
#include <projectexplorer/buildconfiguration.h>
#include <analyzerbase/analyzerstartparameters.h>
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerruncontrol.h>
#include <debugger/analyzer/analyzerstartparameters.h>
#include <debugger/analyzer/analyzermanager.h>
#include <debugger/analyzer/analyzerruncontrol.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/target.h>
#include <utils/portlist.h>
......
......@@ -3,7 +3,7 @@ import qbs
QtcPlugin {
name: "ClangStaticAnalyzer"
Depends { name: "AnalyzerBase" }
Depends { name: "Debugger" }
Depends { name: "Core" }
Depends { name: "CppTools" }
Depends { name: "ExtensionSystem" }
......
......@@ -3,7 +3,7 @@ QTC_LIB_DEPENDS += \
extensionsystem \
utils
QTC_PLUGIN_DEPENDS += \
analyzerbase \
debugger \
cpptools
QTC_TEST_DEPENDS += \
qbsprojectmanager \
......
......@@ -26,7 +26,7 @@
#ifndef CLANGSTATICANALZYERDIAGNOSTIC_H
#define CLANGSTATICANALZYERDIAGNOSTIC_H
#include <analyzerbase/diagnosticlocation.h>
#include <debugger/analyzer/diagnosticlocation.h>
#include <QList>
#include <QMetaType>
......
......@@ -29,7 +29,7 @@
#include "clangstaticanalyzerdiagnostic.h"
#include "clangstaticanalyzerprojectsettings.h"
#include <analyzerbase/detailederrorview.h>
#include <debugger/analyzer/detailederrorview.h>
#include <utils/fileutils.h>
#include <utils/treemodel.h>
......
......@@ -26,7 +26,7 @@
#ifndef CLANGSTATICANALYZERDIAGNOSTICVIEW_H
#define CLANGSTATICANALYZERDIAGNOSTICVIEW_H
#include <analyzerbase/detailederrorview.h>
#include <debugger/analyzer/detailederrorview.h>
namespace ClangStaticAnalyzer {
namespace Internal {
......
......@@ -35,7 +35,7 @@
#include "clangstaticanalyzerunittests.h"
#endif
#include <analyzerbase/analyzermanager.h>
#include <debugger/analyzer/analyzermanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/icontext.h>
#include <coreplugin/actionmanager/actionmanager.h>
......
......@@ -30,8 +30,8 @@
#include "clangstaticanalyzersettings.h"
#include "clangstaticanalyzerutils.h"
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerutils.h>
#include <debugger/analyzer/analyzermanager.h>
#include <debugger/analyzer/analyzerutils.h>
#include <clangcodemodel/clangutils.h>
......
......@@ -26,7 +26,7 @@
#ifndef CLANGSTATICANALYZERRUNCONTROL_H
#define CLANGSTATICANALYZERRUNCONTROL_H
#include <analyzerbase/analyzerruncontrol.h>
#include <debugger/analyzer/analyzerruncontrol.h>
#include <cpptools/projectinfo.h>
#include <utils/environment.h>
......
......@@ -27,9 +27,9 @@
#include "clangstaticanalyzerconstants.h"
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerruncontrol.h>
#include <analyzerbase/analyzerstartparameters.h>
#include <debugger/analyzer/analyzermanager.h>
#include <debugger/analyzer/analyzerruncontrol.h>
#include <debugger/analyzer/analyzerstartparameters.h>
#include <coreplugin/icontext.h>
......
......@@ -31,7 +31,7 @@
#include "clangstaticanalyzerdiagnosticview.h"
#include "clangstaticanalyzerruncontrol.h"
#include <analyzerbase/analyzermanager.h>
#include <debugger/analyzer/analyzermanager.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/coreicons.h>
#include <coreplugin/icore.h>
......
......@@ -26,7 +26,7 @@
#ifndef CLANGSTATICANALYZERTOOL_H
#define CLANGSTATICANALYZERTOOL_H
#include <analyzerbase/ianalyzertool.h>
#include <debugger/analyzer/ianalyzertool.h>
#include <cpptools/projectinfo.h>
#include <QHash>
......
......@@ -29,7 +29,7 @@
#include "clangstaticanalyzertool.h"
#include "clangstaticanalyzerutils.h"
#include <analyzerbase/analyzermanager.h>
#include <debugger/analyzer/analyzermanager.h>
#include <cpptools/cppmodelmanager.h>
#include <cpptools/cpptoolstestcase.h>
#include <projectexplorer/kitinformation.h>
......
......@@ -57,39 +57,43 @@ class CMakeTool;
namespace Internal {
class CMakeBuildConfiguration;
class BuildDirManager : public QObject
{
Q_OBJECT
public:
BuildDirManager(const Utils::FileName &sourceDir, const ProjectExplorer::Kit *k,
const CMakeConfig &inputConfig, const Utils::Environment &env,
const Utils::FileName &buildDir);
BuildDirManager(const CMakeBuildConfiguration *bc);
~BuildDirManager() override;
const ProjectExplorer::Kit *kit() const { return m_kit; }
const Utils::FileName buildDirectory() const { return m_buildDir; }
const Utils::FileName sourceDirectory() const { return m_sourceDir; }
bool isBusy() const;
const ProjectExplorer::Kit *kit() const;
const Utils::FileName buildDirectory() const;
const Utils::FileName workDirectory() const;
const Utils::FileName sourceDirectory() const;
const CMakeConfig cmakeConfiguration() const;
bool isParsing() const;
void parse();
void forceReparse();
void setInputConfiguration(const CMakeConfig &config);
void resetData();
bool persistCMakeState();
bool isProjectFile(const Utils::FileName &fileName) const;
QString projectName() const;
QList<CMakeBuildTarget> buildTargets() const;
QList<ProjectExplorer::FileNode *> files() const;
QList<ProjectExplorer::FileNode *> files();
void clearFiles();
CMakeConfig configuration() const;
signals:
void parsingStarted() const;
void configurationStarted() const;
void dataAvailable() const;
void errorOccured(const QString &err) const;
private:
void stopProcess();
void cleanUpProcess();
void extractData();
void startCMake(CMakeTool *tool, const QString &generator, const CMakeConfig &config);
......@@ -100,15 +104,11 @@ private:
CMakeConfig parseConfiguration() const;
const Utils::FileName m_sourceDir;
Utils::FileName m_buildDir;
Utils::FileName m_parsedSourceDir;
const ProjectExplorer::Kit *const m_kit;
Utils::Environment m_environment;
CMakeConfig m_inputConfig;
bool m_hasData = false;
QTemporaryDir *m_tempDir = nullptr;
const CMakeBuildConfiguration *m_buildConfiguration = nullptr;
Utils::QtcProcess *m_cmakeProcess = nullptr;
QTemporaryDir *m_tempDir = nullptr;
QSet<Utils::FileName> m_watchedFiles;
QString m_projectName;
......
......@@ -25,6 +25,7 @@
#include "cmakebuildconfiguration.h"
#include "builddirmanager.h"
#include "cmakebuildinfo.h"
#include "cmakebuildstep.h"
#include "cmakekitinformation.h"
......@@ -75,10 +76,32 @@ static FileName shadowBuildDirectory(const FileName &projectFilePath, const Kit
CMakeBuildConfiguration::CMakeBuildConfiguration(ProjectExplorer::Target *parent) :
BuildConfiguration(parent, Core::Id(Constants::CMAKE_BC_ID))
{
CMakeProject *project = static_cast<CMakeProject *>(parent->project());
auto project = static_cast<CMakeProject *>(parent->project());
setBuildDirectory(shadowBuildDirectory(project->projectFilePath(),
parent->kit(),
displayName(), BuildConfiguration::Unknown));
m_buildDirManager = new BuildDirManager(this);
connect(m_buildDirManager, &BuildDirManager::dataAvailable,
this, &CMakeBuildConfiguration::dataAvailable);
connect(m_buildDirManager, &BuildDirManager::errorOccured,
this, &CMakeBuildConfiguration::setError);
connect(m_buildDirManager, &BuildDirManager::configurationStarted,
this, [this]() { m_completeConfigurationCache.clear(); emit parsingStarted(); });
connect(this, &CMakeBuildConfiguration::environmentChanged,
m_buildDirManager, &BuildDirManager::forceReparse);
connect(this, &CMakeBuildConfiguration::buildDirectoryChanged,
m_buildDirManager, &BuildDirManager::forceReparse);
connect(target(), &Target::kitChanged, m_buildDirManager, &BuildDirManager::forceReparse);
connect(this, &CMakeBuildConfiguration::parsingStarted, project, &CMakeProject::handleParsingStarted);
connect(this, &CMakeBuildConfiguration::dataAvailable, project, &CMakeProject::parseCMakeOutput);
}
CMakeBuildConfiguration::~CMakeBuildConfiguration()
{