summaryrefslogtreecommitdiff
path: root/src/qdoc/qdoccommandlineparser.h
Commit message (Collapse)AuthorAgeFilesLines
* QDoc: Move QDoc source files under a further "qdoc" directoryLuca Di Sera2023-04-121-28/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDoc development under the "qttools" repository is currently performed under the "src/qdoc" directory, which contains all source files and directories relevant to QDoc as direct children. Due to a slow restructuring of how QDoc works, what its dependencies are and certain possible architectural changes, the infrastructure that is expected to be required for the development of QDoc might increase. Some of that infrastructure, which might require some custom effort, is expected to be developed as "independent" "library-like" sub-projects, which QDoc depends on. Albeit developed "independently", such infrastructure would be developed specifically for QDoc and thus should live "adjacent" to it. To allow such a structure a new "qdoc" directory was added under the "src/qdoc" directory. All source files and directory that were previously children of the "src/qdoc" directory were moved under the new "qdoc" directory. This preserves the space for QDoc-related elements and the relative project structure while allowing some space for "adjacent" projects that are intended for QDoc specifically. To support the change, a new "CMakeLists.txt" file was introduced under "src/qdoc", which dispatches to the "CMakeLists.txt" file in the new "src/qdoc/qdoc" directory. QDoc is only built when certain dependencies are found. This is supported through the use of Qt features at the CMake level. The "CMakeLists.txt" file in "src", thus dispatched to the "src/qdoc" directory only when the required features were found. As "independent", "library-like", entities might not have the same requirements as QDoc, the "CMakeLists.txt" file in "src" was modified to always dispatch to the "src/qdoc" directory while the features-check was moved to the new "CMakeLists.txt" files in "src/qdoc", so as to allow non-QDoc but QDoc-specific project to have an independent configuration for building. Certain test projects in "test/auto/qdoc/" depends on QDoc-specific source-files to generate their CMake targets. Those dependencies were generally specified as relative paths. The additional level in the directory structure invalidated the paths and, hence, the relevant "CMakeLists.txt" files for those projects were modified to correctly refer to the new directory structure. Change-Id: I50c7106614428753544eaba5091e1e44d48fd31d Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-191-27/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: I5335388c0472b0ee554234fc7eca60769e504660 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QDoc: Add an option to inspect the intermediate Atom representationLuca Di Sera2021-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QDoc parses a block-comment, it produces an intermediate representation of `Atom` types that is later used as the processing base to generate the required output. To ease the process of inspecting this representation for debugging or learning purposes, a new command-line-option, `atoms-dump`, was added. When `atoms-dump` is passed as an argument, QDoc will print a human-readable `Atom`s structure for each block-comment that is parsed during its execution. The information is printed in `Doc::Doc`, the only call location for `DocParser::parse`, along with information about the starting and ending location of the relevant block-comment. A previously unused function, `Text::dump`, centralizes the logic of generating a human-readable form and the action of outputting it. `Text::dump` was slightly modified to emphasize the relation between consecutive atoms enclosed in a block-like structure, such as those between a `ParaLeft` and `ParaRight` atom. An unused function, `Atom::dump`, was removed. The function duplicated parts of the code of `Text::dump`, but for a single atom. To avoid spreading the surface of side-effecting functions and to avoid splitting the responsibility of formatting atoms in a human-readable-form, the function was not used as part of `Text::dump` and was, hence, removed as superfluous instead. Fixes: QTBUG-97775 Change-Id: If2933139575f97640e87f27c8ab1dbcbf7d14171 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc: Remove unused code in htmlgeneratorPaul Wicking2020-06-051-1/+1
| | | | | | | | | | Also remove the code in Config and subsequently QDocCommandLineParser that becomes unused after the removal in htmlgenerator. Task-number: QTBUG-79116 Change-Id: I0e821d695ed87dfdd0f81316b15f0978cf8efe25 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QDoc: remove writeQApagesPaul Wicking2020-03-261-2/+1
| | | | | | | | | | | QA pages were used as part of debugging qdoc's behavior in the past. As it is no longer used or maintained, get rid of the code and the related documentation in QDoc Manual. [ChangeLog][qdoc] QDoc no longer writes QA pages. Change-Id: I4ec9a9a83e98aa13af231893e0977c6a2336b988 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Implement DocBook support for qdocThibaut Cuvelier2020-01-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The use of this code would be to overhaul the translation project of the documentation in French, for Developpez.com (which is now stuck at Qt 4.7 due to outdated tools: https://qt.developpez.com/doc/). This means that this code will be used and maintained, whatever the decision follows QTBUG-71493, for instance. The DocBook support is not 100% vanilla DocBook, as some tags are missing, but rather an extension (which could be officialised soon: https://github.com/docbook/docbook/issues/111). These tags are used to encode metadata about the code being commented (classes, fields, functions, etc.). More precisely, the required tags are: [enum|macro|namespace|typedef|union][|name|synopsis], enum[value|identifier|item], [specialized]template[id]. These extensions can be enabled by the docbook-extensions parameter. If you want to see the history: https://github.com/dourouc05/qttools/tree/dourouc05-qdoc-docbook Change-Id: I919976d8680b41c5ca69bdb79a0b824c29b89d05 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io>
* QDoc: remove unused includePaul Wicking2019-08-231-2/+0
| | | | | | | Should have been removed previously, got left out by mistake. Change-Id: I2b9c00998eaf3cebedb05d045e569a2724feb5d9 Reviewed-by: Martin Smith <martin.smith@qt.io>
* QDoc: Remove QDocCommandLineParser's dependency on QDocGlobalsPaul Wicking2019-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | This change moves a large chunk of code from QDocCommandLineParser::process() to a new method in QDocGlobals, setOptions(), which takes a QDocCommandLineParser and updates QDocGlobals accordingly. Two convenience methods are added to aid in setting these parameters. The change also removes the empty constructor in QDocGlobals, as it isn't needed. By now, QDocCommandLineParser no longer has external dependencies and can therefore easily be unit-tested. Task-number: QTBUG-71165 Task-number: QTBUG-71176 Change-Id: If67c841c3b0a2dbcc444bec92177e27e62288e6c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QDoc: Clarify dependency between QDocCommandLineParser and ConfigPaul Wicking2019-08-141-5/+3
| | | | | | | | | | | | | | | | This change removes QDocCommandLineParser's dependency on the Config class, and moves the responsibility of setting configuration values to Config. This is done by turning QDocCommandLineParser into a struct, and making the QCommandLineOptions in it public. In Config, the new setOptions() method takes a QDocCommandLineParser from which it reads the values it needs. This moves QDocCommandLineParser one step closer to being easy to test. Task-number: QTBUG-71176 Change-Id: I2ee6e8cb6f5ff0f5d70a298ac99e3521a6f98ad9 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QDoc: Ensure all includes are uniform and according to stylePaul Wicking2019-08-031-1/+1
| | | | | | | | | | | | | | | | | | | Housekeeping. Includes are organized after recommended best practice and organized in the following order: - include self (i.e. include own header) - include local files - include Qt, e.g. <QtCore/qstring.h> - include Qt private - include externals, e.g. stdio.h in alphabetic order within each block, aside from accommodating #if-ery, in which includes follow the block they belong to. Also, updated copyright notice to year of latest edit in each file. Change-Id: I1e6b215f172fd5373d57016f7678b88b9e73231e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QDoc: Clean up includes in QDocCommandLineParserPaul Wicking2019-07-301-1/+1
| | | | | Change-Id: I9f032c1fce066655ea0573af4715540fe0dce9fe Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* QDoc: make the Config a parameter instead of a globalPaul Wicking2019-07-261-2/+4
| | | | | | | | | | | | | | | | | | | | | This shall make it easier to test QDoc, by making mocking possible. This change moves the instantiation of Config:: to reside inside main(), so that it can be passed as a parameter where it is needed. This object is then passed to QDocCommandLineParser::process(), so that it can be changed via the object itself rather than via statics/globals. This improves the testability of the QDocCommandLineParser class, as the Config object can easily be mocked. This change also replaces a couple of foreach() uses in main.cpp with range-based for. Task-number: QTBUG-71165 Task-number: QTBUG-71176 Change-Id: I7b98dfc36895cd88fe54dcc9ce31b75aab820b3b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QDoc: Accept command-line arguments from @-filesPaul Wicking2019-07-251-1/+1
| | | | | | | | | | | | | | | | | | This enables QDoc to read files given as command-line arguments that are prepended with '@'. Such a file can include any and all valid command-line arguments. Specifically, this lets the build system pass include paths as a file, which may be a requirement in certain Windows environments due to a platform limitation. argumentsFromCommandLineAndFile() was shamelessly stolen from moc. As adding unit tests here basically calls for refactoring the qdocCommandLineParser class, it was decided to test this in production. As it works for moc, the assumption is that it will work also for QDoc. Task-number: QTBUG-68259 Change-Id: I71698f6514b1343f0a99e7deef82857c1739742e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* qdoc: Make timestamps in LOG lines opt inMartin Smith2019-03-191-0/+1
| | | | | | | | | | | | | | | | Beginning in 5.13, qdoc prints log lines in the the qdoc warning and error output that tell the reader what qdoc is doing. These can help the reader quickly see where qdoc is working when it prints warnings and errors. Each LOG line also included a timestamp, which was useful for measuring how much time qdoc was using in each phase of each module. But these timestamps made diffing sequential log files difficult, so the timestamps are now removed. They can be enabled for debugging qdoc by adding -timestamps to the qdoc commandline. Change-Id: I55ae24e642757eed2cb57028bd22626b6efc82f9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io>
* QDoc: Refactor command line parser class out of main.cppPaul Wicking2018-10-121-0/+55
Move command line parser class out of main. Fix bug in QDocGlobals that caused include paths to break, by pushing one instead of two strings into a stringlist. Change-Id: I08b7eb02f1e3cf6e9ad33dc24322886ca2dc2fcd Reviewed-by: Martin Smith <martin.smith@qt.io>