2016-01-15 14:57:40 +01:00
|
|
|
/****************************************************************************
|
2011-11-29 14:19:28 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 Openismus GmbH.
|
|
|
|
|
** Author: Peter Penz (ppenz@openismus.com)
|
|
|
|
|
** Author: Patricia Santana Cruz (patriciasantanacruz@gmail.com)
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-11-29 14:19:28 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-11-29 14:19:28 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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
|
2016-01-15 14:57:40 +01:00
|
|
|
** 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.
|
2011-11-29 14:19:28 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** 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.
|
2011-11-29 14:19:28 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2011-11-29 14:19:28 +01:00
|
|
|
|
2016-02-03 17:21:12 +01:00
|
|
|
#pragma once
|
2011-11-29 14:19:28 +01:00
|
|
|
|
|
|
|
|
#include <projectexplorer/project.h>
|
|
|
|
|
|
2013-07-22 15:53:57 +02:00
|
|
|
#include <utils/fileutils.h>
|
|
|
|
|
|
2014-02-11 21:55:42 +02:00
|
|
|
namespace Utils { class FileSystemWatcher; }
|
2012-07-25 09:48:48 +02:00
|
|
|
|
2017-02-06 16:59:53 +01:00
|
|
|
namespace CppTools { class CppProjectUpdater; }
|
|
|
|
|
|
2011-11-29 14:19:28 +01:00
|
|
|
namespace AutotoolsProjectManager {
|
|
|
|
|
namespace Internal {
|
2017-02-28 16:31:07 +01:00
|
|
|
|
2011-11-29 14:19:28 +01:00
|
|
|
class MakefileParserThread;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Implementation of the ProjectExplorer::Project interface.
|
|
|
|
|
*
|
|
|
|
|
* Loads the autotools project and embeds it into the QtCreator project tree.
|
|
|
|
|
* The class AutotoolsProject is the core of the autotools project plugin.
|
|
|
|
|
* It is responsible to parse the Makefile.am files and do trigger project
|
|
|
|
|
* updates if a Makefile.am file or a configure.ac file has been changed.
|
|
|
|
|
*/
|
|
|
|
|
class AutotoolsProject : public ProjectExplorer::Project
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2019-05-28 13:49:26 +02:00
|
|
|
explicit AutotoolsProject(const Utils::FilePath &fileName);
|
2016-01-07 17:58:34 +01:00
|
|
|
~AutotoolsProject() override;
|
2011-11-29 14:19:28 +01:00
|
|
|
|
|
|
|
|
protected:
|
2016-01-07 17:58:34 +01:00
|
|
|
RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override;
|
2011-11-29 14:19:28 +01:00
|
|
|
|
2016-02-03 17:21:12 +01:00
|
|
|
private:
|
2011-11-29 14:19:28 +01:00
|
|
|
/**
|
|
|
|
|
* Loads the project tree by parsing the makefiles.
|
|
|
|
|
*/
|
2012-07-17 15:56:43 +02:00
|
|
|
void loadProjectTree();
|
2011-11-29 14:19:28 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Is invoked when the makefile parsing by m_makefileParserThread has
|
|
|
|
|
* been started. Turns the mouse cursor into a busy cursor.
|
|
|
|
|
*/
|
|
|
|
|
void makefileParsingStarted();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This function is in charge of the code completion.
|
|
|
|
|
*/
|
|
|
|
|
void updateCppCodeModel();
|
|
|
|
|
|
|
|
|
|
/// Return value for AutotoolsProject::files()
|
|
|
|
|
QStringList m_files;
|
|
|
|
|
|
|
|
|
|
/// Responsible for parsing the makefiles asynchronously in a thread
|
2016-02-03 17:21:12 +01:00
|
|
|
MakefileParserThread *m_makefileParserThread = nullptr;
|
2014-08-19 12:00:31 +02:00
|
|
|
|
2017-02-06 16:59:53 +01:00
|
|
|
CppTools::CppProjectUpdater *m_cppCodeModelUpdater = nullptr;
|
2011-11-29 14:19:28 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace AutotoolsProjectManager
|