aboutsummaryrefslogtreecommitdiffstats
path: root/build/plugins/ios_assets.py
diff options
context:
space:
mode:
authoralexv-smirnov <alex@ydb.tech>2023-06-13 11:05:01 +0300
committeralexv-smirnov <alex@ydb.tech>2023-06-13 11:05:01 +0300
commitbf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0 (patch)
tree1d1df72c0541a59a81439842f46d95396d3e7189 /build/plugins/ios_assets.py
parent8bfdfa9a9bd19bddbc58d888e180fbd1218681be (diff)
downloadydb-bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0.tar.gz
add ymake export to ydb
Diffstat (limited to 'build/plugins/ios_assets.py')
-rw-r--r--build/plugins/ios_assets.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/build/plugins/ios_assets.py b/build/plugins/ios_assets.py
new file mode 100644
index 0000000000..16f58bda44
--- /dev/null
+++ b/build/plugins/ios_assets.py
@@ -0,0 +1,27 @@
+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)