Skip to content

Commit

Permalink
Only propagate srcjar if it isn't the default empty jar added in ae70089
Browse files Browse the repository at this point in the history
  • Loading branch information
cgruber authored and cromwellian committed Mar 7, 2020
1 parent e234dd8 commit d961569
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions kotlin/internal/jvm/impl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ def _unify_jars(ctx):
else:
# Legacy handling.
jars = []
source_jars = [ctx.file.srcjar] if ctx.file.srcjar else []
if (ctx.file.srcjar and not "%s" % ctx.file.srcjar.path == "third_party/empty.jar"):
source_jars = [ctx.file.srcjar]
else:
source_jars = []

# TODO after a while remove the for block, the checks after it,and simplify the source-jar to jar allignment.
# There must be a single jar jar and it can either be a filegroup or a JavaInfo.
Expand All @@ -98,9 +101,7 @@ def _unify_jars(ctx):
fail("got more than one jar, this is an error create an issue: %s" % jars)
if len(source_jars) > 1:
fail("got more than one source jar. " +
"Did you include both srcjar and a sources jar in the jars attribute?: " +
jars)
print(source_jars)
"Did you include both srcjar and a sources jar in the jars attribute?: %s" % source_jars)
return struct(class_jar = jars[0], source_jar = source_jars[0] if len(source_jars) == 1 else None, ijar = None)

def kt_jvm_import_impl(ctx):
Expand Down

0 comments on commit d961569

Please sign in to comment.