diff options
author | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2014-12-17 12:19:54 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2014-12-17 13:44:28 +0100 |
commit | 046460f4ea63e1d809c7a5720d9e6746eabce94b (patch) | |
tree | 5a935a88741013d9bb0f77c8652c64f0d04ac3d4 /src/lib/corelib/buildgraph/nodetreedumper.h | |
parent | efbb6c48664ce08a14ff9813e1bf9432ff2fa44d (diff) |
Add command for showing a tree of build graph nodes.
This is helpful for getting an overview of the parent-child
relationships.
Change-Id: I097921fc77e36ca3f34e548aa6132ef8e1cd9295
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/lib/corelib/buildgraph/nodetreedumper.h')
-rw-r--r-- | src/lib/corelib/buildgraph/nodetreedumper.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/src/lib/corelib/buildgraph/nodetreedumper.h b/src/lib/corelib/buildgraph/nodetreedumper.h new file mode 100644 index 000000000..c60087bfe --- /dev/null +++ b/src/lib/corelib/buildgraph/nodetreedumper.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Build Suite. +** +** 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 Digia. For licensing terms and +** conditions see http://www.qt.io/licensing. 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, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ +#ifndef QBS_NODETREEDUMPER_H +#define QBS_NODETREEDUMPER_H + +#include "artifactset.h" +#include "buildgraphvisitor.h" +#include <language/forward_decls.h> + +#include <QList> + +QT_BEGIN_NAMESPACE +class QIODevice; +QT_END_NAMESPACE + +namespace qbs { +namespace Internal { + +class NodeTreeDumper : public BuildGraphVisitor +{ +public: + NodeTreeDumper(QIODevice &outDevice); + + void start(const QList<ResolvedProductPtr> &products); + +private: + bool visit(Artifact *artifact) Q_DECL_OVERRIDE; + void endVisit(Artifact *artifact) Q_DECL_OVERRIDE; + bool visit(RuleNode *rule) Q_DECL_OVERRIDE; + void endVisit(RuleNode *rule) Q_DECL_OVERRIDE; + + void doEndVisit(); + void indent(); + void unindent(); + QByteArray indentation() const; + + QIODevice &m_outDevice; + ResolvedProductPtr m_currentProduct; + ArtifactSet m_visited; + unsigned int m_indentation; +}; + +} // namespace Internal +} // namespace qbs + +#endif // Include guard. |