From c8afc67875a3db232f98735602af054bdf2ef531 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 1 Jul 2016 16:14:31 +0200 Subject: Automatically generate code attribution documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let the qtattributionsscanner tool generate a .qdoc file in the build directory that contains code attributions for this qdoc module. Task-number: QTBUG-55139 Change-Id: Ic7532c9a7c092f552c36e21ee6cbebdd0107689b Reviewed-by: Oswald Buddenhagen Reviewed-by: Topi Reiniƶ --- doc/global/config.qdocconf | 2 +- mkspecs/features/qt_docs.prf | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/doc/global/config.qdocconf b/doc/global/config.qdocconf index 97357345c9..ac9e7ac274 100644 --- a/doc/global/config.qdocconf +++ b/doc/global/config.qdocconf @@ -10,6 +10,6 @@ dita.metadata.default.audience = programmer #Set the main Qt index.html navigation.homepage = "Qt $QT_VER" -sourcedirs += includes +sourcedirs += includes $$BUILDDIR url = http://doc.qt.io/qt-5 diff --git a/mkspecs/features/qt_docs.prf b/mkspecs/features/qt_docs.prf index 183d0c9502..72dde61a40 100644 --- a/mkspecs/features/qt_docs.prf +++ b/mkspecs/features/qt_docs.prf @@ -21,12 +21,16 @@ qtvertag.name = QT_VERSION_TAG qtvertag.value = $$replace(qtver.value, \.,) qtdocs.name = QT_INSTALL_DOCS qtdocs.value = $$[QT_INSTALL_DOCS/src] -QT_TOOL_ENV = qtver qtmver qtvertag qtdocs +builddir.name = BUILDDIR +builddir.value = $$OUT_PWD +QT_TOOL_ENV = qtver qtmver qtvertag qtdocs builddir qtPrepareTool(QDOC, qdoc) QT_TOOL_ENV = !build_online_docs: qtPrepareTool(QHELPGENERATOR, qhelpgenerator) +qtPrepareTool(QTATTRIBUTIONSSCANNER, qtattributionsscanner) + # qtPrepareTool() must be called outside a build pass, as it protects # against concurrent wrapper creation by omitting it during build passes. # However, creating the actual targets is reserved to the build passes. @@ -63,12 +67,21 @@ DOC_INDEXES = PREP_DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get]) DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get]) } + +qtattributionsscanner.target = qtattributionsscanner +qtattributionsscanner.commands = $$QTATTRIBUTIONSSCANNER $$shell_quote($$MODULE_BASE_INDIR) \ + --filter "QDocModule=$$QMAKE_DOCS_TARGET" -o $$shell_quote($$OUT_PWD/codeattributions.qdoc) +qtattributionsscanner.CONFIG += phony +QMAKE_EXTRA_TARGETS += qtattributionsscanner + doc_command = $$QDOC $$QMAKE_DOCS prepare_docs { prepare_docs.commands += $$doc_command -prepare $$PREP_DOC_INDEXES -no-link-errors generate_docs.commands += $$doc_command -generate $$DOC_INDEXES + prepare_docs.depends += qtattributionsscanner } else { html_docs.commands += $$doc_command $$DOC_INDEXES + html_docs.depends += qtattributionsscanner } !build_online_docs { -- cgit v1.2.3