diff options
author | Devtools Arcadia <arcadia-devtools@yandex-team.ru> | 2022-02-07 18:08:42 +0300 |
---|---|---|
committer | Devtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net> | 2022-02-07 18:08:42 +0300 |
commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /build/plugins/ios_assets.py | |
download | ydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'build/plugins/ios_assets.py')
-rw-r--r-- | build/plugins/ios_assets.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/build/plugins/ios_assets.py b/build/plugins/ios_assets.py new file mode 100644 index 0000000000..5f0ccb9467 --- /dev/null +++ b/build/plugins/ios_assets.py @@ -0,0 +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) |