diff options
author | alexv-smirnov <[email protected]> | 2023-06-13 11:05:01 +0300 |
---|---|---|
committer | alexv-smirnov <[email protected]> | 2023-06-13 11:05:01 +0300 |
commit | bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0 (patch) | |
tree | 1d1df72c0541a59a81439842f46d95396d3e7189 /build/plugins/uservices.py | |
parent | 8bfdfa9a9bd19bddbc58d888e180fbd1218681be (diff) |
add ymake export to ydb
Diffstat (limited to 'build/plugins/uservices.py')
-rw-r--r-- | build/plugins/uservices.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/build/plugins/uservices.py b/build/plugins/uservices.py new file mode 100644 index 00000000000..69dffd325e2 --- /dev/null +++ b/build/plugins/uservices.py @@ -0,0 +1,37 @@ +import json +import ymake + + +def on_process_usrv_files(unit, *args): + mode = None + if args[0] == 'NO_DEPS': + for f in args[1:]: + if f == 'OUT_NOAUTO': + mode = f + continue + if mode is not None: + unit.on_move([f + '.usrv', mode, f]) + elif f.endswith('.cpp'): + unit.on_move([f + '.usrv', 'OUT', f]) + else: + unit.on_move([f + '.usrv', 'OUT_NOAUTO', f]) + return + + deps_file = unit.resolve(unit.resolve_arc_path(args[0])) + try: + all_deps = json.load(open(deps_file, 'r')) + except Exception as e: + ymake.report_configure_error('Malformed dependencies JSON `{}`: {}'.format(args[0], e.__repr__())) + return + mode = 'OUT' + for f in args[1:]: + if f == 'OUT_NOAUTO': + mode = f + continue + try: + deps = all_deps[f] + except KeyError: + ymake.report_configure_error('Dependencies for {} not found in {}'.format(f, args[0])) + unit.on_usrv_mv_with_deps([f]) + return + unit.on_move([f + '.usrv', mode, f, 'CPP_DEPS'] + deps) |