diff options
author | Ivan Komissarov <abbapoh@gmail.com> | 2020-12-18 01:17:50 +0100 |
---|---|---|
committer | Ivan Komissarov <abbapoh@gmail.com> | 2020-12-18 01:19:13 +0100 |
commit | 0b23c1f139a00643521b35f77acfa333b4073194 (patch) | |
tree | d05c959e57403c0190fad46133784b3e77f89a18 /doc | |
parent | d3d49f4167e72f3a91d349b36ce95a415234e9d1 (diff) | |
parent | 9e9caf2268fd75f4bddd74084afcc7ba27fe5d2e (diff) |
Merge branch '1.18'
Change-Id: I37c359289dcd957fbc964a35fab381a047f7d04a
Diffstat (limited to 'doc')
-rw-r--r-- | doc/CMakeLists.txt | 84 | ||||
-rw-r--r-- | doc/appendix/json-api.qdoc | 4 | ||||
-rw-r--r-- | doc/doc.qbs | 6 | ||||
-rw-r--r-- | doc/qbs.qdoc | 38 | ||||
-rw-r--r-- | doc/reference/modules/bundle-module.qdoc | 12 |
5 files changed, 122 insertions, 22 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt new file mode 100644 index 000000000..74d71f4dc --- /dev/null +++ b/doc/CMakeLists.txt @@ -0,0 +1,84 @@ +if (QBS_INSTALL_HTML_DOCS OR QBS_INSTALL_QCH_DOCS) + + find_package(Python3 COMPONENTS Interpreter) + + function(find_python_module module) + string(TOUPPER ${module} module_upper) + if (NOT PY_${module_upper}) + if (ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED") + set(${module}_FIND_REQUIRED TRUE) + endif() + # A module's location is usually a directory, but for binary modules + # it's a .so file. + execute_process(COMMAND "${Python3_EXECUTABLE}" "-c" + "import re, ${module}; print(re.compile('/__init__.py.*').sub('',${module}.__file__))" + RESULT_VARIABLE _${module}_status + OUTPUT_VARIABLE _${module}_location + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) + if (NOT _${module}_status) + set(PY_${module_upper} ${_${module}_location} CACHE STRING + "Location of Python module ${module}") + endif() + endif() + find_package_handle_standard_args(PY_${module} DEFAULT_MSG PY_${module_upper}) + endfunction() + + if (Python3_Interpreter_FOUND) + find_python_module(lxml) + find_python_module(bs4) + if (PY_LXML AND PY_BS4) + + get_target_property(_QBS_OUTPUT_DIR qbs RUNTIME_OUTPUT_DIRECTORY) + + if (QBS_INSTALL_HTML_DOCS) + set(_INSTALL_HTML_DOCS true) + else() + set(_INSTALL_HTML_DOCS false) + endif() + + if (QBS_INSTALL_QCH_DOCS) + set(_INSTALL_QCH_DOCS true) + else() + set(_INSTALL_QCH_DOCS false) + endif() + + get_target_property(_QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) + get_update_path_command(UPDATE_PATH_COMMAND) + add_custom_target( + BuildQbsDocumentation ALL + COMMAND ${UPDATE_PATH_COMMAND} + COMMAND ${_QBS_OUTPUT_DIR}/qbs + resolve + --settings-dir ${PROJECT_BINARY_DIR}/settings + -f ${PROJECT_SOURCE_DIR}/qbs.qbs + -d ${PROJECT_BINARY_DIR}/ + config:doc-build + qbs.installPrefix:undefined + qbs.buildVariant:release + project.withCode:false + project.withDocumentation:true + profile:none + "products.qbs documentation.pythonPath:${Python3_EXECUTABLE}" + modules.qbsbuildconfig.installHtml:${_INSTALL_HTML_DOCS} + modules.qbsbuildconfig.installQch:${_INSTALL_QCH_DOCS} + moduleProviders.Qt.qmakeFilePaths:${_QT_QMAKE_EXECUTABLE} + COMMAND ${_QBS_OUTPUT_DIR}/qbs + build + --settings-dir ${PROJECT_BINARY_DIR}/settings + -f ${PROJECT_SOURCE_DIR}/qbs.qbs + -d ${PROJECT_BINARY_DIR}/ + config:doc-build + -p "qbs documentation" + DEPENDS qbs copy-runtime-files-qbs qbs_processlauncher + ) + install( + DIRECTORY ${PROJECT_BINARY_DIR}/doc-build/install-root/share/doc/qbs/html/ + DESTINATION "${QBS_DOC_INSTALL_DIR}" + ) + else() + message(WARNING "Cannot import lxml and bs4 python modules. Qbs documentation will not be built.") + endif() + else() + message(WARNING "Cannot find python3 binary. Qbs documentation will not be built.") + endif() +endif() diff --git a/doc/appendix/json-api.qdoc b/doc/appendix/json-api.qdoc index 959b30bb7..78e359017 100644 --- a/doc/appendix/json-api.qdoc +++ b/doc/appendix/json-api.qdoc @@ -628,8 +628,8 @@ \row \li version \li string \endtable - The \c dependencies are the names of products that occur in the (enabled) - \l Depends items of this product. + The elements of the \c dependencies array correspond to the full-display-name + properties of the products that this product has pulled in via \l Depends items. The \c generated-artifacts are files that are created by the \l{Rule}{rules} in this product. diff --git a/doc/doc.qbs b/doc/doc.qbs index 8d7da8d04..8ab6cfdb9 100644 --- a/doc/doc.qbs +++ b/doc/doc.qbs @@ -21,7 +21,7 @@ Project { id: pythonProbe names: ["python3", "python"] // on Windows, there's no python3 } - property string _pythonExe: pythonProbe.found ? pythonProbe.filePath : undefined + property string pythonPath: pythonProbe.found ? pythonProbe.filePath : undefined files: [ "../README.md", @@ -66,11 +66,11 @@ Project { outputFileTags: ["qdoc-html", "qbsdoc.dummy"] // TODO: Hack. Rule injection to the rescue? outputArtifacts: [{filePath: "dummy", fileTags: ["qbsdoc.dummy"]}] prepare: { - if (!product._pythonExe) + if (!product.pythonPath) throw "Python executable was not found"; var scriptPath = explicitlyDependsOn["qbsdoc.fiximports"][0].filePath; var htmlDir = FileInfo.path(FileInfo.path(inputs["qdoc-png"][0].filePath)); - var fixCmd = new Command(product._pythonExe, [scriptPath, htmlDir]); + var fixCmd = new Command(product.pythonPath, [scriptPath, htmlDir]); fixCmd.description = "fixing bogus QML import statements"; return [fixCmd]; } diff --git a/doc/qbs.qdoc b/doc/qbs.qdoc index 217e41e7c..656a1245d 100644 --- a/doc/qbs.qdoc +++ b/doc/qbs.qdoc @@ -299,25 +299,39 @@ \section2 IDE Integration \QBS can be used not only from the command line, but also in combination - with an IDE, such as Qt Creator, Microsoft Visual Studio, or Xcode. - Qt Creator directly supports \QBS projects. Visual Studio and Xcode users - can use \QBS to generate Microsoft Visual Studio and Xcode projects. - For more information, see \l {Generators}. + with an IDE, such as Qt Creator or Visual Studio Code. These IDEs directly + support \QBS projects using the new \QBS + {https://doc.qt.io/qbs/cli-session.html}{session} feature. Thus, these IDEs + can retrieve all the information required to build a single file or project + through a session's JSON protocol {https://doc.qt.io/qbs/json-api.html}{API}. + + In addition, \QBS can generate projects for Visual Studio, IAR EW, and + Keil uVision, but it still is an experimental option. For more information, + see \l {Generators}. \section3 Qt Creator - \l{http://doc.qt.io/qtcreator/index.html}{Qt Creator} uses the same \QBS - library as the \QBS command line tools. Therefore, it can retrieve all the - information required to build a single file or project through a defined - public API. Qt Creator provides accurate information about the build - progress and displays a project tree that reflects the logical structure of - the project, instead of presenting low-level information, such as the file - system structure. Adding or removing source files keeps the existing project - file structure intact. + \l{http://doc.qt.io/qtcreator/index.html}{Qt Creator} provides accurate + information about the build progress and displays a project tree that + reflects the logical structure of the project, instead of presenting low-level + information, such as the file system structure. Adding or removing source + files keeps the existing project file structure intact. For more information about using \QBS to build projects from Qt Creator, see \l{http://doc.qt.io/qtcreator/creator-project-qbs.html}{Setting Up Qbs}. + \section3 Visual Studio Code + + \l{https://code.visualstudio.com/}{Visual Studio Code} provides the + {https://marketplace.visualstudio.com/items?itemName=qbs-community.qbs-tools} + {qbs-community} plugin that provides accurate information about the build progress + and displays a project tree that reflects the logical structure of the project. + Also, it can provide low-level information, such as the file system structure. + + For more information about using \QBS to build projects from Visual Studio Code, + see \l{https://github.com/denis-shienkov/vscode-qbs/blob/master/docs/how-to.md} + {How To}. + \section1 Build Process \image qbs-build-process.png diff --git a/doc/reference/modules/bundle-module.qdoc b/doc/reference/modules/bundle-module.qdoc index e3c21cd3c..4184672b4 100644 --- a/doc/reference/modules/bundle-module.qdoc +++ b/doc/reference/modules/bundle-module.qdoc @@ -96,8 +96,9 @@ A prefix for the product's bundle identifier. If \l{bundle::}{identifier} is left unset, the bundle identifier will be a concatenation of this value - and the \l{bundle::}{identifier} property, separated by a period (.). This - corresponds to the organization identifier in Xcode. + and the \l{Product::targetName}{Product.targetName} property formatted as + an RFC-1034 identifier, separated by a period (.). This corresponds to the + organization identifier in Xcode. \defaultvalue \c{org.example} */ @@ -106,8 +107,9 @@ \qmlproperty string bundle::identifier The bundle's identifier. If left unset, the bundle identifier will be a - concatenation of this value and the \l{bundle::}{identifierPrefix} property, - separated by a period (.). + concatenation of the \l{bundle::}{identifierPrefix} value and the + \l{Product::targetName}{Product.targetName} propertyy formatted as an + RFC-1034 identifier, separated by a period (.). \defaultvalue A combination of \l{bundle::}{identifierPrefix} and the product's target name formatted as an RFC-1034 identifier. @@ -204,7 +206,7 @@ */ /*! - \qmlproperty bool bundle::resources + \qmlproperty pathList bundle::resources A list of resources to copy to a bundle's \c Resources subdirectory. Files will automatically be copied into \c lproj subdirectories corresponding to |