Skip to content

Commit

Permalink
Add android_deps attr for android resources (#21)
Browse files Browse the repository at this point in the history
This adds an `android_deps` attr to the Kotlin rules that allows them to
depend on the resources exposed from `android_library`.
  • Loading branch information
aaronj1335 authored and pcj committed May 26, 2017
1 parent c1944c5 commit 44a0f3f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions kotlin/rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ def _kotlin_compile_impl(ctx):
for file in fileset:
jars += [file]

# Populate from android dependencies
for dep in ctx.attr.android_deps:
if dep.android.defines_resources:
jars.append(dep.android.resource_jar.class_jar)

if jars:
# De-duplicate
jarsetlist = list(set(jars))
Expand Down Expand Up @@ -120,6 +125,11 @@ _kotlin_compile_attrs = {
providers = ["java"],
),

# Dependent java rules.
"android_deps": attr.label_list(
providers = ["android"],
),

# Not really implemented yet.
"data": attr.label_list(
allow_files = True,
Expand Down

0 comments on commit 44a0f3f

Please sign in to comment.