-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fork the Xcode rules from Bazel built-in Starlark into
apple_support
.
PiperOrigin-RevId: 631018102
- Loading branch information
1 parent
d5a60a6
commit f1bbadc
Showing
9 changed files
with
690 additions
and
26 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
load("@bazel_skylib//:bzl_library.bzl", "bzl_library") | ||
|
||
licenses(["notice"]) | ||
|
||
package( | ||
default_visibility = ["//xcode:__subpackages__"], | ||
) | ||
|
||
bzl_library( | ||
name = "providers", | ||
srcs = ["providers.bzl"], | ||
) | ||
|
||
# Consumed by bazel tests. | ||
filegroup( | ||
name = "for_bazel_tests", | ||
testonly = True, | ||
srcs = glob(["**"]), | ||
visibility = ["//xcode:__pkg__"], | ||
) |
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,110 @@ | ||
# Copyright 2024 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. | ||
|
||
"""Providers used internally by the Xcode rules not meant for client use.""" | ||
|
||
visibility([ | ||
"@build_bazel_apple_support//test/...", | ||
"@build_bazel_apple_support//xcode/...", | ||
]) | ||
|
||
AvailableXcodesInfo = provider( | ||
doc = """\ | ||
The available Xcode versions computed from the `available_xcodes` rule. | ||
""", | ||
fields = { | ||
"available_versions": """\ | ||
The available Xcode versions from `available_xcodes`. | ||
""", | ||
"default_version": """\ | ||
The default Xcode version from `available_xcodes`. | ||
""", | ||
}, | ||
) | ||
|
||
def _xcode_version_properties_info_init( | ||
*, | ||
xcode_version, | ||
default_ios_sdk_version = "8.4", | ||
default_macos_sdk_version = "10.11", | ||
default_tvos_sdk_version = "9.0", | ||
default_watchos_sdk_version = "2.0", | ||
default_visionos_sdk_version = "1.0"): | ||
# Ensure that all fields get default values if they weren't specified. | ||
return { | ||
"xcode_version": xcode_version, | ||
"default_ios_sdk_version": default_ios_sdk_version, | ||
"default_macos_sdk_version": default_macos_sdk_version, | ||
"default_tvos_sdk_version": default_tvos_sdk_version, | ||
"default_watchos_sdk_version": default_watchos_sdk_version, | ||
"default_visionos_sdk_version": default_visionos_sdk_version, | ||
} | ||
|
||
XcodeVersionPropertiesInfo, _new_xcode_version_properties_info = provider( | ||
doc = """\ | ||
Information about a specific Xcode version, such as its default SDK versions. | ||
""", | ||
fields = { | ||
"xcode_version": """\ | ||
A string representing the Xcode version number, or `None` if it is unknown. | ||
""", | ||
"default_ios_sdk_version": """\ | ||
A string representing the default iOS SDK version number for this version of | ||
Xcode, or `None` if it is unknown. | ||
""", | ||
"default_macos_sdk_version": """\ | ||
A string representing the default macOS SDK version number for this version of | ||
Xcode, or `None` if it is unknown. | ||
""", | ||
"default_tvos_sdk_version": """\ | ||
A string representing the default tvOS SDK version number for this version of | ||
Xcode, or `None` if it is unknown. | ||
""", | ||
"default_watchos_sdk_version": """\ | ||
A string representing the default watchOS SDK version number for this version of | ||
Xcode, or `None` if it is unknown. | ||
""", | ||
"default_visionos_sdk_version": """\ | ||
A string representing the default visionOS SDK version number for this version | ||
of Xcode, or `None` if it is unknown. | ||
""", | ||
}, | ||
init = _xcode_version_properties_info_init, | ||
) | ||
|
||
XcodeVersionRuleInfo = provider( | ||
doc = """\ | ||
The information in a single target of the `xcode_version` rule. A single target | ||
of this rule contains an official version label decided by Apple, a number of | ||
supported aliases one might use to reference this version, and various | ||
properties of the Xcode version (such as default SDK versions). | ||
For example, one may want to reference official Xcode version 7.0.1 using the | ||
"7" or "7.0" aliases. This official version of Xcode may have a default | ||
supported iOS SDK of 9.0. | ||
""", | ||
fields = { | ||
"aliases": """\ | ||
A list of strings denoting aliases that can be used to reference this Xcode | ||
version. | ||
""", | ||
"label": """\ | ||
The build `Label` of the `xcode_version` target that propagated this provider. | ||
""", | ||
"xcode_version_properties": """\ | ||
An `XcodeVersionPropertiesInfo` provider that contains the details about this | ||
Xcode version, such as its default SDK versions. | ||
""", | ||
}, | ||
) |
Oops, something went wrong.
f1bbadc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#332