summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-10-29 09:57:19 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2019-10-29 09:28:26 +0000
commit3e5e7b82012b99231492f48a202044369cb76c0d (patch)
tree7313f0a3a3442d359fdf5782709717a5f038622f /util
parent0cab837fd7af5511338c42e46aaaa49b070a3da8 (diff)
Fix formatting to conform to black rules
Ran make format. Change-Id: Ib4fc021c30834a69a9a5df653435dd92dc6a9c05 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-xutil/cmake/configurejson2cmake.py2
-rwxr-xr-xutil/cmake/pro2cmake.py36
2 files changed, 14 insertions, 24 deletions
diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py
index 0b91a8befd..70d28c276b 100755
--- a/util/cmake/configurejson2cmake.py
+++ b/util/cmake/configurejson2cmake.py
@@ -605,8 +605,6 @@ endif()
continue
library_list.append(mapped_library.targetName)
-
-
cm_fh.write(f"qt_config_compile_test({featureName(test)}\n")
cm_fh.write(lineify("LABEL", data.get("label", "")))
if librariesCmakeName != "" or len(library_list) != 0:
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py
index 6058c15106..ec13f26fbd 100755
--- a/util/cmake/pro2cmake.py
+++ b/util/cmake/pro2cmake.py
@@ -998,7 +998,6 @@ class Scope(object):
for op in self._operations.get(key, []):
result = op.process(key, result, op_transformer)
-
return result
def get(self, key: str, *, ignore_includes: bool = False, inherit: bool = False) -> List[str]:
@@ -1269,10 +1268,10 @@ def map_condition(condition: str) -> str:
condition = condition.replace("|", " OR ")
# new conditions added by the android multi arch qmake build
- condition = re.sub(r'(^| )x86([^\_]|$)', "TEST_architecture_arch STREQUAL x86", condition)
- condition = re.sub(r'(^| )x86_64', " TEST_architecture_arch STREQUAL x86_64", condition)
- condition = re.sub(r'(^| )arm64-v8a', "TEST_architecture_arch STREQUAL arm64", condition)
- condition = re.sub(r'(^| )armeabi-v7a', "TEST_architecture_arch STREQUAL arm", condition)
+ condition = re.sub(r"(^| )x86([^\_]|$)", "TEST_architecture_arch STREQUAL x86", condition)
+ condition = re.sub(r"(^| )x86_64", " TEST_architecture_arch STREQUAL x86_64", condition)
+ condition = re.sub(r"(^| )arm64-v8a", "TEST_architecture_arch STREQUAL arm64", condition)
+ condition = re.sub(r"(^| )armeabi-v7a", "TEST_architecture_arch STREQUAL arm", condition)
cmake_condition = ""
for part in condition.split():
@@ -2054,9 +2053,7 @@ def write_extend_target(cm_fh: IO[str], target: str, scope: Scope, indent: int =
condition = map_to_cmake_condition(scope.total_condition)
extend_scope = (
- f"\n{ind}extend_target({target} CONDITION"
- f" {condition}\n"
- f"{extend_qt_string}{ind})\n"
+ f"\n{ind}extend_target({target} CONDITION" f" {condition}\n" f"{extend_qt_string}{ind})\n"
)
if not extend_qt_string:
@@ -2068,10 +2065,11 @@ def write_extend_target(cm_fh: IO[str], target: str, scope: Scope, indent: int =
write_resources(io_string, target, scope, indent + 1)
resource_string = io_string.getvalue()
if len(resource_string) != 0:
- resource_string = resource_string.strip('\n').rstrip(f'\n{spaces(indent + 1)}')
+ resource_string = resource_string.strip("\n").rstrip(f"\n{spaces(indent + 1)}")
cm_fh.write(f"\n{spaces(indent)}if({condition})\n{resource_string}")
cm_fh.write(f"\n{spaces(indent)}endif()\n")
+
def flatten_scopes(scope: Scope) -> List[Scope]:
result = [scope] # type: List[Scope]
for c in scope.children:
@@ -2172,7 +2170,7 @@ def write_android_part(cm_fh: IO[str], target: str, scope: Scope, indent: int =
"ANDROID_LIB_DEPENDENCY_REPLACEMENTS",
"ANDROID_BUNDLED_FILES",
"ANDROID_PERMISSIONS",
- "ANDROID_PACKAGE_SOURCE_DIR"
+ "ANDROID_PACKAGE_SOURCE_DIR",
]
has_no_values = True
@@ -2724,17 +2722,13 @@ def write_jar(cm_fh: IO[str], scope: Scope, *, indent: int = 0) -> str:
android_sdk_jar = "${QT_ANDROID_JAR}"
android_api_level = scope.get_string("API_VERSION")
if android_api_level:
- cm_fh.write(f'{spaces(indent)}qt_get_android_sdk_jar_for_api("{android_api_level}" android_sdk)\n\n')
- android_sdk_jar ="${android_sdk}"
+ cm_fh.write(
+ f'{spaces(indent)}qt_get_android_sdk_jar_for_api("{android_api_level}" android_sdk)\n\n'
+ )
+ android_sdk_jar = "${android_sdk}"
write_source_file_list(
- cm_fh,
- scope,
- "",
- ["JAVASOURCES"],
- indent=indent,
- header=f"set(java_sources\n",
- footer=")\n",
+ cm_fh, scope, "", ["JAVASOURCES"], indent=indent, header=f"set(java_sources\n", footer=")\n"
)
cm_fh.write(f"{spaces(indent)}add_jar({target}\n")
@@ -3092,9 +3086,7 @@ def handle_app_or_lib(
is_lib = scope.TEMPLATE == "lib"
is_qml_plugin = any("qml_plugin" == s for s in scope.get("_LOADED"))
is_plugin = "plugin" in config
- is_qt_plugin = (
- any("qt_plugin" == s for s in scope.get("_LOADED")) or is_qml_plugin
- )
+ is_qt_plugin = any("qt_plugin" == s for s in scope.get("_LOADED")) or is_qml_plugin
target = ""
gui = all(
val not in config for val in ["console", "cmdline"]