aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2017-08-03 14:00:35 +0200
committerKai Koehne <kai.koehne@qt.io>2017-08-23 08:54:16 +0000
commitc75285b0b6c2d10a08acdc78c0554831c42c52c6 (patch)
tree6f41a9bfb414cd4460240e0909afbcb5087170c9
parent549239f16dedd1511a153fcd2a716b6a92f155c8 (diff)
Generate code attribution documentation
Change-Id: I692efc667d5e9713afee0cd2ee155ac24ed3de56 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--doc/config/qbs-project.qdocconf2
-rw-r--r--doc/doc.pri1
-rw-r--r--doc/doc.qbs28
-rw-r--r--doc/doc_shared.pri4
-rw-r--r--doc/doc_targets.pri12
-rw-r--r--doc/qbs.qdoc13
6 files changed, 57 insertions, 3 deletions
diff --git a/doc/config/qbs-project.qdocconf b/doc/config/qbs-project.qdocconf
index 197a01260..5f13caef9 100644
--- a/doc/config/qbs-project.qdocconf
+++ b/doc/config/qbs-project.qdocconf
@@ -7,7 +7,7 @@ project = "Qbs"
description = "Qbs Manual"
headerdirs =
-sourcedirs = ..
+sourcedirs = .. $BUILDDIR
imagedirs = ../images ../templates/images
exampledirs = ..
diff --git a/doc/doc.pri b/doc/doc.pri
index 84583a870..7e6cb754a 100644
--- a/doc/doc.pri
+++ b/doc/doc.pri
@@ -2,6 +2,7 @@ include(../src/install_prefix.pri)
include(doc_shared.pri)
+DOC_SRCDIR = $$PWD/..
DOC_OUTDIR_POSTFIX = /html
DOC_HTML_INSTALLDIR = $$QBS_INSTALL_PREFIX/share/doc/qbs
DOC_QCH_OUTDIR = $$OUT_PWD/doc
diff --git a/doc/doc.qbs b/doc/doc.qbs
index 1dba7dae9..ed2eca4af 100644
--- a/doc/doc.qbs
+++ b/doc/doc.qbs
@@ -1,4 +1,6 @@
import qbs 1.0
+import qbs.FileInfo
+import qbs.Utilities
Product {
name: "qbs documentation"
@@ -20,13 +22,37 @@ Product {
files: "qbs.qdocconf"
fileTags: "qdocconf-main"
}
+ Group {
+ name: "qtattribution.json files"
+ files: [
+ "../src/3rdparty/**/qt_attribution.json"
+ ]
+ fileTags: ["qtattribution"]
+ }
+
+ Rule {
+ inputs: ["qtattribution"]
+ Artifact {
+ filePath: Utilities.getHash(input.filePath) + ".qtattributions.qdoc"
+ fileTags: ["qdoc"]
+ }
+
+ prepare: {
+ var tool = FileInfo.joinPaths(input.Qt.core.binPath, "qtattributionsscanner");
+ var args = ["-o", output.filePath, FileInfo.joinPaths(FileInfo.path(input.filePath))];
+ var cmd = new Command(tool, args);
+ cmd.description = "running qtattributionsscanner";
+ return cmd;
+ }
+ }
property string versionTag: qbsversion.version.replace(/\.|-/g, "")
Qt.core.qdocEnvironment: [
"QBS_VERSION=" + qbsversion.version,
"SRCDIR=" + path,
"QT_INSTALL_DOCS=" + Qt.core.docPath,
- "QBS_VERSION_TAG=" + versionTag
+ "QBS_VERSION_TAG=" + versionTag,
+ "BUILDDIR=" + buildDirectory
]
Group {
diff --git a/doc/doc_shared.pri b/doc/doc_shared.pri
index 3e4eccf48..336b1e367 100644
--- a/doc/doc_shared.pri
+++ b/doc/doc_shared.pri
@@ -6,7 +6,9 @@ qbsdoc_versiontag.name = QBS_VERSION_TAG
qbsdoc_versiontag.value = $$replace(QBS_VERSION, "[-.]", )
qbsdoc_qtdocs.name = QT_INSTALL_DOCS
qbsdoc_qtdocs.value = $$[QT_INSTALL_DOCS/src]
-QDOC_ENV += qbsdoc_version qbsdoc_versiontag qbsdoc_qtdocs
+qbsdoc_builddir.name = BUILDDIR
+qbsdoc_builddir.value = $$OUT_PWD
+QDOC_ENV += qbsdoc_version qbsdoc_versiontag qbsdoc_qtdocs qbsdoc_builddir
build_online_docs: \
DOC_FILES += $$PWD/qbs-online.qdocconf
diff --git a/doc/doc_targets.pri b/doc/doc_targets.pri
index 0636be2b5..c4c6962b1 100644
--- a/doc/doc_targets.pri
+++ b/doc/doc_targets.pri
@@ -6,6 +6,7 @@
# QDOC_ENV - environment variables to set for the qdoc call (see example below)
# DOC_INDEX_PATHS - list of paths where qdoc should search for index files of dependent
# modules (Qt index path is included by default)
+# DOC_SRCDIR - source directory
# DOC_FILES - list of qdocconf files
# DOC_OUTDIR_POSTFIX - html is generated in $$OUT_PWD/<qdocconf_name>$$DOC_OUTDIR_POSTFIX
# DOC_HTML_INSTALLDIR - path were to install the directory of html files
@@ -21,6 +22,7 @@
# QDOC_ENV = ver foo
isEmpty(DOC_FILES): error("Set DOC_FILES before including doc_targets.pri")
+isEmpty(DOC_SRCDIR): error("Set DOC_SRCDIR before including doc_targets.pri")
isEmpty(DOC_HTML_INSTALLDIR): error("Set DOC_HTML_INSTALLDIR before including doc_targets.pri")
isEmpty(DOC_QCH_OUTDIR): error("Set DOC_QCH_OUTDIR before including doc_targets.pri")
isEmpty(DOC_QCH_INSTALLDIR): error("Set DOC_QCH_INSTALLDIR before including doc_targets.pri")
@@ -31,12 +33,21 @@ QT_TOOL_ENV =
!build_online_docs: qtPrepareTool(QHELPGENERATOR, qhelpgenerator)
+qtPrepareTool(QTATTRIBUTIONSSCANNER, qtattributionsscanner)
+
DOCS_BASE_OUTDIR = $$OUT_PWD/doc
DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS])
for (index_path, DOC_INDEX_PATHS): \
DOC_INDEXES += -indexdir $$shell_quote($$index_path)
DTP = $$DOC_TARGET_PREFIX
+
+$${DTP}qtattributionsscanner.target = qtattributionsscanner
+$${DTP}qtattributionsscanner.commands += $$QTATTRIBUTIONSSCANNER $$shell_quote($$DOC_SRCDIR) \
+ -o $$shell_quote($$OUT_PWD/codeattributions.qdoc)
+$${DTP}qtattributionsscanner.CONFIG += phony
+QMAKE_EXTRA_TARGETS += $${DTP}qtattributionsscanner
+
for (doc_file, DOC_FILES) {
!exists($$doc_file): error("Cannot find documentation specification file $$doc_file")
DOC_TARGET = $$replace(doc_file, ^(.*/)?(.*)\\.qdocconf$, \\2)
@@ -48,6 +59,7 @@ for (doc_file, DOC_FILES) {
!isEmpty($${DTP}html_docs.commands): $${DTP}html_docs.commands += &&
$${DTP}html_docs.commands += $$eval($${DTP}html_docs_$${DOC_TARGET}.commands)
+ $${DTP}html_docs.depends += $${DTP}qtattributionsscanner
$${DTP}inst_html_docs.files += $$DOC_OUTPUTDIR
diff --git a/doc/qbs.qdoc b/doc/qbs.qdoc
index a5856f449..ceb45f80f 100644
--- a/doc/qbs.qdoc
+++ b/doc/qbs.qdoc
@@ -85,6 +85,7 @@
\endlist
\li \l{Appendix A: Building Qbs}
+ \li \l{Appendix B: Code Attributions}
\endlist
*/
@@ -123,6 +124,7 @@
\contentspage index.html
\previouspage reference.html
\page building-qbs.html
+ \nextpage attributions.html
\title Appendix A: Building Qbs
@@ -1108,3 +1110,14 @@
configuration instead of Product.name), the generator will typically suggest it in the error
message.
*/
+
+/*!
+ \contentspage index.html
+ \previouspage building-qbs.html
+ \page attributions.html
+
+ \title Appendix B: Code Attributions
+
+ \QBS contains third-party code, which we gratefully acknowledge:
+ \generatelist{groupsbymodule attributions-qbs}
+*/