From 593c50f623113f4f8bac7a10399e6b3da92be7cd Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 21 Jan 2020 15:22:33 +0300 Subject: [PATCH] Remove GYP build scripts. --- gyp/codegen_actions.gypi | 55 ------------- gyp/qrc_rule.gypi | 72 ----------------- gyp/sources.txt | 146 --------------------------------- gyp/styles_rule.gypi | 55 ------------- gyp/update_dependent.py | 170 --------------------------------------- lib_ui.gyp | 70 ---------------- 6 files changed, 568 deletions(-) delete mode 100644 gyp/codegen_actions.gypi delete mode 100644 gyp/qrc_rule.gypi delete mode 100644 gyp/sources.txt delete mode 100644 gyp/styles_rule.gypi delete mode 100644 gyp/update_dependent.py delete mode 100644 lib_ui.gyp diff --git a/gyp/codegen_actions.gypi b/gyp/codegen_actions.gypi deleted file mode 100644 index b0cc830..0000000 --- a/gyp/codegen_actions.gypi +++ /dev/null @@ -1,55 +0,0 @@ -# This file is part of Desktop App Toolkit, -# a set of libraries for developing nice desktop applications. -# -# For license and copyright information please follow this link: -# https://github.com/desktop-app/legal/blob/master/LEGAL - -{ - 'actions': [{ - 'action_name': 'codegen_palette', - 'inputs': [ - '<(PRODUCT_DIR)/codegen_style<(exe_ext)', - '<(style_timestamp)', - '<(src_loc)/ui/colors.palette', - ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/styles/palette.h', - '<(SHARED_INTERMEDIATE_DIR)/styles/palette.cpp', - ], - 'action': [ - '<(PRODUCT_DIR)/codegen_style<(exe_ext)', - '-I', '<(src_loc)', - '-o', '<(SHARED_INTERMEDIATE_DIR)/styles', - '-w', '<(PRODUCT_DIR)/..', - - # GYP/Ninja bug workaround: if we specify just <(RULE_INPUT_PATH) - # the <(RULE_INPUT_ROOT) variables won't be available in Ninja, - # and the 'message' will be just 'codegen_style-ing .style..' - # Looks like the using the <(RULE_INPUT_ROOT) here "exports" it - # for using in the 'message' field. - - '<(src_loc)/ui/colors.palette', - ], - 'message': 'codegen_palette-ing colors..', - 'process_outputs_as_sources': 1, - }, { - 'action_name': 'codegen_emoji', - 'inputs': [ - '<(PRODUCT_DIR)/codegen_emoji<(exe_ext)', - '<(emoji_suggestions_loc)/emoji_autocomplete.json', - ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/emoji.cpp', - '<(SHARED_INTERMEDIATE_DIR)/emoji.h', - '<(SHARED_INTERMEDIATE_DIR)/emoji_suggestions_data.cpp', - '<(SHARED_INTERMEDIATE_DIR)/emoji_suggestions_data.h', - ], - 'action': [ - '<(PRODUCT_DIR)/codegen_emoji<(exe_ext)', - '<(emoji_suggestions_loc)/emoji_autocomplete.json', - '-o', '<(SHARED_INTERMEDIATE_DIR)', - ], - 'message': 'codegen_emoji-ing..', - 'process_outputs_as_sources': 1, - }], -} diff --git a/gyp/qrc_rule.gypi b/gyp/qrc_rule.gypi deleted file mode 100644 index eb4654c..0000000 --- a/gyp/qrc_rule.gypi +++ /dev/null @@ -1,72 +0,0 @@ -# This file is part of Desktop App Toolkit, -# a set of libraries for developing nice desktop applications. -# -# For license and copyright information please follow this link: -# https://github.com/desktop-app/legal/blob/master/LEGAL - -{ - 'variables': { - 'qrc_files': [ - '<(submodules_loc)/lib_ui/fonts/fonts.qrc', - ], - }, - 'conditions': [ - [ 'build_linux', { - 'variables': { - 'qrc_files': [ - '<(submodules_loc)/lib_ui/qt_conf/linux.qrc', - ], - } - }], - [ 'build_mac', { - 'variables': { - 'qrc_files': [ - '<(submodules_loc)/lib_ui/qt_conf/mac.qrc', - ], - }, - }], - [ 'build_win', { - 'variables': { - 'qrc_files': [ - '<(submodules_loc)/lib_ui/qt_conf/win.qrc', - ], - } - }], - ], - 'actions': [{ - 'action_name': 'update_dependent_qrc', - 'inputs': [ - 'update_dependent.py', - '<@(qrc_files)', - ']*)?>([^<]+)', line) - if file_match: - full_path = dir_name + '/' + file_match.group(2) - dependencies[full_path] = 1 - return dependencies - -def list_qrc_dependencies(file_path): - global one_modified - dependencies = get_qrc_dependencies(file_path) - for path in dependencies: - print(path) - -one_modified = 0 -def handle_qrc_dependencies(file_path): - global one_modified - dependencies = get_qrc_dependencies(file_path) - file_modified = os.path.getmtime(file_path) - latest_modified = file_modified - for path in dependencies: - if os.path.isfile(path): - dependency_modified = os.path.getmtime(path) - if latest_modified < dependency_modified: - latest_modified = dependency_modified - else: - eprint('File not found: ' + path) - if file_modified < latest_modified: - os.utime(file_path, None); - one_modified = 1 - -def get_direct_style_dependencies(file_path): - dependencies = {} - dependencies[file_path] = 1 - if not os.path.isfile(file_path): - eprint('File not found: ' + file_path) - with open(file_path) as f: - for line in f: - using_match = re.match('^\s*using "([^"]+)"', line) - if using_match: - path = using_match.group(1) - found = 0 - for include_dir in include_dirs: - full_path = include_dir + '/' + path - if os.path.isfile(full_path): - try: - if dependencies[full_path]: - eprint('Cyclic dependencies: ' + full_path) - except KeyError: - dependencies[full_path] = 1 - found = 1 - break - if found != 1: - eprint('File not found: ' + path) - return dependencies - -include_dirs = [] -def handle_style_dependencies(file_path): - global one_modified - all_dependencies = {} - all_dependencies[file_path] = 1 - added_from = {} - while len(added_from) != len(all_dependencies): - for dependency in all_dependencies: - try: - if added_from[dependency]: - continue - except KeyError: - added_from[dependency] = 1 - add = get_direct_style_dependencies(dependency) - for new_dependency in add: - all_dependencies[new_dependency] = 1 - break - - file_modified = os.path.getmtime(file_path) - latest_modified = file_modified - for path in all_dependencies: - if path != file_path: - dependency_modified = os.path.getmtime(path) - if latest_modified < dependency_modified: - latest_modified = dependency_modified - if file_modified < latest_modified: - os.utime(file_path, None); - one_modified = 1 - -file_paths = [] -request = '' -output_file = '' -next_include_dir = 0 -next_output_file = 0 -next_self = 1 -for arg in sys.argv: - if next_self != 0: - next_self = 0 - continue - if arg == '--styles' or arg == '--qrc_list' or arg == '--qrc': - if request == '': - request = arg[2:] - else: - eprint('Only one request required.') - continue - if next_include_dir != 0: - next_include_dir = 0 - include_dirs.append(arg) - continue - if next_output_file != 0: - next_output_file = 0 - output_file = arg - continue - - include_dir_match = re.match(r'^\-I(.*)$', arg) - if include_dir_match: - include_dir = include_dir_match.group(1) - if include_dir == '': - next_include_dir = 1 - else: - include_dirs.append(include_dir) - continue - - output_match = re.match(r'^-o(.*)$', arg) - if output_match: - output_file = output_match.group(1) - if output_file == '': - next_output_file = 1 - continue - - file_paths.append(arg) - -if request == 'styles': - for file_path in file_paths: - handle_style_dependencies(file_path) -elif request == 'qrc': - for file_path in file_paths: - handle_qrc_dependencies(file_path) -elif request == 'qrc_list': - for file_path in file_paths: - list_qrc_dependencies(file_path) - sys.exit(0) -else: - eprint('Request required.') - -if not os.path.isfile(output_file): - with open(output_file, "w") as f: - f.write('1') -elif one_modified != 0: - os.utime(output_file, None); diff --git a/lib_ui.gyp b/lib_ui.gyp deleted file mode 100644 index 38933ab..0000000 --- a/lib_ui.gyp +++ /dev/null @@ -1,70 +0,0 @@ -# This file is part of Desktop App Toolkit, -# a set of libraries for developing nice desktop applications. -# -# For license and copyright information please follow this link: -# https://github.com/desktop-app/legal/blob/master/LEGAL - -{ - 'includes': [ - '../gyp/helpers/common/common.gypi', - ], - 'targets': [{ - 'target_name': 'lib_ui', - 'hard_dependency': 1, - 'includes': [ - '../gyp/helpers/common/library.gypi', - '../gyp/helpers/modules/qt.gypi', - '../gyp/helpers/modules/qt_moc.gypi', - '../gyp/helpers/modules/pch.gypi', - '../gyp/helpers/modules/openssl.gypi', - 'gyp/styles_rule.gypi', - 'gyp/codegen_actions.gypi', - ], - 'dependencies': [ - '<(submodules_loc)/codegen/codegen.gyp:codegen_emoji', - '<(submodules_loc)/codegen/codegen.gyp:codegen_style', - '<(submodules_loc)/lib_base/lib_base.gyp:lib_base', - ], - 'export_dependent_settings': [ - '<(submodules_loc)/lib_base/lib_base.gyp:lib_base', - ], - 'variables': { - 'src_loc': '.', - 'emoji_suggestions_loc': '<(src_loc)/emoji_suggestions', - 'style_files': [ - '<(src_loc)/ui/colors.palette', - '<(src_loc)/ui/basic.style', - '<(src_loc)/ui/layers/layers.style', - '<(src_loc)/ui/widgets/widgets.style', - ], - 'dependent_style_files': [ - ], - 'style_timestamp': '<(SHARED_INTERMEDIATE_DIR)/update_dependent_styles_ui.timestamp', - 'list_sources_command': 'python <(submodules_loc)/lib_base/gyp/list_sources.py --input gyp/sources.txt --replace src_loc=<(src_loc)', - 'pch_source': '<(src_loc)/ui/ui_pch.cpp', - 'pch_header': '<(src_loc)/ui/ui_pch.h', - }, - 'defines': [ - ], - 'include_dirs': [ - '<(src_loc)', - '<(SHARED_INTERMEDIATE_DIR)', - '<(emoji_suggestions_loc)', - ], - 'direct_dependent_settings': { - 'include_dirs': [ - '<(src_loc)', - '<(SHARED_INTERMEDIATE_DIR)', - '<(emoji_suggestions_loc)', - ], - }, - 'sources': [ - '<@(style_files)', - 'gyp/sources.txt', - '