summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2023-03-17 13:00:34 +0100
committerEike Ziller <eike.ziller@qt.io>2023-04-11 12:01:17 +0000
commitf1fde363a080384779ccf1126d1ba4da2d11bb71 (patch)
tree9f2953e54d9ba3ab19a393792634e09fcc410da9 /scripts
parent584874f15ffccd878025057b81b4c5d82fb61936 (diff)
downloadqt-creator-f1fde363a080384779ccf1126d1ba4da2d11bb71.tar.gz
Build: Optionally sign on Windows
Add an argument to the build script that takes a signing command (path to sign is added at the end, run in cwd) Task-number: QTCREATORBUG-25740 Task-number: QTCREATORBUG-28909 Change-Id: I6d3bdf7bd9fab0ea1fc129da08cf77c9a5448b31 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build.py11
-rwxr-xr-xscripts/build_plugin.py7
2 files changed, 18 insertions, 0 deletions
diff --git a/scripts/build.py b/scripts/build.py
index d6a30a18ff..2fced683b1 100755
--- a/scripts/build.py
+++ b/scripts/build.py
@@ -8,6 +8,7 @@ from __future__ import print_function
import argparse
import collections
import os
+import shlex
import shutil
import common
@@ -43,6 +44,8 @@ def get_arguments():
# signing
parser.add_argument('--keychain-unlock-script',
help='Path to script for unlocking the keychain used for signing (macOS)')
+ parser.add_argument('--sign-command',
+ help='Command to use for signing (Windows). The installation directory to sign is added at the end. Is run in the CWD.')
# cdbextension
parser.add_argument('--python-path',
@@ -262,6 +265,14 @@ def zipPatternForApp(paths):
def package_qtcreator(args, paths):
+ if common.is_windows_platform() and args.sign_command:
+ command = shlex.split(args.sign_command)
+ if not args.no_qtcreator:
+ common.check_print_call(command + [paths.install])
+ common.check_print_call(command + [paths.wininterrupt_install])
+ if not args.no_cdb:
+ common.check_print_call(command + [paths.qtcreatorcdbext_install])
+
if not args.no_zip:
if not args.no_qtcreator:
common.check_print_call(['7z', 'a', '-mmt' + args.zip_threads,
diff --git a/scripts/build_plugin.py b/scripts/build_plugin.py
index 38d247d4d5..4f4ddfdcb0 100755
--- a/scripts/build_plugin.py
+++ b/scripts/build_plugin.py
@@ -9,6 +9,7 @@ import argparse
import collections
import glob
import os
+import shlex
import common
@@ -46,6 +47,9 @@ def get_arguments():
# signing
parser.add_argument('--keychain-unlock-script',
help='Path to script for unlocking the keychain used for signing (macOS)')
+ parser.add_argument('--sign-command',
+ help='Command to use for signing (Windows). The installation directory to sign is added at the end. Is run in the CWD.')
+
args = parser.parse_args()
args.with_debug_info = args.build_type == 'RelWithDebInfo'
return args
@@ -140,6 +144,9 @@ def build(args, paths):
def package(args, paths):
if not os.path.exists(paths.result):
os.makedirs(paths.result)
+ if common.is_windows_platform() and args.sign_command:
+ command = shlex.split(args.sign_command)
+ common.check_print_call(command + [paths.install])
common.check_print_call(['7z', 'a', '-mmt2', os.path.join(paths.result, args.name + '.7z'), '*'],
paths.install)
if os.path.exists(paths.dev_install): # some plugins might not provide anything in Devel