Skip to content

Commit b17e9e0

Browse files
authored
singlejar executable from specified java compile toolchain (#1511)
Motivation * toolchain comes with precompiled singlejar from remote_java_tools * it would allow to configure your own if needed
1 parent a42f009 commit b17e9e0

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

scala/private/common_attributes.bzl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,6 @@ common_attrs.update({
8181
})
8282

8383
implicit_deps = {
84-
"_singlejar": attr.label(
85-
executable = True,
86-
cfg = "exec",
87-
default = Label("@bazel_tools//tools/jdk:singlejar"),
88-
allow_files = True,
89-
),
9084
"_java_runtime": attr.label(
9185
default = Label("@bazel_tools//tools/jdk:current_java_runtime"),
9286
),

scala/private/phases/phase_compile.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def _build_nosrc_jar(ctx):
270270
ctx.actions.run(
271271
inputs = ctx.files.resources,
272272
outputs = [ctx.outputs.jar],
273-
executable = ctx.executable._singlejar,
273+
executable = specified_java_compile_toolchain(ctx).single_jar,
274274
progress_message = "scalac %s" % ctx.label,
275275
arguments = [args],
276276
)

scala/private/phases/phase_merge_jars.bzl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
#
44
# DOCUMENT THIS
55
#
6+
load(
7+
"@io_bazel_rules_scala//scala/private:rule_impls.bzl",
8+
"specified_java_compile_toolchain",
9+
)
610

711
def merge_jars_to_output(ctx, output, jars):
812
"""Calls Bazel's singlejar utility.
@@ -26,7 +30,7 @@ def merge_jars_to_output(ctx, output, jars):
2630
ctx.actions.run(
2731
inputs = jars,
2832
outputs = [output],
29-
executable = ctx.executable._singlejar,
33+
executable = specified_java_compile_toolchain(ctx).single_jar,
3034
mnemonic = "ScalaDeployJar",
3135
progress_message = progress_message,
3236
arguments = [args],

0 commit comments

Comments
 (0)