Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to configure buildijar value when building a scala library #1582

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion scala/private/phases/phase_compile.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def phase_compile_binary(ctx, p):
def phase_compile_library(ctx, p):
args = struct(
srcjars = p.collect_srcjars,
buildijar = ctx.attr.build_ijar if hasattr(ctx.attr, "build_ijar") else _ijar_default_value(ctx),
unused_dependency_checker_ignored_targets = [
target.label
for target in p.scalac_provider.default_classpath + ctx.attr.exports +
Expand Down Expand Up @@ -102,7 +103,7 @@ def phase_compile_common(ctx, p):
return _phase_compile_default(ctx, p)

def _phase_compile_default(ctx, p, _args = struct()):
buildijar_default_value = True if ctx.toolchains["@io_bazel_rules_scala//scala:toolchain_type"].scala_version.startswith("2.") else False
buildijar_default_value = _ijar_default_value(ctx)

return _phase_compile(
ctx,
Expand Down Expand Up @@ -389,3 +390,6 @@ def _interim_java_provider_for_java_compilation(scala_output):
compile_jar = scala_output,
neverlink = True,
)

def _ijar_default_value(ctx):
return True if ctx.toolchains["@io_bazel_rules_scala//scala:toolchain_type"].scala_version.startswith("2.") else False