diff options
author | monster <monster@ydb.tech> | 2022-07-07 14:41:37 +0300 |
---|---|---|
committer | monster <monster@ydb.tech> | 2022-07-07 14:41:37 +0300 |
commit | 06e5c21a835c0e923506c4ff27929f34e00761c2 (patch) | |
tree | 75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /build/scripts/gen_tasklet_reg.py | |
parent | 03f024c4412e3aa613bb543cf1660176320ba8f4 (diff) | |
download | ydb-06e5c21a835c0e923506c4ff27929f34e00761c2.tar.gz |
fix ya.make
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 5b747c2eca..0000000000 --- a/build/scripts/gen_tasklet_reg.py +++ /dev/null @@ -1,51 +0,0 @@ -import argparse - -TEMPLATE = '''\ -{includes}\ -#include <tasklet/runtime/lib/{language}_wrapper.h> -#include <tasklet/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) |