diff options
author | alexv-smirnov <alex@ydb.tech> | 2023-06-13 11:05:01 +0300 |
---|---|---|
committer | alexv-smirnov <alex@ydb.tech> | 2023-06-13 11:05:01 +0300 |
commit | bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0 (patch) | |
tree | 1d1df72c0541a59a81439842f46d95396d3e7189 /build/plugins/sandbox_registry.py | |
parent | 8bfdfa9a9bd19bddbc58d888e180fbd1218681be (diff) | |
download | ydb-bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0.tar.gz |
add ymake export to ydb
Diffstat (limited to 'build/plugins/sandbox_registry.py')
-rw-r--r-- | build/plugins/sandbox_registry.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/build/plugins/sandbox_registry.py b/build/plugins/sandbox_registry.py new file mode 100644 index 0000000000..dc1be399b3 --- /dev/null +++ b/build/plugins/sandbox_registry.py @@ -0,0 +1,21 @@ +import os + +import ymake + + +def onregister_sandbox_import(unit, *args): + args = iter(args) + for path in args: + path = os.path.normpath(path) + source = unit.resolve_arc_path(path) + abs_source = unit.resolve(source) + if not os.path.exists(abs_source): + ymake.report_configure_error('REGISTER_SANDBOX_IMPORT: File or directory {} does not exists'.format(path)) + splited_path = path.split(os.sep) + l, r = 0, len(splited_path) + if splited_path[-1] == "__init__.py": + r -= 1 + if not splited_path[0]: + l += 1 + path = ".".join(splited_path[l:r]) + unit.onresource(["-", "{}.{}={}".format("SANDBOX_TASK_REGISTRY", path, path)]) |