From 9084ab1b64f3160d6b29d64f10befd069c23a721 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 19 Apr 2022 11:22:16 +0200 Subject: Remove some unused scripts These are no longer used, and instead solved via CMake or part of build(_plugin).py Change-Id: I86a829713fe32b9ff1386fc0bdfd23a88e3e00c4 Reviewed-by: Christian Stenger --- scripts/createDevPackage.py | 132 ---------------------------------------- scripts/createDistPackage.py | 62 ------------------- scripts/createSourcePackages.py | 113 ---------------------------------- scripts/packagePlugins.py | 59 ------------------ 4 files changed, 366 deletions(-) delete mode 100755 scripts/createDevPackage.py delete mode 100755 scripts/createDistPackage.py delete mode 100755 scripts/createSourcePackages.py delete mode 100755 scripts/packagePlugins.py diff --git a/scripts/createDevPackage.py b/scripts/createDevPackage.py deleted file mode 100755 index 663810cfd3..0000000000 --- a/scripts/createDevPackage.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python - -############################################################################ -# -# Copyright (C) 2016 The Qt Company Ltd. -# Contact: https://www.qt.io/licensing/ -# -# This file is part of Qt Creator. -# -# Commercial License Usage -# Licensees holding valid commercial Qt licenses may use this file in -# accordance with the commercial license agreement provided with the -# Software or, alternatively, in accordance with the terms contained in -# a written agreement between you and The Qt Company. For licensing terms -# and conditions see https://www.qt.io/terms-conditions. For further -# information use the contact form at https://www.qt.io/contact-us. -# -# GNU General Public License Usage -# Alternatively, this file may be used under the terms of the GNU -# General Public License version 3 as published by the Free Software -# Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -# included in the packaging of this file. Please review the following -# information to ensure the GNU General Public License requirements will -# be met: https://www.gnu.org/licenses/gpl-3.0.html. -# -############################################################################ - - -import argparse -import os -import re -import subprocess -import sys - -import common - -# ========= COMMAND LINE ARGUMENTS ======== - -def parse_arguments(): - parser = argparse.ArgumentParser(description="Create Qt Creator development package.") - parser.add_argument('--source', '-s', help='path to the Qt Creator sources', required=True, - metavar='') - parser.add_argument('--build', '-b', help='path to the Qt Creator build', required=True, - metavar='') - parser.add_argument('--verbose', '-v', help='verbose output', action='store_true', default=False) - parser.add_argument('--7z', help='path to 7z binary', - default='7z.exe' if common.is_windows_platform() else '7z', - metavar='<7z_binary>', dest='sevenzip') - parser.add_argument('--7z_out', '-o', help='output 7z file to create', metavar='', - dest='sevenzip_target') - parser.add_argument('target_directory') - return parser.parse_args() - -# ========= PATTERNS TO INCLUDE =========== - -# slash at the end matches directories, no slash at the end matches files - -source_include_patterns = [ - # directories - r"^(?!(share|tests)/.*$)(.*/)?$", # look into all directories except under share/ and tests/ - r"^share/(qtcreator/(qml/(qmlpuppet/(.*/)?)?)?)?$", # for shared headers for qt quick designer plugins - r"^share/qtcreator/qml/qmlpuppet/commands/.*\.(h|pri|cpp|c|txt|md)$", #used by extra plugins - r"^share/qtcreator/qml/qmlpuppet/container/.*\.(h|pri|cpp|c|txt|md)$", #used by extra plugins - r"^src/plugins/help/qlitehtml/.*\.(h|pri|cpp|c|txt|md)$", # litehtml is used by extra plugins - # files - r"^HACKING$", - r"^LICENSE.*$", - r"^README.md$", - r"^scripts/.*$", # include everything under scripts/ - r"^doc/.*$", # include everything under doc/ - r"^.*\.pri$", # .pri files in all directories that are looked into - r"^.*\.h$", # .h files in all directories that are looked into - r"^.*\.hpp$" # .hpp files in all directories that are looked into -] - -build_include_patterns = [ - # directories - r"^src/$", - r"^src/app/$", - # files - r"^src/app/app_version.h$" -] -if common.is_windows_platform(): - build_include_patterns.extend([ - r"^lib/(.*/)?$", # consider all directories under lib/ - r"^lib/.*\.lib$" - ]) - -# ========================================= - -def copy_regexp(regexp, source_directory, target_directory, verbose): - def ignore(directory, filenames): - relative_dir = os.path.relpath(directory, source_directory) - file_target_dir = os.path.join(target_directory, relative_dir) - ignored = [] - for filename in filenames: - relative_file_path = os.path.normpath(os.path.join(relative_dir, filename)) - relative_file_path = relative_file_path.replace(os.sep, '/') - if os.path.isdir(os.path.join(directory, filename)): - relative_file_path += '/' # let directories end with slash - if not regexp.match(relative_file_path): - ignored.append(filename) - elif verbose and os.path.isfile(os.path.join(directory, filename)): - print(os.path.normpath(os.path.join(file_target_dir, filename))) - return ignored - - common.copytree(source_directory, target_directory, symlinks=True, ignore=ignore) - -def sanity_check_arguments(arguments): - if os.path.exists(arguments.target_directory) and (os.path.isfile(arguments.target_directory) - or len(os.listdir(arguments.target_directory)) > 0): - print('error: target directory "{0}" exists and is not empty'.format(arguments.target_directory)) - return False - return True - -def main(): - arguments = parse_arguments() - if not sanity_check_arguments(arguments): - sys.exit(1) - - source_include_regexp = re.compile('(' + ')|('.join(source_include_patterns) + ')') - build_include_regexp = re.compile('(' + ')|('.join(build_include_patterns) + ')') - - copy_regexp(source_include_regexp, arguments.source, arguments.target_directory, arguments.verbose) - copy_regexp(build_include_regexp, arguments.build, arguments.target_directory, arguments.verbose) - - if arguments.sevenzip_target: - subprocess.check_call([arguments.sevenzip, 'a', '-mx9', '-mmt2', arguments.sevenzip_target, - os.path.join(arguments.target_directory, '*')]) - -if __name__ == "__main__": - main() diff --git a/scripts/createDistPackage.py b/scripts/createDistPackage.py deleted file mode 100755 index ad23a617e3..0000000000 --- a/scripts/createDistPackage.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python -############################################################################ -# -# Copyright (C) 2018 The Qt Company Ltd. -# Contact: https://www.qt.io/licensing/ -# -# This file is part of Qt Creator. -# -# Commercial License Usage -# Licensees holding valid commercial Qt licenses may use this file in -# accordance with the commercial license agreement provided with the -# Software or, alternatively, in accordance with the terms contained in -# a written agreement between you and The Qt Company. For licensing terms -# and conditions see https://www.qt.io/terms-conditions. For further -# information use the contact form at https://www.qt.io/contact-us. -# -# GNU General Public License Usage -# Alternatively, this file may be used under the terms of the GNU -# General Public License version 3 as published by the Free Software -# Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -# included in the packaging of this file. Please review the following -# information to ensure the GNU General Public License requirements will -# be met: https://www.gnu.org/licenses/gpl-3.0.html. -# -############################################################################ - -import argparse -import os -import shutil -import subprocess -import tempfile - -import common - -def parse_arguments(): - parser = argparse.ArgumentParser(description="Create Qt Creator package, filtering out debug information files.") - parser.add_argument('--7z', help='path to 7z binary', - default='7z.exe' if common.is_windows_platform() else '7z', - metavar='<7z_binary>', dest='sevenzip') - parser.add_argument('--debug', help='package only the files with debug information', - dest='debug', action='store_true', default=False) - parser.add_argument('--exclude-toplevel', help='do not include the toplevel source directory itself in the resulting archive, only its contents', - dest='exclude_toplevel', action='store_true', default=False) - parser.add_argument('target_archive', help='output 7z file to create') - parser.add_argument('source_directory', help='source directory with the Qt Creator installation') - return parser.parse_args() - -def main(): - arguments = parse_arguments() - tempdir_base = tempfile.mkdtemp() - tempdir = os.path.join(tempdir_base, os.path.basename(arguments.source_directory)) - try: - common.copytree(arguments.source_directory, tempdir, symlinks=True, - ignore=(common.is_not_debug if arguments.debug else common.is_debug)) - # package - zip_source = os.path.join(tempdir, '*') if arguments.exclude_toplevel else tempdir - subprocess.check_call([arguments.sevenzip, 'a', '-mmt2', - arguments.target_archive, zip_source]) - finally: - shutil.rmtree(tempdir_base) -if __name__ == "__main__": - main() diff --git a/scripts/createSourcePackages.py b/scripts/createSourcePackages.py deleted file mode 100755 index 1e1bdead92..0000000000 --- a/scripts/createSourcePackages.py +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env python -############################################################################ -# -# Copyright (C) 2016 The Qt Company Ltd. -# Contact: https://www.qt.io/licensing/ -# -# This file is part of Qt Creator. -# -# Commercial License Usage -# Licensees holding valid commercial Qt licenses may use this file in -# accordance with the commercial license agreement provided with the -# Software or, alternatively, in accordance with the terms contained in -# a written agreement between you and The Qt Company. For licensing terms -# and conditions see https://www.qt.io/terms-conditions. For further -# information use the contact form at https://www.qt.io/contact-us. -# -# GNU General Public License Usage -# Alternatively, this file may be used under the terms of the GNU -# General Public License version 3 as published by the Free Software -# Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -# included in the packaging of this file. Please review the following -# information to ensure the GNU General Public License requirements will -# be met: https://www.gnu.org/licenses/gpl-3.0.html. -# -############################################################################ - -import argparse -import os -import shutil -import subprocess -import tempfile - -def archive(repository, target_file, prefix='', crlf=False): - crlf_args = (['-c', 'core.autocrlf=true', '-c', 'core.eol=crlf'] if crlf - else []) - subprocess.check_call(['git'] + crlf_args + - ['archive', '--format=tar', '--prefix=' + prefix, - '-o', target_file, 'HEAD'], - cwd=repository) - -def extract_combined(archive_list, target_dir): - if not os.path.exists(target_dir): - os.makedirs(target_dir) - for a in archive_list: - subprocess.check_call(['tar', 'xf', a], cwd=target_dir) - -def createTarGz(source_dir, target_file): - (cwd, path) = os.path.split(source_dir) - subprocess.check_call(['tar', 'czf', target_file, path], cwd=cwd) - -def createTarXz(source_dir, target_file): - (cwd, path) = os.path.split(source_dir) - subprocess.check_call(['tar', 'cJf', target_file, path], cwd=cwd) - -def createZip(source_dir, target_file): - (cwd, path) = os.path.split(source_dir) - subprocess.check_call(['zip', '-9qr', target_file, path], cwd=cwd) - -def package_repos(repos, combined_prefix, target_file_base): - workdir = tempfile.mkdtemp(suffix="-createQtcSource") - def crlf_postfix(crlf): - return '_win' if crlf else '' - def tar_name(name, crlf): - sanitized_name = name.replace('/', '_').replace('\\', '_') - return os.path.join(workdir, sanitized_name + crlf_postfix(crlf) + '.tar') - def archive_path(crlf=False): - return os.path.join(workdir, 'src' + crlf_postfix(crlf), combined_prefix) - print('Working in "' + workdir + '"') - print('Pre-packaging archives...') - for (name, repo, prefix) in repos: - print(' ' + name + '...') - for crlf in [False, True]: - archive(repo, tar_name(name, crlf), prefix, crlf=crlf) - print('Preparing for packaging...') - for crlf in [False, True]: - archive_list = [tar_name(name, crlf) for (name, _, _) in repos] - extract_combined(archive_list, archive_path(crlf)) - print('Creating .tar.gz...') - createTarGz(archive_path(crlf=False), target_file_base + '.tar.gz') - print('Creating .tar.xz...') - createTarXz(archive_path(crlf=False), target_file_base + '.tar.xz') - print('Creating .zip with CRLF...') - createZip(archive_path(crlf=True), target_file_base + '.zip') - print('Removing temporary directory...') - shutil.rmtree(workdir) - -def parse_arguments(): - script_path = os.path.dirname(os.path.realpath(__file__)) - qtcreator_repo = os.path.join(script_path, '..') - parser = argparse.ArgumentParser(description="Create Qt Creator source packages") - parser.add_argument('-p', default=qtcreator_repo, dest='repo', help='path to repository') - parser.add_argument('-n', default='', dest='name', help='name of plugin') - parser.add_argument('-s', action='append', default=[], dest='modules', help='submodule to add') - parser.add_argument('version', help='full version including tag, e.g. 4.2.0-beta1') - parser.add_argument('edition', help='(opensource | enterprise)') - return parser.parse_args() - -def main(): - args = parse_arguments() - base_repo_name = args.name if args.name else "qtcreator" - if not args.name and not args.modules: # default Qt Creator repository - submodules = [os.path.join('src', 'shared', 'qbs'), - os.path.join('src', 'tools', 'perfparser')] - args.modules = [path for path in submodules if os.path.exists(os.path.join(args.repo, path, '.git'))] - repos = [(base_repo_name, args.repo, '')] - for module in args.modules: - repos += [(module, os.path.join(args.repo, module), module + os.sep)] - name_part = '-' + args.name if args.name else '' - prefix = 'qt-creator-' + args.edition + name_part + '-src-' + args.version - package_repos(repos, prefix, os.path.join(os.getcwd(), prefix)) - -if __name__ == "__main__": - main() diff --git a/scripts/packagePlugins.py b/scripts/packagePlugins.py deleted file mode 100755 index 5cbace790c..0000000000 --- a/scripts/packagePlugins.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python - -############################################################################ -# -# Copyright (C) 2016 The Qt Company Ltd. -# Contact: https://www.qt.io/licensing/ -# -# This file is part of Qt Creator. -# -# Commercial License Usage -# Licensees holding valid commercial Qt licenses may use this file in -# accordance with the commercial license agreement provided with the -# Software or, alternatively, in accordance with the terms contained in -# a written agreement between you and The Qt Company. For licensing terms -# and conditions see https://www.qt.io/terms-conditions. For further -# information use the contact form at https://www.qt.io/contact-us. -# -# GNU General Public License Usage -# Alternatively, this file may be used under the terms of the GNU -# General Public License version 3 as published by the Free Software -# Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -# included in the packaging of this file. Please review the following -# information to ensure the GNU General Public License requirements will -# be met: https://www.gnu.org/licenses/gpl-3.0.html. -# -############################################################################ - -import argparse -import os -import subprocess - -import common - -def parse_arguments(): - parser = argparse.ArgumentParser(description="Deploy and 7z a directory of plugins.") - parser.add_argument('--7z', help='path to 7z binary', - default='7z.exe' if common.is_windows_platform() else '7z', - metavar='<7z_binary>', dest='sevenzip') - parser.add_argument('--qmake_binary', help='path to qmake binary which was used for compilation', - required=common.is_linux_platform(), metavar='') - parser.add_argument('source_directory', help='directory to deploy and 7z') - parser.add_argument('target_file', help='target file path of the resulting 7z') - return parser.parse_args() - -if __name__ == "__main__": - arguments = parse_arguments() - qt_install_info = common.get_qt_install_info(arguments.qmake_binary) - if common.is_linux_platform(): - common.fix_rpaths(arguments.source_directory, - os.path.join(arguments.source_directory, 'lib', 'Qt', 'lib'), - qt_install_info) - if common.is_mac_platform(): - # remove Qt rpath - lib_path = qt_install_info['QT_INSTALL_LIBS'] - common.os_walk(arguments.source_directory, - lambda fp: fp.endswith('.dylib'), - lambda fp: subprocess.call(['install_name_tool', '-delete_rpath', lib_path, fp])) - subprocess.check_call([arguments.sevenzip, 'a', '-mx9', arguments.target_file, - os.path.join(arguments.source_directory, '*')]) -- cgit v1.2.1