forked from qt-creator/qt-creator
Autotools: Hide AutotoolsBuildSystem definition in .cpp
Change-Id: I7ef251452c522593da955a64024068682f7fdfb1 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
#include <qtsupport/qtcppkitinfo.h>
|
#include <qtsupport/qtcppkitinfo.h>
|
||||||
|
|
||||||
|
#include <solutions/tasking/tasktreerunner.h>
|
||||||
|
|
||||||
#include <utils/async.h>
|
#include <utils/async.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -21,6 +23,33 @@ using namespace Utils;
|
|||||||
|
|
||||||
namespace AutotoolsProjectManager::Internal {
|
namespace AutotoolsProjectManager::Internal {
|
||||||
|
|
||||||
|
class AutotoolsBuildSystem final : public BuildSystem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit AutotoolsBuildSystem(Target *target);
|
||||||
|
~AutotoolsBuildSystem() final;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void triggerParsing() final;
|
||||||
|
QString name() const final { return QLatin1String("autotools"); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is invoked when the makefile parsing by m_makefileParserThread has
|
||||||
|
* been finished. Adds all sources and files into the project tree and
|
||||||
|
* takes care listen to file changes for Makefile.am and configure.ac
|
||||||
|
* files.
|
||||||
|
*/
|
||||||
|
void makefileParsingFinished(const MakefileParserOutputData &outputData);
|
||||||
|
|
||||||
|
/// Return value for AutotoolsProject::files()
|
||||||
|
QStringList m_files;
|
||||||
|
|
||||||
|
/// Responsible for parsing the makefiles asynchronously in a thread
|
||||||
|
Tasking::TaskTreeRunner m_parserRunner;
|
||||||
|
|
||||||
|
std::unique_ptr<ProjectUpdater> m_cppCodeModelUpdater;
|
||||||
|
};
|
||||||
|
|
||||||
AutotoolsBuildSystem::AutotoolsBuildSystem(Target *target)
|
AutotoolsBuildSystem::AutotoolsBuildSystem(Target *target)
|
||||||
: BuildSystem(target)
|
: BuildSystem(target)
|
||||||
, m_cppCodeModelUpdater(ProjectUpdaterFactory::createCppProjectUpdater())
|
, m_cppCodeModelUpdater(ProjectUpdaterFactory::createCppProjectUpdater())
|
||||||
@@ -147,6 +176,12 @@ void AutotoolsBuildSystem::makefileParsingFinished(const MakefileParserOutputDat
|
|||||||
|
|
||||||
m_cppCodeModelUpdater->update({project(), kitInfo, activeParseEnvironment(), {rpp}});
|
m_cppCodeModelUpdater->update({project(), kitInfo, activeParseEnvironment(), {rpp}});
|
||||||
|
|
||||||
emitBuildSystemUpdated();}
|
emitBuildSystemUpdated();
|
||||||
|
}
|
||||||
|
|
||||||
|
BuildSystem *createAutotoolsBuildSystem(Target *target)
|
||||||
|
{
|
||||||
|
return new AutotoolsBuildSystem(target);
|
||||||
|
}
|
||||||
|
|
||||||
} // AutotoolsProjectManager::Internal
|
} // AutotoolsProjectManager::Internal
|
||||||
|
|||||||
@@ -5,39 +5,8 @@
|
|||||||
|
|
||||||
#include <projectexplorer/buildsystem.h>
|
#include <projectexplorer/buildsystem.h>
|
||||||
|
|
||||||
#include <solutions/tasking/tasktreerunner.h>
|
|
||||||
|
|
||||||
namespace ProjectExplorer { class ProjectUpdater; }
|
|
||||||
|
|
||||||
namespace AutotoolsProjectManager::Internal {
|
namespace AutotoolsProjectManager::Internal {
|
||||||
|
|
||||||
class MakefileParserOutputData;
|
ProjectExplorer::BuildSystem *createAutotoolsBuildSystem(ProjectExplorer::Target *target);
|
||||||
|
|
||||||
class AutotoolsBuildSystem final : public ProjectExplorer::BuildSystem
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit AutotoolsBuildSystem(ProjectExplorer::Target *target);
|
|
||||||
~AutotoolsBuildSystem() final;
|
|
||||||
|
|
||||||
private:
|
|
||||||
void triggerParsing() final;
|
|
||||||
QString name() const final { return QLatin1String("autotools"); }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Is invoked when the makefile parsing by m_makefileParserThread has
|
|
||||||
* been finished. Adds all sources and files into the project tree and
|
|
||||||
* takes care listen to file changes for Makefile.am and configure.ac
|
|
||||||
* files.
|
|
||||||
*/
|
|
||||||
void makefileParsingFinished(const MakefileParserOutputData &outputData);
|
|
||||||
|
|
||||||
/// Return value for AutotoolsProject::files()
|
|
||||||
QStringList m_files;
|
|
||||||
|
|
||||||
/// Responsible for parsing the makefiles asynchronously in a thread
|
|
||||||
Tasking::TaskTreeRunner m_parserRunner;
|
|
||||||
|
|
||||||
std::unique_ptr<ProjectExplorer::ProjectUpdater> m_cppCodeModelUpdater;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // AutotoolsProjectManager::Internal
|
} // AutotoolsProjectManager::Internal
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectmanager.h>
|
#include <projectexplorer/projectmanager.h>
|
||||||
#include <projectexplorer/target.h>
|
|
||||||
|
|
||||||
#include <extensionsystem/iplugin.h>
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
@@ -41,10 +40,8 @@ public:
|
|||||||
setId(Constants::AUTOTOOLS_PROJECT_ID);
|
setId(Constants::AUTOTOOLS_PROJECT_ID);
|
||||||
setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID));
|
setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID));
|
||||||
setDisplayName(projectDirectory().fileName());
|
setDisplayName(projectDirectory().fileName());
|
||||||
|
|
||||||
setHasMakeInstallEquivalent(true);
|
setHasMakeInstallEquivalent(true);
|
||||||
|
setBuildSystemCreator(&createAutotoolsBuildSystem);
|
||||||
setBuildSystemCreator<AutotoolsBuildSystem>();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1032,7 +1032,7 @@ Task Project::createProjectTask(Task::TaskType type, const QString &description)
|
|||||||
return Task(type, description, FilePath(), -1, Id());
|
return Task(type, description, FilePath(), -1, Id());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Project::setBuildSystemCreatorImpl(const std::function<BuildSystem *(Target *)> &creator)
|
void Project::setBuildSystemCreator(const std::function<BuildSystem *(Target *)> &creator)
|
||||||
{
|
{
|
||||||
d->m_buildSystemCreator = creator;
|
d->m_buildSystemCreator = creator;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -234,11 +234,11 @@ protected:
|
|||||||
const QString &description);
|
const QString &description);
|
||||||
template <typename BuildSystemImpl>
|
template <typename BuildSystemImpl>
|
||||||
void setBuildSystemCreator() {
|
void setBuildSystemCreator() {
|
||||||
setBuildSystemCreatorImpl([](Target *t) { return new BuildSystemImpl(t); });
|
setBuildSystemCreator([](Target *t) { return new BuildSystemImpl(t); });
|
||||||
}
|
}
|
||||||
private:
|
void setBuildSystemCreator(const std::function<BuildSystem *(Target *)> &creator);
|
||||||
void setBuildSystemCreatorImpl(const std::function<BuildSystem *(Target *)> &creator);
|
|
||||||
|
|
||||||
|
private:
|
||||||
void addTarget(std::unique_ptr<Target> &&target);
|
void addTarget(std::unique_ptr<Target> &&target);
|
||||||
|
|
||||||
void addProjectLanguage(Utils::Id id);
|
void addProjectLanguage(Utils::Id id);
|
||||||
|
|||||||
Reference in New Issue
Block a user