@@ -108,8 +108,12 @@ def _write_executable_non_windows(ctx, executable, rjars, main_class, jvm_flags,
108108 wrapper .short_path ,
109109 )
110110
111+ scala_toolchain = ctx .toolchains ["//scala:toolchain_type" ]
112+
113+ test_runner_classpath_mode = "argsfile" if scala_toolchain .use_argument_file_in_runner else "manifest"
114+
111115 if use_jacoco and ctx .configuration .coverage_enabled :
112- jacocorunner = ctx . toolchains [ "@io_bazel_rules_scala//scala:toolchain_type" ] .jacocorunner
116+ jacocorunner = scala_toolchain .jacocorunner
113117 classpath = ctx .configuration .host_path_separator .join (
114118 ["${RUNPATH}%s" % (j .short_path ) for j in rjars .to_list () + jacocorunner .files .to_list ()],
115119 )
@@ -137,6 +141,7 @@ def _write_executable_non_windows(ctx, executable, rjars, main_class, jvm_flags,
137141 "%set_jacoco_main_class%" : """export JACOCO_MAIN_CLASS={}""" .format (main_class ),
138142 "%set_jacoco_java_runfiles_root%" : """export JACOCO_JAVA_RUNFILES_ROOT=$JAVA_RUNFILES/{}/""" .format (ctx .workspace_name ),
139143 "%set_java_coverage_new_implementation%" : """export JAVA_COVERAGE_NEW_IMPLEMENTATION=YES""" ,
144+ "%test_runner_classpath_mode%" : test_runner_classpath_mode ,
140145 },
141146 is_executable = True ,
142147 )
@@ -163,6 +168,7 @@ def _write_executable_non_windows(ctx, executable, rjars, main_class, jvm_flags,
163168 "%set_jacoco_java_runfiles_root%" : "" ,
164169 "%workspace_prefix%" : ctx .workspace_name + "/" ,
165170 "%set_java_coverage_new_implementation%" : """export JAVA_COVERAGE_NEW_IMPLEMENTATION=NO""" ,
171+ "%test_runner_classpath_mode%" : test_runner_classpath_mode ,
166172 },
167173 is_executable = True ,
168174 )
0 commit comments