From 2fbdcad3546672e015d3ed2187ded2123119718f Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Mon, 6 Jul 2020 15:31:20 -0700 Subject: [PATCH 1/2] Add support for Android data-binding when building with Kotlin. --- kotlin/internal/jvm/android.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/kotlin/internal/jvm/android.bzl b/kotlin/internal/jvm/android.bzl index f0f7820e6..d7850c82a 100644 --- a/kotlin/internal/jvm/android.bzl +++ b/kotlin/internal/jvm/android.bzl @@ -30,6 +30,7 @@ def _kt_android_artifact(name, srcs = [], deps = [], plugins = [], **kwargs): name = base_name, visibility = ["//visibility:private"], exports = base_deps, + deps = deps if kwargs.get('enable_data_binding', default = False) else [], **kwargs ) _kt_jvm_library( From 75301d70c0fa77358be7ceda8a71d38344f19f52 Mon Sep 17 00:00:00 2001 From: Ben Henning Date: Fri, 17 Jul 2020 14:13:05 -0700 Subject: [PATCH 2/2] Address reviewer comment by making enable_data_binding an explicit argument rather than pulling it from kwargs. --- kotlin/internal/jvm/android.bzl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kotlin/internal/jvm/android.bzl b/kotlin/internal/jvm/android.bzl index d7850c82a..b8d30930f 100644 --- a/kotlin/internal/jvm/android.bzl +++ b/kotlin/internal/jvm/android.bzl @@ -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. """ @@ -30,7 +30,8 @@ def _kt_android_artifact(name, srcs = [], deps = [], plugins = [], **kwargs): name = base_name, visibility = ["//visibility:private"], exports = base_deps, - deps = deps if kwargs.get('enable_data_binding', default = False) else [], + deps = deps if enable_data_binding else [], + enable_data_binding = enable_data_binding, **kwargs ) _kt_jvm_library(