Skip to content

Commit

Permalink
Add support for Android data-binding when building with Kotlin (bazel…
Browse files Browse the repository at this point in the history
…build#346)

* Add support for Android data-binding when building with Kotlin.

* Address reviewer comment by making enable_data_binding an explicit
argument rather than pulling it from kwargs.
  • Loading branch information
BenHenning authored Jul 18, 2020
1 parent 9bea273 commit d897c94
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kotlin/internal/jvm/android.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ load(
_kt_jvm_library = "kt_jvm_library",
)

def _kt_android_artifact(name, srcs = [], deps = [], plugins = [], **kwargs):
def _kt_android_artifact(name, srcs = [], deps = [], plugins = [], enable_data_binding = False, **kwargs):
"""Delegates Android related build attributes to the native rules but uses the Kotlin builder to compile Java and
Kotlin srcs. Returns a sequence of labels that a wrapping macro should export.
"""
Expand All @@ -30,6 +30,8 @@ def _kt_android_artifact(name, srcs = [], deps = [], plugins = [], **kwargs):
name = base_name,
visibility = ["//visibility:private"],
exports = base_deps,
deps = deps if enable_data_binding else [],
enable_data_binding = enable_data_binding,
**kwargs
)
_kt_jvm_library(
Expand Down

0 comments on commit d897c94

Please sign in to comment.