aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/build_plugin.py
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2025-06-13 15:41:08 +0200
committerEike Ziller <eike.ziller@qt.io>2025-06-17 15:13:23 +0000
commitef02bd8ea93711be1d77b3dab9547e344281b266 (patch)
tree21ed25da9d854e0f66f0387714651209aa73ba6f /scripts/build_plugin.py
parentc028858639c5ca97f237311b50635bf2a4e74ec7 (diff)
Scripts: Handle "nothing installed" case gracefully for plugin builds
When (temporarily) turning off the QmlDesigner build, the separate QmlDesigner plugin repository build results in nothing being installed. The 7zip call and signing code then fails if the installation directory isn't even created as a consequence. Change-Id: I14cc9504b6a5d653ab94845423e266d2cb8caf42 Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'scripts/build_plugin.py')
-rwxr-xr-xscripts/build_plugin.py25
1 files changed, 16 insertions, 9 deletions
diff --git a/scripts/build_plugin.py b/scripts/build_plugin.py
index 81d80bd2561..6a7c0ac4a40 100755
--- a/scripts/build_plugin.py
+++ b/scripts/build_plugin.py
@@ -142,6 +142,8 @@ def build(args, paths):
paths.build)
def package(args, paths):
+ if not os.path.exists(paths.install):
+ os.makedirs(paths.install)
if not os.path.exists(paths.result):
os.makedirs(paths.result)
if common.is_windows_platform() and args.sign_command:
@@ -165,15 +167,20 @@ def package(args, paths):
if os.environ.get('SIGNING_IDENTITY'):
signed_install_path = paths.install + '-signed'
common.copytree(paths.install, signed_install_path, symlinks=True)
- apps = [d for d in os.listdir(signed_install_path) if d.endswith('.app')]
- if apps:
- app = apps[0]
- common.conditional_sign_recursive(os.path.join(signed_install_path, app),
- lambda ff: ff.endswith('.dylib'))
- common.check_print_call(zip
- + [os.path.join(paths.result, args.name + '-signed.7z'),
- app],
- signed_install_path)
+ zippattern = None
+ if os.path.exists(signed_install_path):
+ apps = [d for d in os.listdir(signed_install_path) if d.endswith('.app')]
+ if apps:
+ zippattern = apps[0]
+ if not zippattern:
+ os.makedirs(signed_install_path) # if nothing was installed
+ zippattern = '*'
+ common.conditional_sign_recursive(signed_install_path,
+ lambda ff: ff.endswith('.dylib'))
+ common.check_print_call(zip
+ + [os.path.join(paths.result, args.name + '-signed.7z'),
+ zippattern],
+ signed_install_path)
def get_paths(args):
Paths = collections.namedtuple('Paths',