diff --git a/coin/instructions/coin_build_doc_tools.yaml b/coin/instructions/coin_build_doc_tools.yaml new file mode 100644 index 00000000000..b1a5c51a3ed --- /dev/null +++ b/coin/instructions/coin_build_doc_tools.yaml @@ -0,0 +1,47 @@ +type: Group +instructions: + - type: SetBuildDirectory + directory: "{{.SourceDir}}" + - type: ChangeDirectory + directory: "{{.BuildDir}}" + + - !include "{{qt/qtbase}}/prepare_building_env.yaml" + + # This tells the script where to install the doc tools, and what files the archive will contain. + - type: EnvironmentVariable + variableName: QT_CI_DOC_TOOLS_INSTALL_DIR + variableValue: "{{.BuildDir}}/doc_tools_build/install" + + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake -P {{.SourceDir}}/cmake/QtBuildStaticDocToolsScript.cmake" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to build doc tools. + enable_if: + condition: runtime + env_var: TESTED_MODULE_COIN + contains_value: qtbase + + # For non-qtbase repos, call the build script from the installed folder. + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake -P {{.Env.COIN_CMAKE_INSTALL_DIR}}/lib/cmake/Qt6/QtBuildStaticDocToolsScript.cmake" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to build doc tools. + disable_if: + condition: runtime + env_var: TESTED_MODULE_COIN + contains_value: qtbase + + - type: UploadArtifact + archiveDirectory: "{{.Env.QT_CI_DOC_TOOLS_INSTALL_DIR}}" + transferType: GenericArtifactWithName + filename: "static_doc_tools_{{.Env.TESTED_MODULE_COIN}}.tar.gz" + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to upload built doc tools. diff --git a/coin/instructions/coin_build_doc_tools_checked.yaml b/coin/instructions/coin_build_doc_tools_checked.yaml new file mode 100644 index 00000000000..b2bba88b57e --- /dev/null +++ b/coin/instructions/coin_build_doc_tools_checked.yaml @@ -0,0 +1,25 @@ +type: Group +instructions: + - type: Group + instructions: + - !include "{{qt/qtbase}}/coin_build_doc_tools.yaml" + enable_if: + condition: or + conditions: + # This is set by qtbase instructions. + - condition: runtime + env_var: QT_CI_BUILD_DOC_TOOLS + equals_value: "1" + # This could potentially bet set by non-qtbase instructions. + - condition: runtime + env_var: QT_CI_BUILD_REPO_DOC_TOOLS + equals_value: "1" +enable_if: + condition: and + conditions: + - condition: property + property: host.os + equals_property: target.os + - condition: property + property: features + contains_value: DocsGenerationV2 diff --git a/coin/instructions/coin_fetch_doc_tools.yaml b/coin/instructions/coin_fetch_doc_tools.yaml new file mode 100644 index 00000000000..a29f6f6d370 --- /dev/null +++ b/coin/instructions/coin_fetch_doc_tools.yaml @@ -0,0 +1,40 @@ +type: Group +instructions: + # This tells the script where to install the soon to be downloaded doc tools + - type: EnvironmentVariable + variableName: QT_CI_DOC_TOOLS_INSTALL_DIR + variableValue: "{{.BuildDir}}/doc_tools_build/install" + + # Define the doc tools archive name when it is built by qtbase. + - type: EnvironmentVariable + variableName: QT_CI_DOC_TOOLS_ARCHIVE_NAME + variableValue: "static_doc_tools_qtbase.tar.gz" + enable_if: + condition: runtime + env_var: QT_CI_FETCH_REPO_DOC_TOOLS + not_equals_value: "1" + + # Define the doc tools archive name when it is built by a repo other than qtbase. + - type: EnvironmentVariable + variableName: QT_CI_DOC_TOOLS_ARCHIVE_NAME + variableValue: "static_doc_tools_{{.Env.TESTED_MODULE_COIN}}.tar.gz" + enable_if: + condition: runtime + env_var: QT_CI_FETCH_REPO_DOC_TOOLS + equals_value: "1" + + # Downloads the doc tools archive and extracts it to the install directory + - type: InstallBinaryArchive + directory: "{{.Env.QT_CI_DOC_TOOLS_INSTALL_DIR}}" + regex: "{{.Env.QT_CI_DOC_TOOLS_ARCHIVE_NAME}}" + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 + + - type: AppendToEnvironmentVariable + variableName: COIN_TEST_DOCS_CONFIGURE_EXTRA_CMAKE_ARGS + variableValue: " -DQT_OPTIONAL_TOOLS_PATH={{.Env.QT_CI_DOC_TOOLS_INSTALL_DIR}}" + +enable_if: + condition: property + property: features + contains_value: DocsGenerationV2 diff --git a/coin/instructions/coin_module_build_template_v2.yaml b/coin/instructions/coin_module_build_template_v2.yaml index a07119b8d50..07c31f111b8 100644 --- a/coin/instructions/coin_module_build_template_v2.yaml +++ b/coin/instructions/coin_module_build_template_v2.yaml @@ -87,3 +87,11 @@ instructions: condition: property property: features contains_value: "DebianPackaging" + + # Normally the doc tools are only built in qtbase, but a repository can choose + # to opt into building the doc tools during the repo's build phase, instead of using + # the qtbase tools, perhaps to use a different qttools sha1. + # In that case, the repository must set the QT_CI_BUILD_REPO_DOC_TOOLS=1 environment variable + # in its module CI build phase instructions, and QT_CI_FETCH_REPO_DOC_TOOLS=1 in its test phase + # instructions. + - !include "{{qt/qtbase}}/coin_build_doc_tools_checked.yaml" diff --git a/coin/instructions/coin_qtbase_build_template_v2.yaml b/coin/instructions/coin_qtbase_build_template_v2.yaml index e7a8329ffc4..f792dbf3af3 100644 --- a/coin/instructions/coin_qtbase_build_template_v2.yaml +++ b/coin/instructions/coin_qtbase_build_template_v2.yaml @@ -78,3 +78,9 @@ instructions: condition: property property: features contains_value: "DebianPackaging" + + # Signal that qtbase should always build the doc tools (if all other requirements are met). + - type: EnvironmentVariable + variableName: QT_CI_BUILD_DOC_TOOLS + variableValue: "1" + - !include "{{qt/qtbase}}/coin_build_doc_tools_checked.yaml" diff --git a/coin/instructions/coin_test_docs_common.yaml b/coin/instructions/coin_test_docs_common.yaml index f3b7b5b2da8..429ecbe57fa 100644 --- a/coin/instructions/coin_test_docs_common.yaml +++ b/coin/instructions/coin_test_docs_common.yaml @@ -14,6 +14,12 @@ instructions: command: "cp -rfs /opt/qt-doctools/. {{.InstallDir}}" userMessageOnFailure: > Failed to create links to provisioned binaries. + enable_if: + condition: property + property: features + not_contains_value: "DocsGenerationV2" + + - !include "{{qt/qtbase}}/coin_fetch_doc_tools.yaml" - !include "{{qt/qtbase}}/prepare_building_env.yaml"