diff options
author | alexv-smirnov <alex@ydb.tech> | 2023-03-28 22:25:04 +0300 |
---|---|---|
committer | alexv-smirnov <alex@ydb.tech> | 2023-03-28 22:25:04 +0300 |
commit | b8a17f9b1c166d2e9a26b99348a4c29d972caf55 (patch) | |
tree | 1a2d881f1a9452b9c6103dbf69d73da7624e98e5 /build/scripts/gen_tasklet_reg.py | |
parent | 25659221f18577ea38430a8ec3349836f5626b6a (diff) | |
download | ydb-b8a17f9b1c166d2e9a26b99348a4c29d972caf55.tar.gz |
Revert ymake build from ydb oss export
Diffstat (limited to 'build/scripts/gen_tasklet_reg.py')
-rw-r--r-- | build/scripts/gen_tasklet_reg.py | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/build/scripts/gen_tasklet_reg.py b/build/scripts/gen_tasklet_reg.py deleted file mode 100644 index 0f7f66ad51..0000000000 --- a/build/scripts/gen_tasklet_reg.py +++ /dev/null @@ -1,51 +0,0 @@ -import argparse - -TEMPLATE = '''\ -{includes}\ -#include <tasklet/v1/runtime/lib/{language}_wrapper.h> -#include <tasklet/v1/runtime/lib/registry.h> - -static const NTasklet::TRegHelper REG( - "{name}", - new NTasklet::{wrapper} -); -''' - -WRAPPER = { - 'cpp': 'TCppWrapper<{impl}>()', - 'js': 'TJsWrapper("{impl}")', - 'go': 'TGoWrapper("{impl}")', - 'py': 'TPythonWrapper("{impl}")', - 'java': 'TJavaWrapper("{impl}", "{py_wrapper}")', -} - - -def parse_args(): - parser = argparse.ArgumentParser() - parser.add_argument('name') - parser.add_argument('output') - parser.add_argument('-l', '--lang', choices=WRAPPER, required=True) - parser.add_argument('-i', '--impl', required=True) - parser.add_argument('-w', '--wrapper', required=False) - parser.add_argument('includes', nargs='*') - - return parser.parse_args() - - -if __name__ == '__main__': - args = parse_args() - - includes = ''.join( - '#include <{}>\n'.format(include) - for include in args.includes - ) - - code = TEMPLATE.format( - includes=includes, - language=args.lang, - name=args.name, - wrapper=WRAPPER[args.lang].format(impl=args.impl, py_wrapper=args.wrapper), - ) - - with open(args.output, 'w') as f: - f.write(code) |