Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ module(
)

bazel_dep(name = "bazel_features", version = "1.3.0")
bazel_dep(name = "bazel_skylib", version = "1.3.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(
name = "rules_swift",
version = "1.18.0",
version = "2.3.0",
max_compatibility_level = 2,
repo_name = "build_bazel_rules_swift",
)
bazel_dep(
name = "rules_apple",
version = "3.6.0",
version = "3.16.0",
repo_name = "build_bazel_rules_apple",
)
bazel_dep(name = "rules_python", version = "0.27.1")
Expand All @@ -34,7 +34,7 @@ use_repo(

bazel_dep(
name = "apple_support",
version = "1.11.1",
version = "1.17.1",
dev_dependency = True,
repo_name = "build_bazel_apple_support",
)
Expand All @@ -58,23 +58,23 @@ bazel_dep(
# To support Bazel 8 tests
single_version_override(
module_name = "rules_apple",
version = "3.5.1",
version = "3.16.0",
)

single_version_override(
module_name = "rules_swift",
version = "1.18.0",
version = "2.3.0",
)

single_version_override(
module_name = "apple_support",
version = "1.15.1",
version = "1.17.0",
)

# For Stardoc
single_version_override(
module_name = "bazel_skylib",
version = "1.6.0",
version = "1.7.1",
)

apple_cc_configure = use_extension(
Expand Down
2 changes: 1 addition & 1 deletion xcodeproj/internal/compilation_providers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def _merge_compilation_providers(

Args:
apple_dynamic_framework_info: The
`apple_common.AppleDynamicFrameworkInfo` of the target, or `None`.
`AppleDynamicFrameworkInfo` of the target, or `None`.
cc_info: The `CcInfo` of the target, or `None`.
propagate_providers: A `bool` indicating whether providers should be
propagated to downstream targets.
Expand Down
8 changes: 4 additions & 4 deletions xcodeproj/internal/files/incremental_input_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ def _collect_incremental_input_files(
avoid_deps: A `list` of the targets that already consumed resources, and
their resources shouldn't be bundled with the target.
framework_files: A `depset` of framework files from
`AppleDynamicFramework.framework_files`, if the target has the
`AppleDynamicFramework` provider.
`AppleDynamicFrameworkInfo.framework_files`, if the target has the
`AppleDynamicFrameworkInfo` provider.
focused_labels: A `depset` of label strings of focused targets. This
will include the current target (if focused) and any focused
dependencies of the current target. This is only set for top-level
Expand Down Expand Up @@ -955,8 +955,8 @@ def _merge_top_level_input_files(
will include the current target (if focused) and any focused
dependencies of the current target.
framework_files: A `depset` of framework files from
`AppleDynamicFramework.framework_files`, if the target has the
`AppleDynamicFramework` provider.
`AppleDynamicFrameworkInfo.framework_files`, if the target has the
`AppleDynamicFrameworkInfo` provider.
platform: A value from `platforms.collect`.
resource_info: The `AppleResourceInfo` provider for the target if it is
resource bundle consuming.
Expand Down
4 changes: 2 additions & 2 deletions xcodeproj/internal/files/incremental_output_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _get_outputs(*, debug_outputs, product, swift_info, output_group_info):
indexing process.

Args:
debug_outputs: The `AppleDebugOutputs` provider for the target, or
debug_outputs: The `AppleDebugOutputsInfo` provider for the target, or
`None`.
output_group_info: The `OutputGroupInfo` provider for the target, or
`None`.
Expand Down Expand Up @@ -143,7 +143,7 @@ def _collect_incremental_output_files(
copy_product_transitively: Whether or not to copy the product
transitively. Currently this should only be true for top-level
targets.
debug_outputs: The `AppleDebugOutputs` provider for the target, or
debug_outputs: The `AppleDebugOutputsInfo` provider for the target, or
`None`.
id: A unique identifier for the target.
indexstore_overrides: A `list` of `(indexstore, target_name)` `tuple`s
Expand Down
4 changes: 2 additions & 2 deletions xcodeproj/internal/files/legacy_output_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def _get_outputs(*, debug_outputs, id, product, swift_info, output_group_info):
indexing process.

Args:
debug_outputs: The `AppleDebugOutputs` provider for the target, or
debug_outputs: The `AppleDebugOutputsInfo` provider for the target, or
`None`.
id: The unique identifier of the target.
output_group_info: The `OutputGroupInfo` provider for the target, or
Expand Down Expand Up @@ -137,7 +137,7 @@ def _collect_legacy_output_files(
copy_product_transitively: Whether or not to copy the product
transitively. Currently this should only be true for top-level
targets.
debug_outputs: The `AppleDebugOutputs` provider for the target, or
debug_outputs: The `AppleDebugOutputsInfo` provider for the target, or
`None`.
id: A unique identifier for the target.
output_group_info: The `OutputGroupInfo` provider for the target, or
Expand Down
3 changes: 2 additions & 1 deletion xcodeproj/internal/pbxproj_partials.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ _UNIT_TEST_PRODUCT_TYPE = "u" # com.apple.product-type.bundle.unit-test
# Utility

def _apple_platform_to_platform_name(platform):
return PLATFORM_NAME[platform]
apple_platform = "{}".format(platform)
return PLATFORM_NAME[apple_platform]

def _dsym_files_to_string(dsym_files):
dsym_paths = []
Expand Down
99 changes: 51 additions & 48 deletions xcodeproj/internal/platforms.bzl
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
"""Module for dealing with Apple platform information."""

PLATFORM_NAME = {
apple_common.platform.ios_device: "iphoneos",
apple_common.platform.ios_simulator: "iphonesimulator",
apple_common.platform.macos: "macosx",
apple_common.platform.tvos_device: "appletvos",
apple_common.platform.tvos_simulator: "appletvsimulator",
apple_common.platform.visionos_device: "xros",
apple_common.platform.visionos_simulator: "xrsimulator",
apple_common.platform.watchos_device: "watchos",
apple_common.platform.watchos_simulator: "watchsimulator",
apple_common.platform.ios_device.name: "iphoneos",
apple_common.platform.ios_simulator.name: "iphonesimulator",
apple_common.platform.macos.name: "macosx",
apple_common.platform.tvos_device.name: "appletvos",
apple_common.platform.tvos_simulator.name: "appletvsimulator",
apple_common.platform.visionos_device.name: "xros",
apple_common.platform.visionos_simulator.name: "xrsimulator",
apple_common.platform.watchos_device.name: "watchos",
apple_common.platform.watchos_simulator.name: "watchsimulator",
}

_IS_SIMULATOR = {
apple_common.platform.ios_device: False,
apple_common.platform.ios_simulator: True,
apple_common.platform.macos: False,
apple_common.platform.tvos_device: False,
apple_common.platform.tvos_simulator: True,
apple_common.platform.visionos_device: False,
apple_common.platform.visionos_simulator: True,
apple_common.platform.watchos_device: False,
apple_common.platform.watchos_simulator: True,
apple_common.platform.ios_device.name: False,
apple_common.platform.ios_simulator.name: True,
apple_common.platform.macos.name: False,
apple_common.platform.tvos_device.name: False,
apple_common.platform.tvos_simulator.name: True,
apple_common.platform.visionos_device.name: False,
apple_common.platform.visionos_simulator.name: True,
apple_common.platform.watchos_device.name: False,
apple_common.platform.watchos_simulator.name: True,
}

_LLDB_TRIPLE_PREFIX = {
apple_common.platform.ios_device: "ios",
apple_common.platform.ios_simulator: "ios",
apple_common.platform.macos: "macosx",
apple_common.platform.tvos_device: "tvos",
apple_common.platform.tvos_simulator: "tvos",
apple_common.platform.visionos_device: "xros",
apple_common.platform.visionos_simulator: "xros",
apple_common.platform.watchos_device: "watchos",
apple_common.platform.watchos_simulator: "watchos",
apple_common.platform.ios_device.name: "ios",
apple_common.platform.ios_simulator.name: "ios",
apple_common.platform.macos.name: "macosx",
apple_common.platform.tvos_device.name: "tvos",
apple_common.platform.tvos_simulator.name: "tvos",
apple_common.platform.visionos_device.name: "xros",
apple_common.platform.visionos_simulator.name: "xros",
apple_common.platform.watchos_device.name: "watchos",
apple_common.platform.watchos_simulator.name: "watchos",
}

_SWIFT_TRIPLE_PREFIX = {
apple_common.platform.ios_device: "ios",
apple_common.platform.ios_simulator: "ios",
apple_common.platform.macos: "macos",
apple_common.platform.tvos_device: "tvos",
apple_common.platform.tvos_simulator: "tvos",
apple_common.platform.visionos_device: "xros",
apple_common.platform.visionos_simulator: "xros",
apple_common.platform.watchos_device: "watchos",
apple_common.platform.watchos_simulator: "watchos",
apple_common.platform.ios_device.name: "ios",
apple_common.platform.ios_simulator.name: "ios",
apple_common.platform.macos.name: "macos",
apple_common.platform.tvos_device.name: "tvos",
apple_common.platform.tvos_simulator.name: "tvos",
apple_common.platform.visionos_device.name: "xros",
apple_common.platform.visionos_simulator.name: "xros",
apple_common.platform.watchos_device.name: "watchos",
apple_common.platform.watchos_simulator.name: "watchos",
}

_TRIPLE_SUFFIX = {
apple_common.platform.ios_device: "",
apple_common.platform.ios_simulator: "-simulator",
apple_common.platform.macos: "",
apple_common.platform.tvos_device: "",
apple_common.platform.tvos_simulator: "-simulator",
apple_common.platform.visionos_device: "",
apple_common.platform.visionos_simulator: "-simulator",
apple_common.platform.watchos_device: "",
apple_common.platform.watchos_simulator: "-simulator",
apple_common.platform.ios_device.name: "",
apple_common.platform.ios_simulator.name: "-simulator",
apple_common.platform.macos.name: "",
apple_common.platform.tvos_device.name: "",
apple_common.platform.tvos_simulator.name: "-simulator",
apple_common.platform.visionos_device.name: "",
apple_common.platform.visionos_simulator.name: "-simulator",
apple_common.platform.watchos_device.name: "",
apple_common.platform.watchos_simulator.name: "-simulator",
}

def _collect_platform(*, ctx):
Expand Down Expand Up @@ -109,10 +109,11 @@ def _platform_to_dto(platform):
Args:
platform: A value from `platforms.collect`.
"""
apple_platform = "{}".format(platform.apple_platform)
dto = {
"a": platform.arch,
"m": platform.os_version,
"v": PLATFORM_NAME[platform.apple_platform],
"v": PLATFORM_NAME[apple_platform],
}

return dto
Expand All @@ -123,7 +124,7 @@ def _platform_to_swift_triple(platform):
Args:
platform: A value from `platforms.collect`.
"""
apple_platform = platform.apple_platform
apple_platform = "{}".format(platform.apple_platform)
return "{arch}-apple-{triple_prefix}{triple_suffix}".format(
arch = platform.arch,
triple_prefix = _SWIFT_TRIPLE_PREFIX[apple_platform],
Expand All @@ -136,7 +137,9 @@ def _platform_to_lldb_context_triple(platform):
Args:
platform: A value from `platforms.collect`.
"""
apple_platform = platform.apple_platform
apple_platform = "{}".format(platform.apple_platform)

# struct(apple_platform = ios_simulator, arch = "arm64", os_version = "13.0")
return "{arch}-apple-{triple_prefix}{triple_suffix}".format(
arch = platform.arch,
triple_prefix = _LLDB_TRIPLE_PREFIX[apple_platform],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Functions for processing library targets."""

load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
load("@build_bazel_rules_apple//apple:providers.bzl", "AppleDebugOutputsInfo")
load("@build_bazel_rules_swift//swift:swift.bzl", "SwiftInfo", "SwiftProtoInfo")
load("//xcodeproj/internal:build_settings.bzl", "get_product_module_name")
load("//xcodeproj/internal:compilation_providers.bzl", "compilation_providers")
Expand Down Expand Up @@ -154,8 +155,8 @@ def _process_incremental_library_target(
] if not swift_debug_settings_file else None,
)

if apple_common.AppleDebugOutputs in target:
debug_outputs = target[apple_common.AppleDebugOutputs]
if AppleDebugOutputsInfo in target:
debug_outputs = target[AppleDebugOutputsInfo]
else:
debug_outputs = None

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
load(
"@build_bazel_rules_apple//apple:providers.bzl",
"AppleBundleInfo",
"AppleDebugOutputsInfo",
"AppleResourceInfo",
)

# buildifier: disable=bzl-visibility
load("@build_bazel_rules_apple//apple/internal/providers:apple_dynamic_framework_info.bzl", "AppleDynamicFrameworkInfo")
load("@build_bazel_rules_swift//swift:swift.bzl", "SwiftInfo", "SwiftProtoInfo")
load(
"//xcodeproj/internal:build_settings.bzl",
Expand Down Expand Up @@ -272,9 +276,9 @@ def _process_focused_top_level_target(
target = target,
)

if target and apple_common.AppleDynamicFramework in target:
if target and AppleDynamicFrameworkInfo in target:
framework_files = (
target[apple_common.AppleDynamicFramework].framework_files
target[AppleDynamicFrameworkInfo].framework_files
)
product_file = product.file
framework_product_mappings = [
Expand Down Expand Up @@ -491,8 +495,8 @@ def _process_focused_top_level_target(
],
)

if apple_common.AppleDebugOutputs in target:
debug_outputs = target[apple_common.AppleDebugOutputs]
if AppleDebugOutputsInfo in target:
debug_outputs = target[AppleDebugOutputsInfo]
else:
debug_outputs = None

Expand Down Expand Up @@ -927,9 +931,9 @@ def _process_incremental_top_level_target(
),
)

if apple_common.AppleDynamicFramework in target:
if AppleDynamicFrameworkInfo in target:
apple_dynamic_framework_info = (
target[apple_common.AppleDynamicFramework]
target[AppleDynamicFrameworkInfo]
)
else:
apple_dynamic_framework_info = None
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Functions for processing library targets."""

load("@build_bazel_rules_apple//apple:providers.bzl", "AppleDebugOutputsInfo")
load("@build_bazel_rules_swift//swift:swift.bzl", "SwiftInfo")
load("//xcodeproj/internal:build_settings.bzl", "get_product_module_name")
load("//xcodeproj/internal:collections.bzl", "set_if_true")
Expand Down Expand Up @@ -133,7 +134,7 @@ def _process_legacy_library_target(
modulemaps = modulemaps,
transitive_infos = transitive_infos,
)
debug_outputs = target[apple_common.AppleDebugOutputs] if apple_common.AppleDebugOutputs in target else None
debug_outputs = target[AppleDebugOutputsInfo] if AppleDebugOutputsInfo in target else None
output_group_info = target[OutputGroupInfo] if OutputGroupInfo in target else None
(target_outputs, provider_outputs) = output_files.collect(
ctx = ctx,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
""" Functions for processing top level targets """

load("@build_bazel_rules_apple//apple:providers.bzl", "AppleDebugOutputsInfo")

# buildifier: disable=bzl-visibility
load("@build_bazel_rules_apple//apple/internal/providers:apple_dynamic_framework_info.bzl", "AppleDynamicFrameworkInfo")
load("@build_bazel_rules_swift//swift:swift.bzl", "SwiftInfo")
load(
"//xcodeproj/internal:build_settings.bzl",
Expand Down Expand Up @@ -325,9 +329,9 @@ def _process_legacy_top_level_target(
else:
avoid_compilation_providers = None

if apple_common.AppleDynamicFramework in target:
if AppleDynamicFrameworkInfo in target:
apple_dynamic_framework_info = (
target[apple_common.AppleDynamicFramework]
target[AppleDynamicFrameworkInfo]
)
else:
apple_dynamic_framework_info = None
Expand Down Expand Up @@ -412,7 +416,7 @@ def _process_legacy_top_level_target(
transitive_infos = transitive_infos,
avoid_deps = avoid_deps,
)
debug_outputs = target[apple_common.AppleDebugOutputs] if apple_common.AppleDebugOutputs in target else None
debug_outputs = target[AppleDebugOutputsInfo] if AppleDebugOutputsInfo in target else None
output_group_info = target[OutputGroupInfo] if OutputGroupInfo in target else None
(target_outputs, provider_outputs) = output_files.collect(
ctx = ctx,
Expand Down
Loading