Skip to content

Commit 4dea295

Browse files
Bencodesoliviernotteghem
authored andcommitted
Revert android.bzl changes introduced by bazelbuild#842 (bazelbuild#1122)
* Revert android.bzl changes introduced by bazelbuild#842 * Formatting
1 parent 1c80ca8 commit 4dea295

File tree

1 file changed

+15
-49
lines changed

1 file changed

+15
-49
lines changed

kotlin/internal/jvm/android.bzl

Lines changed: 15 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
load(
2-
"@rules_android//android:rules.bzl",
3-
_android_library = "android_library",
4-
_android_local_test = "android_local_test",
5-
)
6-
71
# Copyright 2018 The Bazel Authors. All rights reserved.
82
#
93
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,6 +11,11 @@ load(
1711
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1812
# See the License for the specific language governing permissions and
1913
# limitations under the License.
14+
load(
15+
"@rules_android//android:rules.bzl",
16+
_android_library = "android_library",
17+
_android_local_test = "android_local_test",
18+
)
2019
load(
2120
"//kotlin/internal/jvm:jvm.bzl",
2221
_kt_jvm_library = "kt_jvm_library",
@@ -36,7 +35,6 @@ def _kt_android_artifact(
3635
enable_data_binding = False,
3736
tags = [],
3837
exec_properties = None,
39-
resource_files = None,
4038
**kwargs):
4139
"""Delegates Android related build attributes to the native rules but uses the Kotlin builder to compile Java and
4240
Kotlin srcs. Returns a sequence of labels that a wrapping macro should export.
@@ -47,48 +45,16 @@ def _kt_android_artifact(
4745
# TODO(bazelbuild/rules_kotlin/issues/273): This should be retrieved from a provider.
4846
base_deps = [_ANDROID_SDK_JAR] + deps
4947

50-
exported_target_labels = [kt_name]
51-
manifest = kwargs.get("manifest", default = None)
52-
if "kt_prune_transitive_deps_incompatible" in tags:
53-
# TODO(https://github.com/bazelbuild/rules_kotlin/issues/556): replace with starlark
54-
# buildifier: disable=native-android
55-
_android_library(
56-
name = base_name,
57-
resource_files = resource_files,
58-
exports = base_deps,
59-
deps = deps if enable_data_binding else [],
60-
enable_data_binding = enable_data_binding,
61-
tags = tags,
62-
visibility = ["//visibility:private"],
63-
**kwargs
64-
)
65-
exported_target_labels.append(base_name)
66-
elif resource_files or manifest:
67-
# TODO(https://github.com/bazelbuild/rules_kotlin/issues/556): replace with starlark
68-
# buildifier: disable=native-android
69-
# Do not export deps to avoid all upstream targets to be invalidated when ABI changes.
70-
_android_library(
71-
name = base_name,
72-
resource_files = resource_files,
73-
deps = deps,
74-
custom_package = kwargs.get("custom_package", default = None),
75-
manifest = manifest,
76-
enable_data_binding = enable_data_binding,
77-
tags = tags,
78-
visibility = ["//visibility:private"],
79-
)
80-
exported_target_labels.append(base_name)
81-
else:
82-
# No need to export this target, as it's used exclusively internally
83-
_android_library(
84-
name = base_name,
85-
exports = deps,
86-
enable_data_binding = enable_data_binding,
87-
tags = tags,
88-
visibility = ["//visibility:private"],
89-
**kwargs
90-
)
91-
48+
_android_library(
49+
name = base_name,
50+
visibility = ["//visibility:private"],
51+
exports = base_deps,
52+
deps = deps if enable_data_binding else [],
53+
enable_data_binding = enable_data_binding,
54+
tags = tags,
55+
exec_properties = exec_properties,
56+
**kwargs
57+
)
9258
_kt_jvm_library(
9359
name = kt_name,
9460
srcs = srcs,

0 commit comments

Comments
 (0)