diff options
| author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2025-09-11 23:00:04 +0300 |
|---|---|---|
| committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2025-09-11 23:00:04 +0300 |
| commit | 5af4140d3e6a33ffdee92f612ff90ef100f86fd1 (patch) | |
| tree | f4a24cb00ad26b51d5ce988f55a88a5f807eb2b5 | |
| parent | 17273547f1b0f6fd662b42b74c3995b8966e2f54 (diff) | |
| parent | 74527fbdeeceee1dc2aae12eee92f7ac11a9854c (diff) | |
Merge tag 'v6.2.13-lts-lgpl' into 6.26.2
Qt 6.2.13-lts-lgpl release
Conflicts solved:
src/tools/ifcodegen/CMakeLists.txt
Change-Id: I2cbe737facca762b2d3d98082f2bba4c62fb47a9
| -rw-r--r-- | .cmake.conf | 2 | ||||
| -rw-r--r-- | dependencies.yaml | 8 | ||||
| m--------- | src/3rdparty/qface | 0 | ||||
| -rw-r--r-- | src/tools/ifcodegen/CMakeLists.txt | 2 | ||||
| -rwxr-xr-x | src/tools/ifcodegen/generate.py | 89 | ||||
| -rw-r--r-- | src/tools/ifcodegen/generator/rule_generator.py | 2 |
6 files changed, 93 insertions, 10 deletions
diff --git a/.cmake.conf b/.cmake.conf index 897ec4a3..b7810022 100644 --- a/.cmake.conf +++ b/.cmake.conf @@ -1 +1 @@ -set(QT_REPO_MODULE_VERSION "6.2.12") +set(QT_REPO_MODULE_VERSION "6.2.13") diff --git a/dependencies.yaml b/dependencies.yaml index 35a09338..b93c3943 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -1,13 +1,13 @@ dependencies: ../tqtc-qtdeclarative: - ref: a7c766a9863605eb81e8f0cdb4d2b93e087b5bde + ref: c6fdadd916a7568c1d71b750e054ca9aa2fd5dfc required: true ../tqtc-qtmultimedia: - ref: 4d5cab73c0ca3c5f4cb486ca5297724ceba52e6f + ref: 1180358ed7d621c1ff696dda397f130c2183e94e required: true ../tqtc-qtremoteobjects: - ref: 4cf461596e01645c789ba6544fc79f47be151828 + ref: b39a3f2935d79c3f5c973e136c7508a44082da45 required: true ../tqtc-qttools: - ref: a78a36d69a792ae66fc062e461b83c28152a6856 + ref: d000041a232a428ba08e31323840d484642f5886 required: false diff --git a/src/3rdparty/qface b/src/3rdparty/qface -Subproject 2459064b0ca85c5fb19cc2a83cc2110be6da4a0 +Subproject c3f6a42e899c1bc1cc3d5343e6151d09d91eea6 diff --git a/src/tools/ifcodegen/CMakeLists.txt b/src/tools/ifcodegen/CMakeLists.txt index 317d77f5..68aaa76a 100644 --- a/src/tools/ifcodegen/CMakeLists.txt +++ b/src/tools/ifcodegen/CMakeLists.txt @@ -101,7 +101,7 @@ if(QT_FEATURE_python3_virtualenv AND NOT QT_FEATURE_system_qface) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/.stamp-generator-verified ${CMAKE_CURRENT_BINARY_DIR}/.stamp-cmake-rerun - COMMAND ${VIRTUALENV_PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/verify_generator.py + COMMAND ${CMAKE_COMMAND} -E env IFGENERATOR_CONFIG=${CMAKE_CURRENT_BINARY_DIR}/.config ${VIRTUALENV_PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/generate.py --selfcheck COMMAND ${CMAKE_COMMAND} -E touch .stamp-generator-verified COMMAND ${CMAKE_COMMAND} -E touch .stamp-cmake-rerun DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/.stamp-deploy_virtualenv diff --git a/src/tools/ifcodegen/generate.py b/src/tools/ifcodegen/generate.py index 853e926d..ee5f7b62 100755 --- a/src/tools/ifcodegen/generate.py +++ b/src/tools/ifcodegen/generate.py @@ -35,7 +35,8 @@ import sys import fnmatch import click import logging.config -from path import Path +import tempfile +from pathlib import Path from qface.generator import FileSystem, Generator from qface.watch import monitor @@ -46,7 +47,7 @@ import generator.global_functions as global_functions from generator.filters import register_filters from generator.rule_generator import CustomRuleGenerator -here = Path(__file__).dirname() +here = Path(__file__).parent log = logging.getLogger(__file__) @@ -181,6 +182,86 @@ def run(template_search_paths, template, moduleConfig, annotations, imports, src exit(1) +def self_check(ctx, param, value): + if not value or ctx.resilient_parsing: + return + click.echo('Running self check') + + try: + # Parse the .config file and throw an error in case it doesn't exist or it is invalid + builtin_config.parse(here) + + tmpDir = tempfile.TemporaryDirectory() + tmp = Path(tmpDir.name) + with open(tmp / "test.qface", 'w') as file: + # Write content to the file + file.write(""" + module org.selftest 1.0 + + interface Echo { + string stringProperty + bool boolProperty + TestEnum enumProperty + TestStruct structProperty + string echo(string msg); + } + + enum TestEnum { + value1, + value2 + } + + struct TestStruct { + int testInt + string testString + } + """) + + with open(tmp / "selfcheck.yaml", 'w') as file: + # Write content to the file + file.write(""" + test: + module: + documents: + - "{{srcBase|lower}}": "module.tpl" + interface: + documents: + - 'tst_{{interface|lower}}': 'interface.tpl' + """) + + os.mkdir(tmp / "selfcheck") + with open(tmp / "selfcheck/module.tpl", 'w') as file: + # Write content to the file + file.write(""" + {{module.name}} + """) + + with open(tmp / "selfcheck/interface.tpl", 'w') as file: + # Write content to the file + file.write(""" + {{interface.name}} + """) + + run([tmp], 'selfcheck', {"module": "org.selftest", "force": True}, [], [], [tmp / "test.qface"], tmp) + click.echo('Self check finished successfully.') + except Exception as e: + raise SystemExit(""" + Self check failed! + + This might be caused by a too recent python version or + too recent python packages. + If this happens when building the qtinterfaceframework, + you can try installing older python packages by + running configure again with the following option: + + -DQT_USE_MINIMAL_QFACE_PACKAGES=TRUE + + The python error was: + + {} + """.format(e)) + ctx.exit() + @click.command() @click.option('--reload/--no-reload', default=False, help= 'Specifies whether the generator should keep track of the changes in the IDL file and update ' @@ -206,6 +287,9 @@ def run(template_search_paths, template, moduleConfig, annotations, imports, src 'scanned recursively for QFace files. The QFace files found are then used to resolve ' 'the information required when importing a module; this is similar to how C++ include ' 'paths work.') +@click.option('--selfcheck', is_flag=True, default=False, callback=self_check, expose_value=False, is_eager=True, help= + 'Runs a self check using a builtin qface file and template to verify that the generator is ' + 'working correctly. ') @click.argument('src', nargs=-1, type=click.Path(exists=True)) @click.argument('dst', nargs=1, type=click.Path(exists=True)) @@ -230,6 +314,5 @@ def app(src, dst, template_search_paths, template, reload, module, force, annota } run(template_search_paths, template, moduleConfig, annotations, imports, src, dst) - if __name__ == '__main__': app() diff --git a/src/tools/ifcodegen/generator/rule_generator.py b/src/tools/ifcodegen/generator/rule_generator.py index 5d95afbf..902b9e00 100644 --- a/src/tools/ifcodegen/generator/rule_generator.py +++ b/src/tools/ifcodegen/generator/rule_generator.py @@ -31,7 +31,7 @@ import click import logging.config import sys import yaml -from path import Path +from pathlib import Path from qface.generator import RuleGenerator from qface.idl.domain import Module, Interface, Property, Parameter, Field, Struct |
