aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorv-korovin <v-korovin@yandex-team.com>2024-03-14 11:45:56 +0300
committerv-korovin <v-korovin@yandex-team.com>2024-03-14 12:04:39 +0300
commitd841f648c9c0bdcbf53e98dd449c620e5b7e4b99 (patch)
tree96f9d30af3f7a6a9e8e0bad9a6bb15c1b3d4ac57
parent1dfe5a928b38993a8594691da87b7d9d79fff6cb (diff)
downloadydb-d841f648c9c0bdcbf53e98dd449c620e5b7e4b99.tar.gz
Add command file to compile_java
30830fa535b50fdecf6e211f6b7e27d9f5b41c96
-rw-r--r--build/conf/java.conf2
-rw-r--r--build/scripts/compile_java.py6
-rw-r--r--build/scripts/process_command_files.py9
3 files changed, 14 insertions, 3 deletions
diff --git a/build/conf/java.conf b/build/conf/java.conf
index 96d4bf5657..4f4876f6f9 100644
--- a/build/conf/java.conf
+++ b/build/conf/java.conf
@@ -1408,7 +1408,7 @@ elsewhen ($JDK_VERSION == "") {
otherwise {
EXTERNAL_JAVA_JDK_RESOURCE=$JDK_RESOURCE
}
-COMPILE_JAVA=${cwd:ARCADIA_BUILD_ROOT} $YMAKE_PYTHON ${input:"build/scripts/compile_java.py"} --java-bin $EXTERNAL_JAVA_JDK_RESOURCE/bin/java --javac-bin $EXTERNAL_JAVA_JDK_RESOURCE/bin/javac --jar-bin $JDK_RESOURCE/bin/jar --kotlin-compiler $KOTLIN_COMPILER_RESOURCE_GLOBAL/kotlin-compiler.jar $JAVA_VCS_MF_ARG $PACKAGE_PREFIX_ARGS --jar-output $TARGET --srcs-jar-output ${output;suf=-sources.jar:REALPRJNAME} $AUTO_INPUT DELIM $JAVAC_OPTS DELIM $MANAGED_PEERS_CLOSURE DELIM -no-stdlib -module-name $REALPRJNAME -jvm-target ${KOTLIN_JVM_TARGET} ${KOTLINC_OPTS_VALUE} ${kv;hide:"p JV"} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} ${requirements;hide:"cpu:2"}
+COMPILE_JAVA=${cwd:ARCADIA_BUILD_ROOT} $YMAKE_PYTHON ${input:"build/scripts/compile_java.py"} --ya-start-command-file --java-bin $EXTERNAL_JAVA_JDK_RESOURCE/bin/java --javac-bin $EXTERNAL_JAVA_JDK_RESOURCE/bin/javac --jar-bin $JDK_RESOURCE/bin/jar --kotlin-compiler $KOTLIN_COMPILER_RESOURCE_GLOBAL/kotlin-compiler.jar $JAVA_VCS_MF_ARG $PACKAGE_PREFIX_ARGS --jar-output $TARGET --srcs-jar-output ${output;suf=-sources.jar:REALPRJNAME} $AUTO_INPUT DELIM $JAVAC_OPTS DELIM $MANAGED_PEERS_CLOSURE DELIM -no-stdlib -module-name $REALPRJNAME -jvm-target ${KOTLIN_JVM_TARGET} ${KOTLINC_OPTS_VALUE} --ya-end-command-file ${kv;hide:"p JV"} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} ${requirements;hide:"cpu:2"}
ARGS_DELIM="MACRO_CALLS_DELIM"
diff --git a/build/scripts/compile_java.py b/build/scripts/compile_java.py
index d0176a9a56..ef744afdbd 100644
--- a/build/scripts/compile_java.py
+++ b/build/scripts/compile_java.py
@@ -8,6 +8,8 @@ import tarfile
import zipfile
import sys
+import process_command_files as pcf
+
def parse_args(args):
parser = argparse.ArgumentParser(description='Wrapper to invoke Java compilation from ya make build')
@@ -40,7 +42,9 @@ def split_cmd_by_delim(cmd, delim='DELIM'):
def main():
- cmd_parts = split_cmd_by_delim(sys.argv[1:])
+ loaded_args = pcf.get_args(sys.argv[1:])
+
+ cmd_parts = split_cmd_by_delim(loaded_args)
assert len(cmd_parts) == 4
args, javac_opts, peers, ktc_opts = cmd_parts
opts, jsrcs = parse_args(args)
diff --git a/build/scripts/process_command_files.py b/build/scripts/process_command_files.py
index 4ca9caa649..e1a8d00989 100644
--- a/build/scripts/process_command_files.py
+++ b/build/scripts/process_command_files.py
@@ -1,17 +1,21 @@
def is_cmdfile_arg(arg):
+ # type: (str) -> bool
return arg.startswith('@')
def cmdfile_path(arg):
+ # type: (str) -> str
return arg[1:]
def read_from_command_file(arg):
+ # type: (str) -> list[str]
with open(arg) as afile:
return afile.read().splitlines()
def skip_markers(args):
+ # type: (list[str]) -> list[str]
res = []
for arg in args:
if arg == '--ya-start-command-file' or arg == '--ya-end-command-file':
@@ -20,7 +24,9 @@ def skip_markers(args):
return res
-def iter_args(args):
+def iter_args(
+ args, # type: list[str]
+ ):
for arg in args:
if not is_cmdfile_arg(arg):
if arg == '--ya-start-command-file' or arg == '--ya-end-command-file':
@@ -32,4 +38,5 @@ def iter_args(args):
def get_args(args):
+ # type: (list[str]) -> list[str]
return list(iter_args(args))