1
- load (
2
- "@rules_android//android:rules.bzl" ,
3
- _android_library = "android_library" ,
4
- _android_local_test = "android_local_test" ,
5
- )
6
-
7
1
# Copyright 2018 The Bazel Authors. All rights reserved.
8
2
#
9
3
# Licensed under the Apache License, Version 2.0 (the "License");
17
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
12
# See the License for the specific language governing permissions and
19
13
# 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
+ )
20
19
load (
21
20
"//kotlin/internal/jvm:jvm.bzl" ,
22
21
_kt_jvm_library = "kt_jvm_library" ,
@@ -36,7 +35,6 @@ def _kt_android_artifact(
36
35
enable_data_binding = False ,
37
36
tags = [],
38
37
exec_properties = None ,
39
- resource_files = None ,
40
38
** kwargs ):
41
39
"""Delegates Android related build attributes to the native rules but uses the Kotlin builder to compile Java and
42
40
Kotlin srcs. Returns a sequence of labels that a wrapping macro should export.
@@ -47,48 +45,16 @@ def _kt_android_artifact(
47
45
# TODO(bazelbuild/rules_kotlin/issues/273): This should be retrieved from a provider.
48
46
base_deps = [_ANDROID_SDK_JAR ] + deps
49
47
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
+ )
92
58
_kt_jvm_library (
93
59
name = kt_name ,
94
60
srcs = srcs ,
0 commit comments