aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/build_java_codenav_index.py
diff options
context:
space:
mode:
authormonster <monster@ydb.tech>2022-07-07 14:41:37 +0300
committermonster <monster@ydb.tech>2022-07-07 14:41:37 +0300
commit06e5c21a835c0e923506c4ff27929f34e00761c2 (patch)
tree75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /build/scripts/build_java_codenav_index.py
parent03f024c4412e3aa613bb543cf1660176320ba8f4 (diff)
downloadydb-06e5c21a835c0e923506c4ff27929f34e00761c2.tar.gz
fix ya.make
Diffstat (limited to 'build/scripts/build_java_codenav_index.py')
-rw-r--r--build/scripts/build_java_codenav_index.py49
1 files changed, 0 insertions, 49 deletions
diff --git a/build/scripts/build_java_codenav_index.py b/build/scripts/build_java_codenav_index.py
deleted file mode 100644
index d7ac4f3213..0000000000
--- a/build/scripts/build_java_codenav_index.py
+++ /dev/null
@@ -1,49 +0,0 @@
-import sys
-import re
-import os
-import subprocess
-
-FAKE_ARCADIA_ROOT = 'fake_arcadia_root'
-FAKE_BUILD_ROOT = 'fake_build_root'
-
-
-def modify_sources_file(origin, target, source_roots_map):
- def _cut_source_root(src):
- for pref, fake_root in source_roots_map.items():
- if src.startswith(pref):
- return os.path.join(fake_root, os.path.relpath(src, pref))
- return src
-
- with open(origin) as o:
- srcs = [i for line in o for i in re.split('\\s+', line) if i]
- new_srcs = map(_cut_source_root, srcs)
- with open(target, 'w') as t:
- t.write(' '.join(new_srcs))
-
-
-def just_do_it(argv):
- corpus_name, build_root, arcadia_root, sources_file, javac_tail_cmd = argv[0], argv[1], argv[2], argv[3], argv[4:]
- fake_arcadia_root = os.path.join(build_root, FAKE_ARCADIA_ROOT)
- fake_build_root = os.path.join(build_root, FAKE_BUILD_ROOT)
- fake_source_roots = {
- arcadia_root: fake_arcadia_root,
- build_root: fake_build_root,
- }
- modify_sources_file(sources_file, os.path.join(os.path.dirname(sources_file), '_' + os.path.basename(sources_file)), fake_source_roots)
- kindex_data_root = '{}/kindex'.format(os.path.join(build_root, os.path.dirname(corpus_name)))
- if not os.path.exists(kindex_data_root):
- os.makedirs(kindex_data_root)
- env = os.environ.copy()
- env['KYTHE_ROOT_DIRECTORY'] = build_root
- env['KYTHE_OUTPUT_DIRECTORY'] = kindex_data_root
- env['KYTHE_CORPUS'] = os.path.relpath(corpus_name, build_root)
- os.symlink(arcadia_root, fake_arcadia_root)
- os.symlink(build_root, fake_build_root)
- try:
- subprocess.check_call(javac_tail_cmd, env=env)
- finally:
- os.unlink(fake_arcadia_root)
- os.unlink(fake_build_root)
-
-if __name__ == '__main__':
- just_do_it(sys.argv[1:])