Skip to content

Commit 44a0f3f

Browse files
aaronj1335pcj
authored andcommitted
Add android_deps attr for android resources (#21)
This adds an `android_deps` attr to the Kotlin rules that allows them to depend on the resources exposed from `android_library`.
1 parent c1944c5 commit 44a0f3f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

kotlin/rules.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ def _kotlin_compile_impl(ctx):
5050
for file in fileset:
5151
jars += [file]
5252

53+
# Populate from android dependencies
54+
for dep in ctx.attr.android_deps:
55+
if dep.android.defines_resources:
56+
jars.append(dep.android.resource_jar.class_jar)
57+
5358
if jars:
5459
# De-duplicate
5560
jarsetlist = list(set(jars))
@@ -120,6 +125,11 @@ _kotlin_compile_attrs = {
120125
providers = ["java"],
121126
),
122127

128+
# Dependent java rules.
129+
"android_deps": attr.label_list(
130+
providers = ["android"],
131+
),
132+
123133
# Not really implemented yet.
124134
"data": attr.label_list(
125135
allow_files = True,

0 commit comments

Comments
 (0)