Skip to content

Commit

Permalink
Make AppleDebugInfo and AppleSymbolsFileInfo available from outside o…
Browse files Browse the repository at this point in the history
…f rules_apple (bazelbuild#2558)
  • Loading branch information
vakhidbetrakhmadov committed Oct 18, 2024
1 parent 2e45cef commit c301f6b
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 11 deletions.
1 change: 1 addition & 0 deletions apple/internal/partials/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ bzl_library(
deps = [
"//apple/internal:intermediates",
"//apple/internal:processor",
"//apple/internal/providers:apple_symbols_file_info",
"@bazel_skylib//lib:partial",
"@bazel_skylib//lib:shell",
"@build_bazel_apple_support//lib:apple_support",
Expand Down
15 changes: 6 additions & 9 deletions apple/internal/partials/apple_symbols_file.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,9 @@ load(
"@build_bazel_rules_apple//apple/internal:processor.bzl",
"processor",
)

_AppleSymbolsFileInfo = provider(
doc = "Private provider to propagate the transitive .symbols `File`s.",
fields = {
"symbols_output_dirs": "Depset of `File`s containing directories of $UUID.symbols files for transitive dependencies.",
},
load(
"@build_bazel_rules_apple//apple/internal/providers:apple_symbols_file_info.bzl",
"AppleSymbolsFileInfo",
)

def _apple_symbols_file_partial_impl(
Expand Down Expand Up @@ -89,9 +86,9 @@ def _apple_symbols_file_partial_impl(
transitive_output_files = depset(
direct = outputs,
transitive = [
x[_AppleSymbolsFileInfo].symbols_output_dirs
x[AppleSymbolsFileInfo].symbols_output_dirs
for x in dependency_targets
if _AppleSymbolsFileInfo in x
if AppleSymbolsFileInfo in x
],
)

Expand All @@ -102,7 +99,7 @@ def _apple_symbols_file_partial_impl(

return struct(
bundle_files = bundle_files,
providers = [_AppleSymbolsFileInfo(symbols_output_dirs = transitive_output_files)],
providers = [AppleSymbolsFileInfo(symbols_output_dirs = transitive_output_files)],
)

def apple_symbols_file_partial(
Expand Down
10 changes: 10 additions & 0 deletions apple/internal/providers/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library")

licenses(["notice"])

bzl_library(
name = "apple_symbols_file_info",
srcs = ["apple_symbols_file_info.bzl"],
visibility = [
# Visibility set to pkg since this provider is used only
# by the `apple_symbols_file` partial.
"//apple/internal/partials:__pkg__",
],
)

bzl_library(
name = "app_intents_info",
srcs = ["app_intents_info.bzl"],
Expand Down
2 changes: 0 additions & 2 deletions apple/internal/providers/apple_debug_info.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

"""AppleDebugInfo provider implementation for resource aspect and debug symbols partial support."""

visibility("//apple/internal/...")

AppleDebugInfo = provider(
doc = """
Private provider to propagate transitive dSYM and link maps information used by the debug symbols
Expand Down
22 changes: 22 additions & 0 deletions apple/internal/providers/apple_symbols_file_info.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2023 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.

"""AppleSymbolsFileInfo provider implementation for transitive .symbols `File`s propagation."""

AppleSymbolsFileInfo = provider(
doc = "Private provider to propagate the transitive .symbols `File`s.",
fields = {
"symbols_output_dirs": "Depset of `File`s containing directories of $UUID.symbols files for transitive dependencies.",
},
)

0 comments on commit c301f6b

Please sign in to comment.