summaryrefslogtreecommitdiffstats
path: root/build/scripts/with_kapt_args.py
diff options
context:
space:
mode:
authoralexv-smirnov <[email protected]>2023-03-28 22:25:04 +0300
committeralexv-smirnov <[email protected]>2023-03-28 22:25:04 +0300
commitb8a17f9b1c166d2e9a26b99348a4c29d972caf55 (patch)
tree1a2d881f1a9452b9c6103dbf69d73da7624e98e5 /build/scripts/with_kapt_args.py
parent25659221f18577ea38430a8ec3349836f5626b6a (diff)
Revert ymake build from ydb oss export
Diffstat (limited to 'build/scripts/with_kapt_args.py')
-rw-r--r--build/scripts/with_kapt_args.py35
1 files changed, 0 insertions, 35 deletions
diff --git a/build/scripts/with_kapt_args.py b/build/scripts/with_kapt_args.py
deleted file mode 100644
index eb7438a4c9f..00000000000
--- a/build/scripts/with_kapt_args.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import sys
-import os
-import subprocess
-import platform
-import argparse
-import re
-
-
-def parse_args(args):
- parser = argparse.ArgumentParser()
- parser.add_argument('--ap-classpath', nargs='*', type=str, dest='classpath')
- cmd_start = args.index('--')
- return parser.parse_args(args[:cmd_start]), args[cmd_start+1:]
-
-
-def get_ap_classpath(directory):
- jar_re = re.compile(r'.*(?<!-sources)\.jar')
- found_jars = [os.path.join(address, name) for address, dirs, files in os.walk(directory) for name in files if jar_re.match(name)]
- if len(found_jars) != 1:
- raise Exception("found %d JAR files in directory %s" % (len(found_jars), directory))
- arg = 'plugin:org.jetbrains.kotlin.kapt3:apclasspath=' + found_jars[0]
- return '-P', arg
-
-
-def create_extra_args(args):
- cp_opts = [arg for d in args.classpath for arg in get_ap_classpath(d)]
- return cp_opts
-
-if __name__ == '__main__':
- args, cmd = parse_args(sys.argv[1:])
- res = cmd + create_extra_args(args)
- if platform.system() == 'Windows':
- sys.exit(subprocess.Popen(res).wait())
- else:
- os.execv(res[0], res)