Skip to content

Commit

Permalink
Open-source mobile_install/{debug.bzl,BUILD}
Browse files Browse the repository at this point in the history
Part of bazelbuild#12

PiperOrigin-RevId: 552473320
Change-Id: I0524066dcd5bb65765a5279f0a4af8dc4d43560c
  • Loading branch information
ted-xie authored and copybara-github committed Jul 31, 2023
1 parent 48e1365 commit ceadfc7
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 0 deletions.
26 changes: 26 additions & 0 deletions mobile_install/BUILD
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",
],
)
44 changes: 44 additions & 0 deletions mobile_install/debug.bzl
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,
)
23 changes: 23 additions & 0 deletions rules/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,26 @@ bzl_library(
"//rules/android_binary_internal:bzl",
],
)

bzl_library(
name = "bzl",
srcs = [
"android_ndk_repository.bzl",
"android_sdk.bzl",
"android_sdk_repository.bzl",
"android_tools_defaults_jar.bzl",
"baseline_profiles.bzl",
"dex.bzl",
"dex_desugar_aspect.bzl",
"rules.bzl",
],
visibility = ["//mobile_install:__pkg__"],
deps = [
":android_binary_bzl",
":common_bzl",
"//rules/aar_import:bzl",
"//rules/android_library:bzl",
"//rules/android_sandboxed_sdk:bzl",
"//rules/flags:bzl",
],
)
1 change: 1 addition & 0 deletions rules/aar_import/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ filegroup(
bzl_library(
name = "bzl",
srcs = glob(["*.bzl"]),
visibility = ["//rules:__pkg__"],
deps = [
"//rules:common_bzl",
"//rules/flags:bzl",
Expand Down
1 change: 1 addition & 0 deletions rules/android_library/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ filegroup(
bzl_library(
name = "bzl",
srcs = glob(["*.bzl"]),
visibility = ["//rules:__pkg__"],
deps = [
"//rules:common_bzl",
"//rules/flags:bzl",
Expand Down
1 change: 1 addition & 0 deletions rules/android_sandboxed_sdk/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ filegroup(
bzl_library(
name = "bzl",
srcs = glob(["*.bzl"]),
visibility = ["//rules:__pkg__"],
deps = [
"//rules:android_binary_bzl",
"//rules:common_bzl",
Expand Down

0 comments on commit ceadfc7

Please sign in to comment.