diff options
author | v-korovin <v-korovin@yandex-team.com> | 2024-05-28 16:50:54 +0300 |
---|---|---|
committer | v-korovin <v-korovin@yandex-team.com> | 2024-05-28 17:13:15 +0300 |
commit | ff66bd1f6b0b806e61aaec99ec44cf22cfe6150e (patch) | |
tree | bdea6155b31ca4df4963bfe0167533e98e56e23a /build/scripts/compile_java.py | |
parent | 8fa0293cacd68a899e712fc11fb646115857912b (diff) | |
download | ydb-ff66bd1f6b0b806e61aaec99ec44cf22cfe6150e.tar.gz |
revert changes
acd26311852d82fb81a5e57f7b5e5c67f9d89f64
Diffstat (limited to 'build/scripts/compile_java.py')
-rw-r--r-- | build/scripts/compile_java.py | 44 |
1 files changed, 9 insertions, 35 deletions
diff --git a/build/scripts/compile_java.py b/build/scripts/compile_java.py index ba055d9dbf..ef744afdbd 100644 --- a/build/scripts/compile_java.py +++ b/build/scripts/compile_java.py @@ -7,7 +7,6 @@ import subprocess as sp import tarfile import zipfile import sys -import platform import process_command_files as pcf @@ -27,33 +26,6 @@ def parse_args(args): return args, args.srcs -def check_call_command_file(cmd, wrapped_args, **kwargs): - is_win = platform.system() == 'Windows' - - args = cmd - args_to_wrap = wrapped_args - if is_win: - args = [cmd[0]] - args_to_wrap = cmd[1:] + args_to_wrap - - commands_file = 'wrapped.args' - with open(commands_file, 'w') as f: - f.write(' '.join(wrapped_args)) - - if is_win: - # Windows has troubles with running cmd lines with `@` without shell=True - kwargs['shell'] = True - - try: - return sp.check_call( - args + ["@" + commands_file], - **kwargs - ) - except Exception as e: - e.args = tuple(args) + ("Original command: {} {}".format(cmd, wrapped_args), ) - raise - - def mkdir_p(directory): if not os.path.exists(directory): os.makedirs(directory) @@ -105,10 +77,12 @@ def main(): ts.write(' '.join(srcs)) if ktsrcs: + temp_kt_sources_file = 'temp.kt.sources.list' + with open(temp_kt_sources_file, 'w') as ts: + ts.write(' '.join(ktsrcs + srcs)) kt_classes_dir = 'kt_cls' mkdir_p(kt_classes_dir) - - check_call_command_file( + sp.check_call( [ opts.java_bin, '-Didea.max.content.load.filesize=30720', @@ -119,16 +93,16 @@ def main(): '-d', kt_classes_dir, ] - + ktc_opts, - wrapped_args=ktsrcs + srcs, + + ktc_opts + + ['@' + temp_kt_sources_file] ) classpath = os.pathsep.join([kt_classes_dir, classpath]) if srcs: - check_call_command_file( + sp.check_call( [opts.javac_bin, '-nowarn', '-g', '-classpath', classpath, '-encoding', 'UTF-8', '-d', classes_dir] - + javac_opts, - wrapped_args=srcs, + + javac_opts + + ['@' + temp_sources_file] ) for s in jsrcs: |