aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2022-07-28 11:48:06 +0200
committerShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2022-08-03 14:14:17 +0000
commit14eb7890394e68608d8db13daf039d7be2410a67 (patch)
treebcda30b1af61b0088b7656b75653ec400d736793
parent22bc41605a4dd18330a39f6346143ec55a7d6074 (diff)
PySideTools: Add qmlformat
- adds qmlformat Task-number: PYSIDE-2004 Change-Id: I6b5fb160d3f832317b41504184dd27586279c802 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--build_scripts/config.py2
-rw-r--r--build_scripts/platforms/unix.py2
-rw-r--r--build_scripts/platforms/windows_desktop.py2
-rw-r--r--build_scripts/wheel_files.py1
-rw-r--r--create_wheels.py1
-rw-r--r--sources/pyside-tools/CMakeLists.txt3
-rw-r--r--sources/pyside-tools/pyside_tool.py4
7 files changed, 11 insertions, 4 deletions
diff --git a/build_scripts/config.py b/build_scripts/config.py
index 285f7b0f6..25bbd0450 100644
--- a/build_scripts/config.py
+++ b/build_scripts/config.py
@@ -201,7 +201,7 @@ class Config(object):
]
_pyside_tools = ["uic", "rcc", "assistant", "designer", "linguist",
"lupdate", "lrelease", "genpyi", "metaobjectdump",
- "project", "qml", "qmltyperegistrar", "qmllint"]
+ "project", "qml", "qmltyperegistrar", "qmllint", "qmlformat"]
setup_kwargs['entry_points'] = {
'console_scripts': [f'{PYSIDE}-{tool} = {package_name}.scripts.pyside_tool:{tool}'
for tool in _pyside_tools]
diff --git a/build_scripts/platforms/unix.py b/build_scripts/platforms/unix.py
index f109732e3..ecc41ba5c 100644
--- a/build_scripts/platforms/unix.py
+++ b/build_scripts/platforms/unix.py
@@ -129,7 +129,7 @@ def prepare_packages_posix(self, _vars):
executables.extend(copydir(
"{install_dir}/bin/",
"{st_build_dir}/{st_package_name}",
- _filter=["lrelease", "lupdate", "qmllint"],
+ _filter=["lrelease", "lupdate", "qmllint", "qmlformat"],
recursive=False, _vars=_vars))
# Copying assistant/designer
executables.extend(_copy_gui_executable('assistant', _vars=_vars))
diff --git a/build_scripts/platforms/windows_desktop.py b/build_scripts/platforms/windows_desktop.py
index 9dbdd794e..6ab657a64 100644
--- a/build_scripts/platforms/windows_desktop.py
+++ b/build_scripts/platforms/windows_desktop.py
@@ -126,7 +126,7 @@ def prepare_packages_win32(self, _vars):
filters.extend(["lrelease.exe", "lupdate.exe", "uic.exe",
"rcc.exe", "qmllint.exe", "qmltyperegistrar.exe"
"assistant.exe", "designer.exe",
- "linguist.exe"])
+ "linguist.exe", "qmlformat.exe"])
copydir(
"{install_dir}/bin/",
"{st_build_dir}/{st_package_name}",
diff --git a/build_scripts/wheel_files.py b/build_scripts/wheel_files.py
index d9f2d0729..3b1914ff9 100644
--- a/build_scripts/wheel_files.py
+++ b/build_scripts/wheel_files.py
@@ -257,6 +257,7 @@ def module_QtCore() -> ModuleData:
data.extra_files.append("lrelease*")
data.extra_files.append("lupdate*")
data.extra_files.append("qmllint*")
+ data.extra_files.append("qmlformat*")
# General translations
data.translations.append("qtbase_*")
diff --git a/create_wheels.py b/create_wheels.py
index 5bf57f1d5..902232fd5 100644
--- a/create_wheels.py
+++ b/create_wheels.py
@@ -207,6 +207,7 @@ def wheel_pyside6_essentials() -> Tuple[SetupData, List[ModuleData]]:
"pyside6-qmltyperegistrar = PySide6.scripts.pyside_tool:qmltyperegistrar",
"pyside6-qmllint = PySide6.scripts.pyside_tool:qmllint",
"pyside6-qml = PySide6.scripts.pyside_tool:qml",
+ "pyside6-qmlformat = PySide6.scripts.pyside_tool:qmlformat",
],
)
diff --git a/sources/pyside-tools/CMakeLists.txt b/sources/pyside-tools/CMakeLists.txt
index 281daf68a..487228764 100644
--- a/sources/pyside-tools/CMakeLists.txt
+++ b/sources/pyside-tools/CMakeLists.txt
@@ -18,7 +18,8 @@ if(NOT NO_QT_TOOLS STREQUAL "yes")
"${LIBEXEC_PATH}/qmltyperegistrar${CMAKE_EXECUTABLE_SUFFIX}"
"${TOOLS_PATH}/lrelease${CMAKE_EXECUTABLE_SUFFIX}"
"${TOOLS_PATH}/lupdate${CMAKE_EXECUTABLE_SUFFIX}"
- "${TOOLS_PATH}/qmllint${CMAKE_EXECUTABLE_SUFFIX}")
+ "${TOOLS_PATH}/qmllint${CMAKE_EXECUTABLE_SUFFIX}"
+ "${TOOLS_PATH}/qmlformat${CMAKE_EXECUTABLE_SUFFIX}")
if (APPLE)
list(APPEND directories "${TOOLS_PATH}/Assistant.app"
diff --git a/sources/pyside-tools/pyside_tool.py b/sources/pyside-tools/pyside_tool.py
index 5e930f1e2..ad6e2b0a7 100644
--- a/sources/pyside-tools/pyside_tool.py
+++ b/sources/pyside-tools/pyside_tool.py
@@ -78,6 +78,10 @@ def qmllint():
qt_tool_wrapper("qmllint", sys.argv[1:])
+def qmlformat():
+ qt_tool_wrapper("qmlformat", sys.argv[1:])
+
+
def assistant():
qt_tool_wrapper(ui_tool_binary("assistant"), sys.argv[1:])