Skip to content

Commit

Permalink
Simplify phase_compile return struct (bazelbuild#974)
Browse files Browse the repository at this point in the history
  • Loading branch information
borkaehw authored and Andre Rocha committed Jul 6, 2020
1 parent 0b3cea9 commit 17a7243
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions scala/private/phases/phase_compile.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,9 @@ def _phase_compile(

# TODO: simplify the return values and use provider
return struct(
class_jar = out.class_jar,
coverage = out.coverage.external,
full_jars = out.full_jars,
files = depset(out.full_jars),
ijar = out.ijar,
ijars = out.ijars,
rjars = depset(out.full_jars, transitive = [rjars]),
java_jar = out.java_jar,
source_jars = _pack_source_jars(ctx) + out.source_jars,
merged_provider = out.merged_provider,
external_providers = dicts.add(out.coverage.providers_dict, {
"JavaInfo": out.merged_provider,
Expand Down Expand Up @@ -198,13 +192,8 @@ def _compile_or_empty(

# no need to build ijar when empty
return struct(
class_jar = ctx.outputs.jar,
coverage = _empty_coverage_struct,
full_jars = [ctx.outputs.jar],
ijar = ctx.outputs.jar,
ijars = [ctx.outputs.jar],
java_jar = False,
source_jars = [],
merged_provider = scala_compilation_provider,
)
else:
Expand Down Expand Up @@ -284,12 +273,8 @@ def _compile_or_empty(
)

full_jars = [ctx.outputs.jar]
ijars = [ijar]
source_jars = []
if java_jar:
full_jars += [java_jar.jar]
ijars += [java_jar.ijar]
source_jars += java_jar.source_jars

coverage = _jacoco_offline_instrument(ctx, ctx.outputs.jar)

Expand All @@ -299,13 +284,8 @@ def _compile_or_empty(
merged_provider = scala_compilation_provider

return struct(
class_jar = ctx.outputs.jar,
coverage = coverage,
full_jars = full_jars,
ijar = ijar,
ijars = ijars,
java_jar = java_jar,
source_jars = source_jars,
merged_provider = merged_provider,
)

Expand Down

0 comments on commit 17a7243

Please sign in to comment.