forked from bazelbuild/rules_android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Open-source mobile_install/{debug.bzl,BUILD}
Part of bazelbuild#12 PiperOrigin-RevId: 552473320 Change-Id: I0524066dcd5bb65765a5279f0a4af8dc4d43560c
- Loading branch information
1 parent
48e1365
commit ceadfc7
Showing
6 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Description: | ||
# Blaze mobile-install aspect package. | ||
|
||
load("@bazel_skylib//:bzl_library.bzl", "bzl_library") | ||
|
||
package( | ||
default_applicable_licenses = ["//:license"], | ||
default_visibility = ["//:__subpackages__"], | ||
) | ||
|
||
licenses(["notice"]) | ||
|
||
exports_files(["mi.bzl"]) | ||
|
||
filegroup( | ||
name = "all_files", | ||
srcs = glob(["**"]), | ||
) | ||
|
||
bzl_library( | ||
name = "bzl", | ||
srcs = glob(["**/*.bzl"]), | ||
deps = [ | ||
"//rules:bzl", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Copyright 2019 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""Module that enables debugging for mobile-install.""" | ||
|
||
def _make_output_groups(infos): | ||
output_groups = dict() | ||
for info in infos: | ||
if hasattr(info, "info"): | ||
output_group = dict( | ||
mi_java_info = info.info.runtime_output_jars, | ||
) | ||
elif hasattr(info, "transitive_java_resources"): | ||
output_group = dict( | ||
mi_java_resources_info = info.transitive_java_resources, | ||
) | ||
elif hasattr(info, "transitive_native_libs"): | ||
output_group = dict( | ||
mi_aar_native_libs_info = info.transitive_native_libs, | ||
) | ||
elif hasattr(info, "transitive_dex_shards"): | ||
output_group = dict( | ||
mi_android_dex_info = depset( | ||
transitive = info.transitive_dex_shards, | ||
), | ||
) | ||
else: | ||
fail("Unsupported provider %s" % info) | ||
output_groups.update(output_group) | ||
return output_groups | ||
|
||
debug = struct( | ||
make_output_groups = _make_output_groups, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters