summaryrefslogtreecommitdiffstats
path: root/build/plugins/ios_assets.py
diff options
context:
space:
mode:
authoralexv-smirnov <[email protected]>2023-03-15 19:59:12 +0300
committeralexv-smirnov <[email protected]>2023-03-15 19:59:12 +0300
commit056bb284ccf8dd6793ec3a54ffa36c4fb2b9ad11 (patch)
tree4740980126f32e3af7937ba0ca5f83e59baa4ab0 /build/plugins/ios_assets.py
parent269126dcced1cc8b53eb4398b4a33e5142f10290 (diff)
add library/cpp/actors, ymake build to ydb oss export
Diffstat (limited to 'build/plugins/ios_assets.py')
-rw-r--r--build/plugins/ios_assets.py30
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 00000000000..5f0ccb94672
--- /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)