55static void generate(QTextStream &out,
const Package &package,
const QDir &baseDir)
58 for (
const QString &part : package.qtParts) {
59 out <<
"\\ingroup attributions-" << package.qdocModule <<
"-" << part <<
"\n";
60 out <<
"\\ingroup attributions-" << part <<
"\n";
63 if (package.qtParts.contains(
"libs"_L1)) {
65 out <<
"\\ingroup attributions-" << package.qdocModule <<
"\n";
67 out <<
"\\page " << package.qdocModule <<
"-attribution-" << package.id
69 out <<
"\\attribution\n";
71 out <<
"\\page " << package.qdocModule <<
"-attribution-" << package.id
75 out <<
"\\target " << package.id <<
"\n\n";
76 out <<
"\\title " << package.name;
77 if (!package.version.isEmpty())
78 out <<
", version " << package.version;
79 out <<
"\n\n\\brief " << package.license <<
"\n\n";
81 if (!package.description.isEmpty())
82 out << package.description <<
"\n\n";
84 if (!package.qtUsage.isEmpty())
85 out << package.qtUsage <<
"\n\n";
87 QStringList sourcePaths;
88 if (package.files.isEmpty()) {
89 sourcePaths << baseDir.relativeFilePath(package.path);
91 const QDir packageDir(package.path);
92 for (
const QString &filePath: package.files) {
93 const QString absolutePath = packageDir.absoluteFilePath(filePath);
94 sourcePaths << baseDir.relativeFilePath(absolutePath);
98 out <<
"The sources can be found in " << languageJoin(sourcePaths) <<
".\n\n";
100 const bool hasPackageVersion = !package.version.isEmpty();
101 const bool hasPackageDownloadLocation = !package.downloadLocation.isEmpty();
102 if (!package.homepage.isEmpty()) {
103 out <<
"\\l{" << package.homepage <<
"}{Project Homepage}";
104 if (hasPackageVersion)
107 if (hasPackageVersion) {
108 out <<
"upstream version: ";
109 if (hasPackageDownloadLocation)
110 out <<
"\\l{" << package.downloadLocation <<
"}{";
111 out << package.version;
112 if (hasPackageDownloadLocation)
119 if (!package.copyright.isEmpty())
120 copyright = package.copyright;
121 else if (!package.copyrightFileContents.isEmpty())
122 copyright = package.copyrightFileContents;
124 if (!copyright.isEmpty()) {
126 sourceCode(out, copyright);
129 if (isSpdxLicenseId(package.licenseId) && !package.licenseId.startsWith(
"LicenseRef-"_L1)
130 && package.licenseId !=
"NONE"_L1) {
131 out <<
"\\l{https://spdx.org/licenses/" << package.licenseId <<
".html}"
132 <<
"{" << package.license <<
"}.\n\n";
134 out << package.license <<
".\n\n";
137 for (
const QString &license : package.licenseFilesContents)
138 sourceCode(out, license);
143void generate(QTextStream &out,
const QList<Package> &packages,
const QString &baseDirectory,
146 if (logLevel == VerboseLog)
147 std::cerr << qPrintable(tr(
"Generating qdoc file...")) << std::endl;
149 QDir baseDir(baseDirectory);
150 for (
const Package &package : packages)
151 generate(out, package, baseDir);