diff options
author | heretic <heretic@yandex-team.ru> | 2022-02-10 16:45:43 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:43 +0300 |
commit | 397cbe258b9e064f49c4ca575279f02f39fef76e (patch) | |
tree | a0b0eb3cca6a14e4e8ea715393637672fa651284 /build/plugins | |
parent | 43f5a35593ebc9f6bcea619bb170394ea7ae468e (diff) | |
download | ydb-397cbe258b9e064f49c4ca575279f02f39fef76e.tar.gz |
Restoring authorship annotation for <heretic@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'build/plugins')
-rw-r--r-- | build/plugins/bundle.py | 18 | ||||
-rw-r--r-- | build/plugins/credits.py | 44 | ||||
-rw-r--r-- | build/plugins/ios_app_settings.py | 38 | ||||
-rw-r--r-- | build/plugins/ios_assets.py | 60 | ||||
-rw-r--r-- | build/plugins/java.py | 186 | ||||
-rw-r--r-- | build/plugins/pybuild.py | 2 | ||||
-rw-r--r-- | build/plugins/res.py | 52 | ||||
-rw-r--r-- | build/plugins/rodata.py | 178 | ||||
-rw-r--r-- | build/plugins/scarab_cant_clash.py | 2 | ||||
-rw-r--r-- | build/plugins/swig.py | 14 | ||||
-rw-r--r-- | build/plugins/ytest.py | 130 |
11 files changed, 362 insertions, 362 deletions
diff --git a/build/plugins/bundle.py b/build/plugins/bundle.py index 0bec8254ee..23a41353c6 100644 --- a/build/plugins/bundle.py +++ b/build/plugins/bundle.py @@ -10,13 +10,13 @@ def onbundle(unit, *args): It makes little sense to specify BUNDLE on non-final targets and so this may stop working without prior notice. Bundle on multimodule will select final target among multimodule variants and will fail if there are none or more than one. """ - i = 0 - while i < len(args): - if i + 2 < len(args) and args[i + 1] == "NAME": - target, name = args[i], args[i + 2] - i += 3 - else: - target, name = args[i], os.path.basename(args[i]) - i += 1 - + i = 0 + while i < len(args): + if i + 2 < len(args) and args[i + 1] == "NAME": + target, name = args[i], args[i + 2] + i += 3 + else: + target, name = args[i], os.path.basename(args[i]) + i += 1 + unit.on_bundle_target([target, name]) diff --git a/build/plugins/credits.py b/build/plugins/credits.py index 0ce1659326..0a100e87c6 100644 --- a/build/plugins/credits.py +++ b/build/plugins/credits.py @@ -1,22 +1,22 @@ -from _common import rootrel_arc_src - - -def oncredits_disclaimer(unit, *args): - if unit.get('WITH_CREDITS'): - unit.message(["warn", "CREDITS WARNING: {}".format(' '.join(args))]) - -def oncheck_contrib_credits(unit, *args): - module_path = rootrel_arc_src(unit.path(), unit) - excepts = set() - if 'EXCEPT' in args: - args = list(args) - except_pos = args.index('EXCEPT') - excepts = set(args[except_pos + 1:]) - args = args[:except_pos] - for arg in args: - if module_path.startswith(arg) and not unit.get('CREDITS_TEXTS_FILE') and not unit.get('NO_CREDITS_TEXTS_FILE'): - for ex in excepts: - if module_path.startswith(ex): - break - else: - unit.message(["error", "License texts not found. See https://st.yandex-team.ru/DTCC-324"]) +from _common import rootrel_arc_src + + +def oncredits_disclaimer(unit, *args): + if unit.get('WITH_CREDITS'): + unit.message(["warn", "CREDITS WARNING: {}".format(' '.join(args))]) + +def oncheck_contrib_credits(unit, *args): + module_path = rootrel_arc_src(unit.path(), unit) + excepts = set() + if 'EXCEPT' in args: + args = list(args) + except_pos = args.index('EXCEPT') + excepts = set(args[except_pos + 1:]) + args = args[:except_pos] + for arg in args: + if module_path.startswith(arg) and not unit.get('CREDITS_TEXTS_FILE') and not unit.get('NO_CREDITS_TEXTS_FILE'): + for ex in excepts: + if module_path.startswith(ex): + break + else: + unit.message(["error", "License texts not found. See https://st.yandex-team.ru/DTCC-324"]) diff --git a/build/plugins/ios_app_settings.py b/build/plugins/ios_app_settings.py index 60ec0b4b52..bdb6658563 100644 --- a/build/plugins/ios_app_settings.py +++ b/build/plugins/ios_app_settings.py @@ -1,19 +1,19 @@ -import _common as common -import ymake -import os - -def onios_app_settings(unit, *args): - tail, kv = common.sort_by_keywords( - {'OS_VERSION': 1, 'DEVICES': -1}, - args - ) - if tail: - ymake.report_configure_error('Bad IOS_COMMON_SETTINGS usage - unknown data: ' + str(tail)) - if kv.get('OS_VERSION', []): - unit.onios_app_common_flags(['--minimum-deployment-target', kv.get('OS_VERSION', [])[0]]) - unit.onios_app_assets_flags(['--filter-for-device-os-version', kv.get('OS_VERSION', [])[0]]) - devices_flags = [] - for device in kv.get('DEVICES', []): - devices_flags += ['--target-device', device] - if devices_flags: - unit.onios_app_common_flags(devices_flags) +import _common as common +import ymake +import os + +def onios_app_settings(unit, *args): + tail, kv = common.sort_by_keywords( + {'OS_VERSION': 1, 'DEVICES': -1}, + args + ) + if tail: + ymake.report_configure_error('Bad IOS_COMMON_SETTINGS usage - unknown data: ' + str(tail)) + if kv.get('OS_VERSION', []): + unit.onios_app_common_flags(['--minimum-deployment-target', kv.get('OS_VERSION', [])[0]]) + unit.onios_app_assets_flags(['--filter-for-device-os-version', kv.get('OS_VERSION', [])[0]]) + devices_flags = [] + for device in kv.get('DEVICES', []): + devices_flags += ['--target-device', device] + if devices_flags: + unit.onios_app_common_flags(devices_flags) diff --git a/build/plugins/ios_assets.py b/build/plugins/ios_assets.py index 5f0ccb9467..77cdcb2177 100644 --- a/build/plugins/ios_assets.py +++ b/build/plugins/ios_assets.py @@ -1,30 +1,30 @@ -import _common as common -import ymake -import os - - -def onios_assets(unit, *args): - _, kv = common.sort_by_keywords( - {'ROOT': 1, 'CONTENTS': -1, 'FLAGS': -1}, - args - ) - if not kv.get('ROOT', []) and kv.get('CONTENTS', []): - ymake.report_configure_error('Please specify ROOT directory for assets') - origin_root = kv.get('ROOT')[0] - destination_root = os.path.normpath(os.path.join('$BINDIR', os.path.basename(origin_root))) - rel_list = [] - for cont in kv.get('CONTENTS', []): - rel = os.path.relpath(cont, origin_root) - if rel.startswith('..'): - ymake.report_configure_error('{} is not subpath of {}'.format(cont, origin_root)) - rel_list.append(rel) - if not rel_list: - return - results_list = [os.path.join('$B', unit.path()[3:], os.path.basename(origin_root), i) for i in rel_list] - if len(kv.get('CONTENTS', [])) != len(results_list): - ymake.report_configure_error('IOS_ASSETTS content length is not equals results') - for s, d in zip(kv.get('CONTENTS', []), results_list): - unit.oncopy_file([s, d]) - if kv.get('FLAGS', []): - unit.onios_app_assets_flags(kv.get('FLAGS', [])) - unit.on_ios_assets([destination_root] + results_list) +import _common as common +import ymake +import os + + +def onios_assets(unit, *args): + _, kv = common.sort_by_keywords( + {'ROOT': 1, 'CONTENTS': -1, 'FLAGS': -1}, + args + ) + if not kv.get('ROOT', []) and kv.get('CONTENTS', []): + ymake.report_configure_error('Please specify ROOT directory for assets') + origin_root = kv.get('ROOT')[0] + destination_root = os.path.normpath(os.path.join('$BINDIR', os.path.basename(origin_root))) + rel_list = [] + for cont in kv.get('CONTENTS', []): + rel = os.path.relpath(cont, origin_root) + if rel.startswith('..'): + ymake.report_configure_error('{} is not subpath of {}'.format(cont, origin_root)) + rel_list.append(rel) + if not rel_list: + return + results_list = [os.path.join('$B', unit.path()[3:], os.path.basename(origin_root), i) for i in rel_list] + if len(kv.get('CONTENTS', [])) != len(results_list): + ymake.report_configure_error('IOS_ASSETTS content length is not equals results') + for s, d in zip(kv.get('CONTENTS', []), results_list): + unit.oncopy_file([s, d]) + if kv.get('FLAGS', []): + unit.onios_app_assets_flags(kv.get('FLAGS', [])) + unit.on_ios_assets([destination_root] + results_list) diff --git a/build/plugins/java.py b/build/plugins/java.py index 16fc126734..c7699ed0d5 100644 --- a/build/plugins/java.py +++ b/build/plugins/java.py @@ -1,7 +1,7 @@ import _common as common -import ymake +import ymake import json -import os +import os import base64 @@ -32,13 +32,13 @@ def extract_macro_calls2(unit, macro_value_name): def on_run_jbuild_program(unit, *args): - args = list(args) + args = list(args) """ Custom code generation @link: https://wiki.yandex-team.ru/yatool/java/#kodogeneracijarunjavaprogram """ - flat, kv = common.sort_by_keywords({'IN': -1, 'IN_DIR': -1, 'OUT': -1, 'OUT_DIR': -1, 'CWD': 1, 'CLASSPATH': -1, 'CP_USE_COMMAND_FILE': 1, 'ADD_SRCS_TO_CLASSPATH': 0}, args) + flat, kv = common.sort_by_keywords({'IN': -1, 'IN_DIR': -1, 'OUT': -1, 'OUT_DIR': -1, 'CWD': 1, 'CLASSPATH': -1, 'CP_USE_COMMAND_FILE': 1, 'ADD_SRCS_TO_CLASSPATH': 0}, args) depends = kv.get('CLASSPATH', []) + kv.get('JAR', []) fake_out = None if depends: @@ -46,9 +46,9 @@ def on_run_jbuild_program(unit, *args): fake_out = "fake.out.{}".format(hash(tuple(args))) unit.on_run_java(['TOOL'] + depends + ["OUT", fake_out]) - if not kv.get('CP_USE_COMMAND_FILE'): - args += ['CP_USE_COMMAND_FILE', unit.get(['JAVA_PROGRAM_CP_USE_COMMAND_FILE']) or 'yes'] - + if not kv.get('CP_USE_COMMAND_FILE'): + args += ['CP_USE_COMMAND_FILE', unit.get(['JAVA_PROGRAM_CP_USE_COMMAND_FILE']) or 'yes'] + if fake_out is not None: args += ['FAKE_OUT', fake_out] @@ -57,23 +57,23 @@ def on_run_jbuild_program(unit, *args): unit.set(['RUN_JAVA_PROGRAM_VALUE', new_val]) -def ongenerate_script(unit, *args): +def ongenerate_script(unit, *args): """ heretic@ promised to make tutorial here Don't forget Feel free to remind """ - flat, kv = common.sort_by_keywords( - {'OUT': -1, 'TEMPLATE': -1, 'CUSTOM_PROPERTY': -1}, - args - ) - if len(kv.get('TEMPLATE', [])) > len(kv.get('OUT', [])): - ymake.report_configure_error('To many arguments for TEMPLATE parameter') - prev = unit.get(['GENERATE_SCRIPT_VALUE']) or '' - new_val = (prev + ' ' + base64.b64encode(json.dumps(list(args), encoding='utf-8'))).strip() - unit.set(['GENERATE_SCRIPT_VALUE', new_val]) - - + flat, kv = common.sort_by_keywords( + {'OUT': -1, 'TEMPLATE': -1, 'CUSTOM_PROPERTY': -1}, + args + ) + if len(kv.get('TEMPLATE', [])) > len(kv.get('OUT', [])): + ymake.report_configure_error('To many arguments for TEMPLATE parameter') + prev = unit.get(['GENERATE_SCRIPT_VALUE']) or '' + new_val = (prev + ' ' + base64.b64encode(json.dumps(list(args), encoding='utf-8'))).strip() + unit.set(['GENERATE_SCRIPT_VALUE', new_val]) + + def onjava_module(unit, *args): args_delim = unit.get('ARGS_DELIM') idea_only = True if 'IDEA_ONLY' in args else False @@ -101,9 +101,9 @@ def onjava_module(unit, *args): 'EXTERNAL_JAR': extract_macro_calls(unit, 'EXTERNAL_JAR_VALUE', args_delim), 'RUN_JAVA_PROGRAM': extract_macro_calls2(unit, 'RUN_JAVA_PROGRAM_VALUE'), 'RUN_JAVA_PROGRAM_MANAGED': '${RUN_JAVA_PROGRAM_MANAGED}', - 'MAVEN_GROUP_ID': extract_macro_calls(unit, 'MAVEN_GROUP_ID_VALUE', args_delim), - 'JAR_INCLUDE_FILTER': extract_macro_calls(unit, 'JAR_INCLUDE_FILTER_VALUE', args_delim), - 'JAR_EXCLUDE_FILTER': extract_macro_calls(unit, 'JAR_EXCLUDE_FILTER_VALUE', args_delim), + 'MAVEN_GROUP_ID': extract_macro_calls(unit, 'MAVEN_GROUP_ID_VALUE', args_delim), + 'JAR_INCLUDE_FILTER': extract_macro_calls(unit, 'JAR_INCLUDE_FILTER_VALUE', args_delim), + 'JAR_EXCLUDE_FILTER': extract_macro_calls(unit, 'JAR_EXCLUDE_FILTER_VALUE', args_delim), # TODO remove when java test dart is in prod 'UNITTEST_DIR': unit.get('UNITTEST_DIR'), @@ -116,70 +116,70 @@ def onjava_module(unit, *args): 'TIMEOUT': extract_macro_calls(unit, 'TEST_TIMEOUT', args_delim), 'TAG': extract_macro_calls(unit, 'TEST_TAGS_VALUE', args_delim), 'SIZE': extract_macro_calls(unit, 'TEST_SIZE_NAME', args_delim), - 'DEPENDS': extract_macro_calls(unit, 'TEST_DEPENDS_VALUE', args_delim), - 'IDEA_EXCLUDE': extract_macro_calls(unit, 'IDEA_EXCLUDE_DIRS_VALUE', args_delim), - 'IDEA_RESOURCE': extract_macro_calls(unit, 'IDEA_RESOURCE_DIRS_VALUE', args_delim), - 'IDEA_MODULE_NAME': extract_macro_calls(unit, 'IDEA_MODULE_NAME_VALUE', args_delim), - 'GENERATE_SCRIPT': extract_macro_calls2(unit, 'GENERATE_SCRIPT_VALUE'), - 'FAKEID': extract_macro_calls(unit, 'FAKEID', args_delim), - 'TEST_DATA': extract_macro_calls(unit, 'TEST_DATA_VALUE', args_delim), - 'JAVA_FORBIDDEN_LIBRARIES': extract_macro_calls(unit, 'JAVA_FORBIDDEN_LIBRARIES_VALUE', args_delim), - 'JDK_RESOURCE': 'JDK' + (unit.get('JDK_VERSION') or '_DEFAULT') + 'DEPENDS': extract_macro_calls(unit, 'TEST_DEPENDS_VALUE', args_delim), + 'IDEA_EXCLUDE': extract_macro_calls(unit, 'IDEA_EXCLUDE_DIRS_VALUE', args_delim), + 'IDEA_RESOURCE': extract_macro_calls(unit, 'IDEA_RESOURCE_DIRS_VALUE', args_delim), + 'IDEA_MODULE_NAME': extract_macro_calls(unit, 'IDEA_MODULE_NAME_VALUE', args_delim), + 'GENERATE_SCRIPT': extract_macro_calls2(unit, 'GENERATE_SCRIPT_VALUE'), + 'FAKEID': extract_macro_calls(unit, 'FAKEID', args_delim), + 'TEST_DATA': extract_macro_calls(unit, 'TEST_DATA_VALUE', args_delim), + 'JAVA_FORBIDDEN_LIBRARIES': extract_macro_calls(unit, 'JAVA_FORBIDDEN_LIBRARIES_VALUE', args_delim), + 'JDK_RESOURCE': 'JDK' + (unit.get('JDK_VERSION') or '_DEFAULT') } - if unit.get('ENABLE_PREVIEW_VALUE') == 'yes' and unit.get('JDK_VERSION') in ('15', '16', '17'): - data['ENABLE_PREVIEW'] = extract_macro_calls(unit, 'ENABLE_PREVIEW_VALUE', args_delim) - - if unit.get('SAVE_JAVAC_GENERATED_SRCS_DIR') and unit.get('SAVE_JAVAC_GENERATED_SRCS_TAR'): - data['SAVE_JAVAC_GENERATED_SRCS_DIR'] = extract_macro_calls(unit, 'SAVE_JAVAC_GENERATED_SRCS_DIR', args_delim) - data['SAVE_JAVAC_GENERATED_SRCS_TAR'] = extract_macro_calls(unit, 'SAVE_JAVAC_GENERATED_SRCS_TAR', args_delim) - - if unit.get('JAVA_ADD_DLLS_VALUE') == 'yes': - data['ADD_DLLS_FROM_DEPENDS'] = extract_macro_calls(unit, 'JAVA_ADD_DLLS_VALUE', args_delim) - - if unit.get('ERROR_PRONE_VALUE') == 'yes': - data['ERROR_PRONE'] = extract_macro_calls(unit, 'ERROR_PRONE_VALUE', args_delim) - - if unit.get('WITH_KOTLIN_VALUE') == 'yes': - data['WITH_KOTLIN'] = extract_macro_calls(unit, 'WITH_KOTLIN_VALUE', args_delim) - if unit.get('KOTLIN_JVM_TARGET'): - data['KOTLIN_JVM_TARGET'] = extract_macro_calls(unit, 'KOTLIN_JVM_TARGET', args_delim) + if unit.get('ENABLE_PREVIEW_VALUE') == 'yes' and unit.get('JDK_VERSION') in ('15', '16', '17'): + data['ENABLE_PREVIEW'] = extract_macro_calls(unit, 'ENABLE_PREVIEW_VALUE', args_delim) + + if unit.get('SAVE_JAVAC_GENERATED_SRCS_DIR') and unit.get('SAVE_JAVAC_GENERATED_SRCS_TAR'): + data['SAVE_JAVAC_GENERATED_SRCS_DIR'] = extract_macro_calls(unit, 'SAVE_JAVAC_GENERATED_SRCS_DIR', args_delim) + data['SAVE_JAVAC_GENERATED_SRCS_TAR'] = extract_macro_calls(unit, 'SAVE_JAVAC_GENERATED_SRCS_TAR', args_delim) + + if unit.get('JAVA_ADD_DLLS_VALUE') == 'yes': + data['ADD_DLLS_FROM_DEPENDS'] = extract_macro_calls(unit, 'JAVA_ADD_DLLS_VALUE', args_delim) + + if unit.get('ERROR_PRONE_VALUE') == 'yes': + data['ERROR_PRONE'] = extract_macro_calls(unit, 'ERROR_PRONE_VALUE', args_delim) + + if unit.get('WITH_KOTLIN_VALUE') == 'yes': + data['WITH_KOTLIN'] = extract_macro_calls(unit, 'WITH_KOTLIN_VALUE', args_delim) + if unit.get('KOTLIN_JVM_TARGET'): + data['KOTLIN_JVM_TARGET'] = extract_macro_calls(unit, 'KOTLIN_JVM_TARGET', args_delim) if unit.get('KOTLINC_FLAGS_VALUE'): data['KOTLINC_FLAGS'] = extract_macro_calls(unit, 'KOTLINC_FLAGS_VALUE', args_delim) - if unit.get('KOTLINC_OPTS_VALUE'): - data['KOTLINC_OPTS'] = extract_macro_calls(unit, 'KOTLINC_OPTS_VALUE', args_delim) - - if unit.get('DIRECT_DEPS_ONLY_VALUE') == 'yes': - data['DIRECT_DEPS_ONLY'] = extract_macro_calls(unit, 'DIRECT_DEPS_ONLY_VALUE', args_delim) - - if unit.get('JAVA_EXTERNAL_DEPENDENCIES_VALUE'): - valid = [] - for dep in sum(extract_macro_calls(unit, 'JAVA_EXTERNAL_DEPENDENCIES_VALUE', args_delim), []): - if os.path.normpath(dep).startswith('..'): - ymake.report_configure_error('{}: {} - relative paths in JAVA_EXTERNAL_DEPENDENCIES is not allowed'.format(unit.path(), dep)) - elif os.path.isabs(dep): - ymake.report_configure_error('{}: {} absolute paths in JAVA_EXTERNAL_DEPENDENCIES is not allowed'.format(unit.path(), dep)) - else: - valid.append(dep) - if valid: - data['EXTERNAL_DEPENDENCIES'] = [valid] - - if unit.get('MAKE_UBERJAR_VALUE') == 'yes': - if unit.get('MODULE_TYPE') != 'JAVA_PROGRAM': - ymake.report_configure_error('{}: UBERJAR supported only for JAVA_PROGRAM module type'.format(unit.path())) - data['UBERJAR'] = extract_macro_calls(unit, 'MAKE_UBERJAR_VALUE', args_delim) - data['UBERJAR_PREFIX'] = extract_macro_calls(unit, 'UBERJAR_PREFIX_VALUE', args_delim) - data['UBERJAR_HIDE_EXCLUDE'] = extract_macro_calls(unit, 'UBERJAR_HIDE_EXCLUDE_VALUE', args_delim) - data['UBERJAR_PATH_EXCLUDE'] = extract_macro_calls(unit, 'UBERJAR_PATH_EXCLUDE_VALUE', args_delim) - data['UBERJAR_MANIFEST_TRANSFORMER_MAIN'] = extract_macro_calls(unit, 'UBERJAR_MANIFEST_TRANSFORMER_MAIN_VALUE', args_delim) - data['UBERJAR_MANIFEST_TRANSFORMER_ATTRIBUTE'] = extract_macro_calls(unit, 'UBERJAR_MANIFEST_TRANSFORMER_ATTRIBUTE_VALUE', args_delim) - data['UBERJAR_APPENDING_TRANSFORMER'] = extract_macro_calls(unit, 'UBERJAR_APPENDING_TRANSFORMER_VALUE', args_delim) - data['UBERJAR_SERVICES_RESOURCE_TRANSFORMER'] = extract_macro_calls(unit, 'UBERJAR_SERVICES_RESOURCE_TRANSFORMER_VALUE', args_delim) - - if unit.get('WITH_JDK_VALUE') == 'yes': - if unit.get('MODULE_TYPE') != 'JAVA_PROGRAM': - ymake.report_configure_error('{}: JDK export supported only for JAVA_PROGRAM module type'.format(unit.path())) - data['WITH_JDK'] = extract_macro_calls(unit, 'WITH_JDK_VALUE', args_delim) - + if unit.get('KOTLINC_OPTS_VALUE'): + data['KOTLINC_OPTS'] = extract_macro_calls(unit, 'KOTLINC_OPTS_VALUE', args_delim) + + if unit.get('DIRECT_DEPS_ONLY_VALUE') == 'yes': + data['DIRECT_DEPS_ONLY'] = extract_macro_calls(unit, 'DIRECT_DEPS_ONLY_VALUE', args_delim) + + if unit.get('JAVA_EXTERNAL_DEPENDENCIES_VALUE'): + valid = [] + for dep in sum(extract_macro_calls(unit, 'JAVA_EXTERNAL_DEPENDENCIES_VALUE', args_delim), []): + if os.path.normpath(dep).startswith('..'): + ymake.report_configure_error('{}: {} - relative paths in JAVA_EXTERNAL_DEPENDENCIES is not allowed'.format(unit.path(), dep)) + elif os.path.isabs(dep): + ymake.report_configure_error('{}: {} absolute paths in JAVA_EXTERNAL_DEPENDENCIES is not allowed'.format(unit.path(), dep)) + else: + valid.append(dep) + if valid: + data['EXTERNAL_DEPENDENCIES'] = [valid] + + if unit.get('MAKE_UBERJAR_VALUE') == 'yes': + if unit.get('MODULE_TYPE') != 'JAVA_PROGRAM': + ymake.report_configure_error('{}: UBERJAR supported only for JAVA_PROGRAM module type'.format(unit.path())) + data['UBERJAR'] = extract_macro_calls(unit, 'MAKE_UBERJAR_VALUE', args_delim) + data['UBERJAR_PREFIX'] = extract_macro_calls(unit, 'UBERJAR_PREFIX_VALUE', args_delim) + data['UBERJAR_HIDE_EXCLUDE'] = extract_macro_calls(unit, 'UBERJAR_HIDE_EXCLUDE_VALUE', args_delim) + data['UBERJAR_PATH_EXCLUDE'] = extract_macro_calls(unit, 'UBERJAR_PATH_EXCLUDE_VALUE', args_delim) + data['UBERJAR_MANIFEST_TRANSFORMER_MAIN'] = extract_macro_calls(unit, 'UBERJAR_MANIFEST_TRANSFORMER_MAIN_VALUE', args_delim) + data['UBERJAR_MANIFEST_TRANSFORMER_ATTRIBUTE'] = extract_macro_calls(unit, 'UBERJAR_MANIFEST_TRANSFORMER_ATTRIBUTE_VALUE', args_delim) + data['UBERJAR_APPENDING_TRANSFORMER'] = extract_macro_calls(unit, 'UBERJAR_APPENDING_TRANSFORMER_VALUE', args_delim) + data['UBERJAR_SERVICES_RESOURCE_TRANSFORMER'] = extract_macro_calls(unit, 'UBERJAR_SERVICES_RESOURCE_TRANSFORMER_VALUE', args_delim) + + if unit.get('WITH_JDK_VALUE') == 'yes': + if unit.get('MODULE_TYPE') != 'JAVA_PROGRAM': + ymake.report_configure_error('{}: JDK export supported only for JAVA_PROGRAM module type'.format(unit.path())) + data['WITH_JDK'] = extract_macro_calls(unit, 'WITH_JDK_VALUE', args_delim) + if not data['EXTERNAL_JAR']: has_processor = extract_macro_calls(unit, 'GENERATE_VCS_JAVA_INFO_NODEP', args_delim) data['EMBED_VCS'] = [[str(has_processor and has_processor[0] and has_processor[0][0])]] @@ -221,8 +221,8 @@ def onjava_module(unit, *args): unit.set_property(['JAVA_DART_DATA', dart]) if not idea_only and unit.get('MODULE_TYPE') in ('JAVA_PROGRAM', 'JAVA_LIBRARY', 'JTEST', 'TESTNG', 'JUNIT5') and not unit.path().startswith('$S/contrib/java'): unit.on_add_classpath_clash_check() - if unit.get('LINT_LEVEL_VALUE') != "none": - unit.onadd_check(['JAVA_STYLE', unit.get('LINT_LEVEL_VALUE')]) + if unit.get('LINT_LEVEL_VALUE') != "none": + unit.onadd_check(['JAVA_STYLE', unit.get('LINT_LEVEL_VALUE')]) def on_add_java_style_checks(unit, *args): @@ -364,11 +364,11 @@ def parse_words(words): def on_ymake_generate_script(unit, *args): for out, tmpl, props in parse_words(list(args)): unit.on_add_gen_java_script([out, tmpl] + list(props)) - -def on_jdk_version_macro_check(unit, *args): - if len(args) != 1: - unit.message(["error", "Invalid syntax. Single argument required."]) - jdk_version = args[0] - availible_versions = ('10', '11', '12', '13', '14', '15', '16', '17',) - if jdk_version not in availible_versions: - unit.message(["error", "Invalid jdk version: {}. {} are availible".format(jdk_version, availible_versions)]) + +def on_jdk_version_macro_check(unit, *args): + if len(args) != 1: + unit.message(["error", "Invalid syntax. Single argument required."]) + jdk_version = args[0] + availible_versions = ('10', '11', '12', '13', '14', '15', '16', '17',) + if jdk_version not in availible_versions: + unit.message(["error", "Invalid jdk version: {}. {} are availible".format(jdk_version, availible_versions)]) diff --git a/build/plugins/pybuild.py b/build/plugins/pybuild.py index f32a2d39a0..781ee89584 100644 --- a/build/plugins/pybuild.py +++ b/build/plugins/pybuild.py @@ -492,7 +492,7 @@ def onpy_srcs(unit, *args): cpp_runtime_path = 'contrib/libs/protobuf' py_runtime_path = 'contrib/python/protobuf' builtin_proto_path = cpp_runtime_path + '/' + BUILTIN_PROTO - + if protos: if not upath.startswith(py_runtime_path) and not upath.startswith(builtin_proto_path): unit.onpeerdir(py_runtime_path) diff --git a/build/plugins/res.py b/build/plugins/res.py index a937caba81..8928cc99e8 100644 --- a/build/plugins/res.py +++ b/build/plugins/res.py @@ -1,31 +1,31 @@ from _common import iterpair, listid, pathid, rootrel_arc_src, tobuilddir, filter_out_by_keyword -def split(lst, limit): - # paths are specified with replaceable prefix - # real length is unknown at the moment, that why we use root_lenght - # as a rough estimation - root_lenght = 200 - filepath = None - lenght = 0 - bucket = [] - - for item in lst: - if filepath: - lenght += root_lenght + len(filepath) + len(item) - if lenght > limit and bucket: - yield bucket - bucket = [] - lenght = 0 - - bucket.append(filepath) - bucket.append(item) - filepath = None - else: - filepath = item - - if bucket: - yield bucket +def split(lst, limit): + # paths are specified with replaceable prefix + # real length is unknown at the moment, that why we use root_lenght + # as a rough estimation + root_lenght = 200 + filepath = None + lenght = 0 + bucket = [] + + for item in lst: + if filepath: + lenght += root_lenght + len(filepath) + len(item) + if lenght > limit and bucket: + yield bucket + bucket = [] + lenght = 0 + + bucket.append(filepath) + bucket.append(item) + filepath = None + else: + filepath = item + + if bucket: + yield bucket def remove_prefix(text, prefix): @@ -34,7 +34,7 @@ def remove_prefix(text, prefix): return text -def onfat_resource(unit, *args): +def onfat_resource(unit, *args): unit.onpeerdir(['library/cpp/resource']) # Since the maximum length of lpCommandLine string for CreateProcess is 8kb (windows) characters, diff --git a/build/plugins/rodata.py b/build/plugins/rodata.py index 3ecb0f9a83..43f99cd6af 100644 --- a/build/plugins/rodata.py +++ b/build/plugins/rodata.py @@ -5,119 +5,119 @@ import _common as common import _import_wrapper as iw -class ROData(iw.CustomCommand): - def __init__(self, path, unit): - self._path = path - self._flags = [] - - prefix = unit.get('ASM_PREFIX') - - if prefix: - self._flags += ['--prefix=' + prefix] - - self._pre_include = [] - - flags = unit.get('YASM_FLAGS') - if flags: - self.parse_flags(path, unit, collections.deque(flags.split(' '))) - +class ROData(iw.CustomCommand): + def __init__(self, path, unit): + self._path = path + self._flags = [] + + prefix = unit.get('ASM_PREFIX') + + if prefix: + self._flags += ['--prefix=' + prefix] + + self._pre_include = [] + + flags = unit.get('YASM_FLAGS') + if flags: + self.parse_flags(path, unit, collections.deque(flags.split(' '))) + if unit.enabled('DARWIN') or unit.enabled('IOS'): - self._platform = ['DARWIN', 'UNIX'] - self._fmt = 'macho' + self._platform = ['DARWIN', 'UNIX'] + self._fmt = 'macho' elif unit.enabled('WIN64') or unit.enabled('CYGWIN'): - self._platform = ['WIN64'] - self._fmt = 'win' + self._platform = ['WIN64'] + self._fmt = 'win' elif unit.enabled('WIN32'): - self._platform = ['WIN32'] - self._fmt = 'win' - else: - self._platform = ['UNIX'] - self._fmt = 'elf' - - if 'elf' in self._fmt: - self._flags += ['-g', 'dwarf2'] - + self._platform = ['WIN32'] + self._fmt = 'win' + else: + self._platform = ['UNIX'] + self._fmt = 'elf' + + if 'elf' in self._fmt: + self._flags += ['-g', 'dwarf2'] + self._fmt += unit.get('HARDWARE_ARCH') self._type = unit.get('HARDWARE_TYPE') - + if unit.enabled('DARWIN') or unit.enabled('IOS') or (unit.enabled('WINDOWS') and unit.enabled('ARCH_TYPE_32')): - self._prefix = '_' - else: - self._prefix = '' - - def parse_flags(self, path, unit, flags): - while flags: - flag = flags.popleft() - if flag.startswith('-I'): - raise Exception('Use ADDINCL macro') - - if flag.startswith('-P'): - preinclude = flag[2:] or flags.popleft() - self._pre_include += unit.resolve_include([(get_retargeted(path, unit)), preinclude]) - self._flags += ['-P', preinclude] - continue - - self._flags.append(flag) - - def descr(self): - return 'AS', self._path, 'light-green' - - def flags(self): - return self._flags + self._platform + [self._fmt, self._type] - - def tools(self): - return ['contrib/tools/yasm'] - - def input(self): - return common.make_tuples(self._pre_include + [self._path]) - - def output(self): - return common.make_tuples([common.tobuilddir(common.stripext(self._path)) + '.o']) - + self._prefix = '_' + else: + self._prefix = '' + + def parse_flags(self, path, unit, flags): + while flags: + flag = flags.popleft() + if flag.startswith('-I'): + raise Exception('Use ADDINCL macro') + + if flag.startswith('-P'): + preinclude = flag[2:] or flags.popleft() + self._pre_include += unit.resolve_include([(get_retargeted(path, unit)), preinclude]) + self._flags += ['-P', preinclude] + continue + + self._flags.append(flag) + + def descr(self): + return 'AS', self._path, 'light-green' + + def flags(self): + return self._flags + self._platform + [self._fmt, self._type] + + def tools(self): + return ['contrib/tools/yasm'] + + def input(self): + return common.make_tuples(self._pre_include + [self._path]) + + def output(self): + return common.make_tuples([common.tobuilddir(common.stripext(self._path)) + '.o']) + def requested_vars(self): return [('includes', '_ASM__INCLUDE')] def run(self, extra_args, binary): - in_file = self.resolve_path(common.get(self.input, 0)) - in_file_no_ext = common.stripext(in_file) - file_name = os.path.basename(in_file_no_ext) + in_file = self.resolve_path(common.get(self.input, 0)) + in_file_no_ext = common.stripext(in_file) + file_name = os.path.basename(in_file_no_ext) file_size = os.path.getsize(in_file) - tmp_file = self.resolve_path(common.get(self.output, 0) + '.asm') - + tmp_file = self.resolve_path(common.get(self.output, 0) + '.asm') + parser = argparse.ArgumentParser(prog='rodata.py', add_help=False) parser.add_argument('--includes', help='module\'s addincls', nargs='*', required=False) args = parser.parse_args(extra_args) self._incl_dirs = args.includes - with open(tmp_file, 'w') as f: - f.write('global ' + self._prefix + file_name + '\n') - f.write('global ' + self._prefix + file_name + 'Size' + '\n') + with open(tmp_file, 'w') as f: + f.write('global ' + self._prefix + file_name + '\n') + f.write('global ' + self._prefix + file_name + 'Size' + '\n') f.write('SECTION .rodata ALIGN=16\n') - f.write(self._prefix + file_name + ':\nincbin "' + in_file + '"\n') + f.write(self._prefix + file_name + ':\nincbin "' + in_file + '"\n') f.write('align 4, db 0\n') f.write(self._prefix + file_name + 'Size:\ndd ' + str(file_size) + '\n') - + if self._fmt.startswith('elf'): f.write('size ' + self._prefix + file_name + ' ' + str(file_size) + '\n') f.write('size ' + self._prefix + file_name + 'Size 4\n') - return self.do_run(binary, tmp_file) - - def do_run(self, binary, path): - def plt(): - for x in self._platform: - yield '-D' - yield x - - def incls(): - for x in self._incl_dirs: - yield '-I' + return self.do_run(binary, tmp_file) + + def do_run(self, binary, path): + def plt(): + for x in self._platform: + yield '-D' + yield x + + def incls(): + for x in self._incl_dirs: + yield '-I' yield x - - cmd = [binary, '-f', self._fmt] + list(plt()) + ['-D', '_' + self._type + '_', '-D_YASM_'] + self._flags + list(incls()) + ['-o', common.get(self.output, 0), path] - self.call(cmd) - - + + cmd = [binary, '-f', self._fmt] + list(plt()) + ['-D', '_' + self._type + '_', '-D_YASM_'] + self._flags + list(incls()) + ['-o', common.get(self.output, 0), path] + self.call(cmd) + + class RODataCXX(iw.CustomCommand): def __init__(self, path, unit): self._path = path diff --git a/build/plugins/scarab_cant_clash.py b/build/plugins/scarab_cant_clash.py index 77dc303183..451dccf1f6 100644 --- a/build/plugins/scarab_cant_clash.py +++ b/build/plugins/scarab_cant_clash.py @@ -63,4 +63,4 @@ def onacceleo(unit, *args): if depends: run_java += ['TOOL'] + depends - unit.on_run_java(run_java) + unit.on_run_java(run_java) diff --git a/build/plugins/swig.py b/build/plugins/swig.py index 32a37204a6..4af6c9db7e 100644 --- a/build/plugins/swig.py +++ b/build/plugins/swig.py @@ -24,7 +24,7 @@ class Swig(iw.CustomCommand): relpath = os.path.relpath(os.path.dirname(self._path), unit.path()) - self._swig_lang = unit.get('SWIG_LANG') + self._swig_lang = unit.get('SWIG_LANG') if self._swig_lang != 'jni_java': self._main_out = os.path.join( @@ -56,14 +56,14 @@ class Swig(iw.CustomCommand): if not self._local_swig: unit.onaddincl(incl_dirs) - if self._swig_lang == 'python': + if self._swig_lang == 'python': self._out_name = modname + '.py' self._flags.extend(['-interface', unit.get('MODULE_PREFIX') + modname]) - if self._swig_lang == 'perl': + if self._swig_lang == 'perl': self._out_name = modname + '.pm' self._flags.append('-shadow') - unit.onpeerdir(['build/platform/perl']) + unit.onpeerdir(['build/platform/perl']) if self._swig_lang in ['jni_cpp', 'java']: self._out_header = os.path.splitext(self._main_out)[0] + '.h' @@ -98,7 +98,7 @@ class Swig(iw.CustomCommand): return [ (self._main_out, []), - (common.join_intl_paths(self._bindir, self._out_name), (['noauto', 'add_to_outs'] if self._swig_lang != 'java' else [])), + (common.join_intl_paths(self._bindir, self._out_name), (['noauto', 'add_to_outs'] if self._swig_lang != 'java' else [])), ] + ([(self._out_header, [])] if self._swig_lang == 'java' else []) def output_includes(self): @@ -118,7 +118,7 @@ class Swig(iw.CustomCommand): '-outdir', self.resolve_path(self._bindir) ] + self._incl_flags() + [self.resolve_path(path)]) - def do_run_java(self, binary, path): + def do_run_java(self, binary, path): import tarfile outdir = self.resolve_path(self._bindir) @@ -126,7 +126,7 @@ class Swig(iw.CustomCommand): java_srcs_dir = os.path.join(outdir, self._package.replace('.', '/')) if not os.path.exists(java_srcs_dir): os.makedirs(java_srcs_dir) - + flags = self._incl_flags() src = self.resolve_path(path) with open(src, 'r') as f: diff --git a/build/plugins/ytest.py b/build/plugins/ytest.py index 8970837f0f..1e256c7f50 100644 --- a/build/plugins/ytest.py +++ b/build/plugins/ytest.py @@ -212,10 +212,10 @@ def validate_test(unit, kw): else: try: timeout = int(valid_kw.get('TEST-TIMEOUT', size_timeout[size]) or size_timeout[size]) - script_rel_path = valid_kw.get('SCRIPT-REL-PATH') + script_rel_path = valid_kw.get('SCRIPT-REL-PATH') if timeout < 0: raise Exception("Timeout must be > 0") - if size_timeout[size] < timeout and in_autocheck and script_rel_path != 'java.style': + if size_timeout[size] < timeout and in_autocheck and script_rel_path != 'java.style': suggested_size = None for s, t in size_timeout.items(): if timeout <= t: @@ -433,8 +433,8 @@ def onadd_ytest(unit, *args): elif flat_args[1] == "clang_tidy" and unit.get("TIDY") != "yes": # Graph is not prepared return - elif flat_args[1] == "no.test": - return + elif flat_args[1] == "no.test": + return test_size = ''.join(spec_args.get('SIZE', [])) or unit.get('TEST_SIZE_NAME') or '' test_tags = serialize_list(_get_test_tags(unit, spec_args)) test_timeout = ''.join(spec_args.get('TIMEOUT', [])) or unit.get('TEST_TIMEOUT') or '' @@ -500,9 +500,9 @@ def onadd_ytest(unit, *args): 'YT-SPEC': serialize_list(spec_args.get('YT_SPEC', []) + get_unit_list_variable(unit, 'TEST_YT_SPEC_VALUE')), 'BLOB': unit.get('TEST_BLOB_DATA') or '', 'SKIP_TEST': unit.get('SKIP_TEST_VALUE') or '', - 'TEST_IOS_DEVICE_TYPE': unit.get('TEST_IOS_DEVICE_TYPE_VALUE') or '', - 'TEST_IOS_RUNTIME_TYPE': unit.get('TEST_IOS_RUNTIME_TYPE_VALUE') or '', - 'ANDROID_APK_TEST_ACTIVITY': unit.get('ANDROID_APK_TEST_ACTIVITY_VALUE') or '', + 'TEST_IOS_DEVICE_TYPE': unit.get('TEST_IOS_DEVICE_TYPE_VALUE') or '', + 'TEST_IOS_RUNTIME_TYPE': unit.get('TEST_IOS_RUNTIME_TYPE_VALUE') or '', + 'ANDROID_APK_TEST_ACTIVITY': unit.get('ANDROID_APK_TEST_ACTIVITY_VALUE') or '', 'TEST_PARTITION': unit.get("TEST_PARTITION") or 'SEQUENTIAL', 'GO_BENCH_TIMEOUT': unit.get('GO_BENCH_TIMEOUT') or '', } @@ -552,38 +552,38 @@ def onadd_check(unit, *args): check_type = flat_args[0] test_dir = get_norm_unit_path(unit) - test_timeout = '' + test_timeout = '' fork_mode = '' extra_test_data = '' - extra_test_dart_data = {} + extra_test_dart_data = {} ymake_java_test = unit.get('YMAKE_JAVA_TEST') == 'yes' if check_type in ["flake8.py2", "flake8.py3"]: script_rel_path = check_type fork_mode = unit.get('TEST_FORK_MODE') or '' - elif check_type == "JAVA_STYLE": + elif check_type == "JAVA_STYLE": if ymake_java_test and not unit.get('ALL_SRCDIRS') or '': return - if len(flat_args) < 2: - raise Exception("Not enough arguments for JAVA_STYLE check") - check_level = flat_args[1] - allowed_levels = { - 'base': '/yandex_checks.xml', - 'strict': '/yandex_checks_strict.xml', + if len(flat_args) < 2: + raise Exception("Not enough arguments for JAVA_STYLE check") + check_level = flat_args[1] + allowed_levels = { + 'base': '/yandex_checks.xml', + 'strict': '/yandex_checks_strict.xml', 'extended': '/yandex_checks_extended.xml', 'library': '/yandex_checks_library.xml', - } - if check_level not in allowed_levels: - raise Exception('{} is not allowed in LINT(), use one of {}'.format(check_level, allowed_levels.keys())) - flat_args[1] = allowed_levels[check_level] + } + if check_level not in allowed_levels: + raise Exception('{} is not allowed in LINT(), use one of {}'.format(check_level, allowed_levels.keys())) + flat_args[1] = allowed_levels[check_level] if check_level == 'none': return - script_rel_path = "java.style" - test_timeout = '120' + script_rel_path = "java.style" + test_timeout = '120' fork_mode = unit.get('TEST_FORK_MODE') or '' if ymake_java_test: extra_test_data = java_srcdirs_to_data(unit, 'ALL_SRCDIRS') - extra_test_dart_data['JDK_RESOURCE'] = 'JDK' + (unit.get('JDK_VERSION') or '_DEFAULT') + extra_test_dart_data['JDK_RESOURCE'] = 'JDK' + (unit.get('JDK_VERSION') or '_DEFAULT') elif check_type == "gofmt": script_rel_path = check_type go_files = flat_args[1:] @@ -615,7 +615,7 @@ def onadd_check(unit, *args): test_record = { 'TEST-NAME': check_type.lower(), - 'TEST-TIMEOUT': test_timeout, + 'TEST-TIMEOUT': test_timeout, 'SCRIPT-REL-PATH': script_rel_path, 'TESTED-PROJECT-NAME': os.path.basename(test_dir), 'SOURCE-FOLDER-PATH': test_dir, @@ -637,7 +637,7 @@ def onadd_check(unit, *args): 'TEST-FILES': test_files, 'NO_JBUILD': 'yes' if ymake_java_test else 'no', } - test_record.update(extra_test_dart_data) + test_record.update(extra_test_dart_data) data = dump_test(unit, test_record) if data: @@ -804,11 +804,11 @@ def onjava_test(unit, *args): ymake.report_configure_error('skip JTEST_FOR in {}: no args provided'.format(unit.path())) return - java_cp_arg_type = unit.get('JAVA_CLASSPATH_CMD_TYPE_VALUE') or 'MANIFEST' - if java_cp_arg_type not in ('MANIFEST', 'COMMAND_FILE', 'LIST'): - ymake.report_configure_error('{}: TEST_JAVA_CLASSPATH_CMD_TYPE({}) are invalid. Choose argument from MANIFEST, COMMAND_FILE or LIST)'.format(unit.path(), java_cp_arg_type)) - return - + java_cp_arg_type = unit.get('JAVA_CLASSPATH_CMD_TYPE_VALUE') or 'MANIFEST' + if java_cp_arg_type not in ('MANIFEST', 'COMMAND_FILE', 'LIST'): + ymake.report_configure_error('{}: TEST_JAVA_CLASSPATH_CMD_TYPE({}) are invalid. Choose argument from MANIFEST, COMMAND_FILE or LIST)'.format(unit.path(), java_cp_arg_type)) + return + unit_path = unit.path() path = _common.strip_roots(unit_path) @@ -862,9 +862,9 @@ def onjava_test(unit, *args): 'TEST-CWD': test_cwd, 'SKIP_TEST': unit.get('SKIP_TEST_VALUE') or '', 'JAVA_CLASSPATH_CMD_TYPE': java_cp_arg_type, - 'NO_JBUILD': 'yes' if ymake_java_test else 'no', - 'JDK_RESOURCE': 'JDK' + (unit.get('JDK_VERSION') or '_DEFAULT'), - 'JDK_FOR_TESTS': 'JDK' + (unit.get('JDK_VERSION') or '_DEFAULT') + '_FOR_TESTS', + 'NO_JBUILD': 'yes' if ymake_java_test else 'no', + 'JDK_RESOURCE': 'JDK' + (unit.get('JDK_VERSION') or '_DEFAULT'), + 'JDK_FOR_TESTS': 'JDK' + (unit.get('JDK_VERSION') or '_DEFAULT') + '_FOR_TESTS', } test_classpath_origins = unit.get('TEST_CLASSPATH_VALUE') if test_classpath_origins: @@ -883,50 +883,50 @@ def onjava_test(unit, *args): unit.set_property(['DART_DATA', data]) -def onjava_test_deps(unit, *args): +def onjava_test_deps(unit, *args): if unit.get("TIDY") == "yes": # graph changed for clang_tidy tests return - assert unit.get('MODULE_TYPE') is not None - assert len(args) == 1 - mode = args[0] - + assert unit.get('MODULE_TYPE') is not None + assert len(args) == 1 + mode = args[0] + path = get_norm_unit_path(unit) ymake_java_test = unit.get('YMAKE_JAVA_TEST') == 'yes' - - test_record = { - 'SOURCE-FOLDER-PATH': path, - 'TEST-NAME': '-'.join([os.path.basename(os.path.dirname(path)), os.path.basename(path), 'dependencies']).strip('-'), - 'SCRIPT-REL-PATH': 'java.dependency.test', - 'TEST-TIMEOUT': '', - 'TESTED-PROJECT-NAME': path, - 'TEST-DATA': '', + + test_record = { + 'SOURCE-FOLDER-PATH': path, + 'TEST-NAME': '-'.join([os.path.basename(os.path.dirname(path)), os.path.basename(path), 'dependencies']).strip('-'), + 'SCRIPT-REL-PATH': 'java.dependency.test', + 'TEST-TIMEOUT': '', + 'TESTED-PROJECT-NAME': path, + 'TEST-DATA': '', 'TEST_PARTITION': 'SEQUENTIAL', - 'FORK-MODE': '', - 'SPLIT-FACTOR': '', - 'CUSTOM-DEPENDENCIES': ' '.join(get_values_list(unit, 'TEST_DEPENDS_VALUE')), - 'TAG': '', - 'SIZE': 'SMALL', - 'IGNORE_CLASSPATH_CLASH': ' '.join(get_values_list(unit, 'JAVA_IGNORE_CLASSPATH_CLASH_VALUE')), + 'FORK-MODE': '', + 'SPLIT-FACTOR': '', + 'CUSTOM-DEPENDENCIES': ' '.join(get_values_list(unit, 'TEST_DEPENDS_VALUE')), + 'TAG': '', + 'SIZE': 'SMALL', + 'IGNORE_CLASSPATH_CLASH': ' '.join(get_values_list(unit, 'JAVA_IGNORE_CLASSPATH_CLASH_VALUE')), 'NO_JBUILD': 'yes' if ymake_java_test else 'no', - - # JTEST/JTEST_FOR only - 'MODULE_TYPE': unit.get('MODULE_TYPE'), - 'UNITTEST_DIR': '', - 'SYSTEM_PROPERTIES': '', - 'TEST-CWD': '', - } - if mode == 'strict': - test_record['STRICT_CLASSPATH_CLASH'] = 'yes' - + + # JTEST/JTEST_FOR only + 'MODULE_TYPE': unit.get('MODULE_TYPE'), + 'UNITTEST_DIR': '', + 'SYSTEM_PROPERTIES': '', + 'TEST-CWD': '', + } + if mode == 'strict': + test_record['STRICT_CLASSPATH_CLASH'] = 'yes' + if ymake_java_test: test_record['CLASSPATH'] = '$B/{}/{}.jar ${{DART_CLASSPATH}}'.format(unit.get('MODDIR'), unit.get('REALPRJNAME')) data = dump_test(unit, test_record) - unit.set_property(['DART_DATA', data]) - - + unit.set_property(['DART_DATA', data]) + + def _get_test_tags(unit, spec_args=None): if spec_args is None: spec_args = {} |