Skip to content

Commit 0642071

Browse files
allevatobrentleyjones
authored andcommitted
Fork the Xcode rules from Bazel built-in Starlark into apple_support.
PiperOrigin-RevId: 631018102 (cherry picked from commit f1bbadc)
1 parent 288cfc0 commit 0642071

File tree

9 files changed

+766
-26
lines changed

9 files changed

+766
-26
lines changed

test/xcode_config_test.bzl

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,18 @@ load("//xcode:available_xcodes.bzl", "available_xcodes")
1919
load("//xcode:xcode_config.bzl", "xcode_config")
2020
load("//xcode:xcode_config_alias.bzl", "xcode_config_alias")
2121
load("//xcode:xcode_version.bzl", "xcode_version")
22+
load(
23+
"//xcode/private:providers.bzl",
24+
"XcodeVersionPropertiesInfo",
25+
) # buildifier: disable=bzl-visibility
2226
load(":test_helpers.bzl", "FIXTURE_TAGS", "find_action", "make_all_tests")
2327

2428
visibility("private")
2529

2630
# ------------------------------------------------------------------------------
2731

2832
def _version_retriever_impl(ctx):
29-
xcode_properties = ctx.attr.dep[apple_common.XcodeProperties]
33+
xcode_properties = ctx.attr.dep[XcodeVersionPropertiesInfo]
3034
version = xcode_properties.xcode_version
3135
return [config_common.FeatureFlagInfo(value = version)]
3236

@@ -264,6 +268,8 @@ def _accepts_flag_for_mutually_available(namer):
264268
_accepts_flag_for_mutually_available_test(
265269
name = "accepts_flag_for_mutually_available",
266270
target_under_test = "accepts_flag_for_mutually_available__foo",
271+
# TODO: Remove once we test with Bazel 8+
272+
tags = ["manual"],
267273
)
268274
return ["accepts_flag_for_mutually_available"]
269275

@@ -308,6 +314,8 @@ def _prefers_flag_over_mutually_available(namer):
308314
_prefers_flag_over_mutually_available_test(
309315
name = "prefers_flag_over_mutually_available",
310316
target_under_test = "prefers_flag_over_mutually_available__foo",
317+
# TODO: Remove once we test with Bazel 8+
318+
tags = ["manual"],
311319
)
312320
return ["prefers_flag_over_mutually_available"]
313321

@@ -352,6 +360,8 @@ def _warn_with_explicit_local_only_version(namer):
352360
_warn_with_explicit_local_only_version_test(
353361
name = "warn_with_explicit_local_only_version",
354362
target_under_test = "warn_with_explicit_local_only_version__foo",
363+
# TODO: Remove once we test with Bazel 8+
364+
tags = ["manual"],
355365
)
356366
return ["warn_with_explicit_local_only_version"]
357367

@@ -400,6 +410,8 @@ def _prefer_local_default_if_no_mutual_no_flag_different_main_version(namer):
400410
_prefer_local_default_if_no_mutual_no_flag_different_main_version_test(
401411
name = "prefer_local_default_if_no_mutual_no_flag_different_main_version",
402412
target_under_test = "prefer_local_default_if_no_mutual_no_flag_different_main_version__foo",
413+
# TODO: Remove once we test with Bazel 8+
414+
tags = ["manual"],
403415
)
404416
return ["prefer_local_default_if_no_mutual_no_flag_different_main_version"]
405417

@@ -447,6 +459,8 @@ def _prefer_local_default_if_no_mutual_no_flag_different_build_alias(namer):
447459
_prefer_local_default_if_no_mutual_no_flag_different_build_alias_test(
448460
name = "prefer_local_default_if_no_mutual_no_flag_different_build_alias",
449461
target_under_test = "prefer_local_default_if_no_mutual_no_flag_different_build_alias__foo",
462+
# TODO: Remove once we test with Bazel 8+
463+
tags = ["manual"],
450464
)
451465
return ["prefer_local_default_if_no_mutual_no_flag_different_build_alias"]
452466

@@ -494,6 +508,8 @@ def _prefer_local_default_if_no_mutual_no_flag_different_full_version(namer):
494508
_prefer_local_default_if_no_mutual_no_flag_different_full_version_test(
495509
name = "prefer_local_default_if_no_mutual_no_flag_different_full_version",
496510
target_under_test = "prefer_local_default_if_no_mutual_no_flag_different_full_version__foo",
511+
# TODO: Remove once we test with Bazel 8+
512+
tags = ["manual"],
497513
)
498514
return ["prefer_local_default_if_no_mutual_no_flag_different_full_version"]
499515

@@ -545,6 +561,8 @@ def _choose_newest_mutual_xcode(namer):
545561
_choose_newest_mutual_xcode_test(
546562
name = "choose_newest_mutual_xcode",
547563
target_under_test = "choose_newest_mutual_xcode__foo",
564+
# TODO: Remove once we test with Bazel 8+
565+
tags = ["manual"],
548566
)
549567
return ["choose_newest_mutual_xcode"]
550568

@@ -816,18 +834,26 @@ def _config_alias_config_setting(namer):
816834
_config_alias_config_setting_no_flag_test(
817835
name = "config_alias_config_setting_no_flag",
818836
target_under_test = namer("gen"),
837+
# TODO: Remove once we test with Bazel 8+
838+
tags = ["manual"],
819839
)
820840
_config_alias_config_setting_6_4_test(
821841
name = "config_alias_config_setting_6_4",
822842
target_under_test = namer("gen"),
843+
# TODO: Remove once we test with Bazel 8+
844+
tags = ["manual"],
823845
)
824846
_config_alias_config_setting_6_test(
825847
name = "config_alias_config_setting_6",
826848
target_under_test = namer("gen"),
849+
# TODO: Remove once we test with Bazel 8+
850+
tags = ["manual"],
827851
)
828852
_config_alias_config_setting_12_test(
829853
name = "config_alias_config_setting_12",
830854
target_under_test = namer("gen"),
855+
# TODO: Remove once we test with Bazel 8+
856+
tags = ["manual"],
831857
)
832858
return [
833859
"config_alias_config_setting_no_flag",
@@ -960,10 +986,14 @@ def _default_version_config_setting(namer):
960986
_default_version_config_setting_no_flag_test(
961987
name = "default_version_config_setting_no_flag",
962988
target_under_test = namer("gen"),
989+
# TODO: Remove once we test with Bazel 8+
990+
tags = ["manual"],
963991
)
964992
_default_version_config_setting_6_4_test(
965993
name = "default_version_config_setting_6_4",
966994
target_under_test = namer("gen"),
995+
# TODO: Remove once we test with Bazel 8+
996+
tags = ["manual"],
967997
)
968998
return [
969999
"default_version_config_setting_no_flag",
@@ -1013,6 +1043,8 @@ def _valid_version(namer):
10131043
_valid_version_test(
10141044
name = "valid_version",
10151045
target_under_test = "valid_version__foo",
1046+
# TODO: Remove once we test with Bazel 8+
1047+
tags = ["manual"],
10161048
)
10171049
return ["valid_version"]
10181050

@@ -1053,6 +1085,8 @@ def _valid_alias_dotted_version(namer):
10531085
_valid_alias_dotted_version_test(
10541086
name = "valid_alias_dotted_version",
10551087
target_under_test = "valid_alias_dotted_version__foo",
1088+
# TODO: Remove once we test with Bazel 8+
1089+
tags = ["manual"],
10561090
)
10571091
return ["valid_alias_dotted_version"]
10581092

@@ -1093,6 +1127,8 @@ def _valid_alias_nonnumerical(namer):
10931127
_valid_alias_nonnumerical_test(
10941128
name = "valid_alias_nonnumerical",
10951129
target_under_test = "valid_alias_nonnumerical__foo",
1130+
# TODO: Remove once we test with Bazel 8+
1131+
tags = ["manual"],
10961132
)
10971133
return ["valid_alias_nonnumerical"]
10981134

@@ -1176,6 +1212,8 @@ def _requires_default(namer):
11761212
_requires_default_test(
11771213
name = "requires_default",
11781214
target_under_test = "requires_default__foo",
1215+
# TODO: Remove once we test with Bazel 8+
1216+
tags = ["manual"],
11791217
)
11801218
return ["requires_default"]
11811219

@@ -1210,6 +1248,8 @@ def _duplicate_aliases_defined_version(namer):
12101248
_duplicate_aliases_defined_version_test(
12111249
name = "duplicate_aliases_defined_version",
12121250
target_under_test = "duplicate_aliases_defined_version__foo",
1251+
# TODO: Remove once we test with Bazel 8+
1252+
tags = ["manual"],
12131253
)
12141254
return ["duplicate_aliases_defined_version"]
12151255

@@ -1248,6 +1288,8 @@ def _duplicate_aliases_within_available_xcodes(namer):
12481288
_duplicate_aliases_within_available_xcodes_test(
12491289
name = "duplicate_aliases_within_available_xcodes",
12501290
target_under_test = "duplicate_aliases_within_available_xcodes__foo",
1291+
# TODO: Remove once we test with Bazel 8+
1292+
tags = ["manual"],
12511293
)
12521294
return ["duplicate_aliases_within_available_xcodes"]
12531295

@@ -1282,6 +1324,8 @@ def _version_aliased_to_itself(namer):
12821324
_version_aliased_to_itself_test(
12831325
name = "version_aliased_to_itself",
12841326
target_under_test = "version_aliased_to_itself__foo",
1327+
# TODO: Remove once we test with Bazel 8+
1328+
tags = ["manual"],
12851329
)
12861330
return ["version_aliased_to_itself"]
12871331

@@ -1322,6 +1366,8 @@ def _duplicate_version_numbers(namer):
13221366
_duplicate_version_numbers_test(
13231367
name = "duplicate_version_numbers",
13241368
target_under_test = "duplicate_version_numbers__foo",
1369+
# TODO: Remove once we test with Bazel 8+
1370+
tags = ["manual"],
13251371
)
13261372
return ["duplicate_version_numbers"]
13271373

@@ -1358,6 +1404,8 @@ def _version_conflicts_with_alias(namer):
13581404
_version_conflicts_with_alias_test(
13591405
name = "version_conflicts_with_alias",
13601406
target_under_test = "version_conflicts_with_alias__foo",
1407+
# TODO: Remove once we test with Bazel 8+
1408+
tags = ["manual"],
13611409
)
13621410
return ["version_conflicts_with_alias"]
13631411

@@ -1415,6 +1463,8 @@ def _default_ios_sdk_version(namer):
14151463
_default_ios_sdk_version_test(
14161464
name = "default_ios_sdk_version",
14171465
target_under_test = "default_ios_sdk_version__foo",
1466+
# TODO: Remove once we test with Bazel 8+
1467+
tags = ["manual"],
14181468
)
14191469
return ["default_ios_sdk_version"]
14201470

@@ -1482,6 +1532,8 @@ def _default_sdk_versions(namer):
14821532
_default_sdk_versions_test(
14831533
name = "default_sdk_versions",
14841534
target_under_test = "default_sdk_versions__foo",
1535+
# TODO: Remove once we test with Bazel 8+
1536+
tags = ["manual"],
14851537
)
14861538
return ["default_sdk_versions"]
14871539

@@ -1553,6 +1605,8 @@ def _default_sdk_versions_selected_xcode(namer):
15531605
_default_sdk_versions_selected_xcode_test(
15541606
name = "default_sdk_versions_selected_xcode",
15551607
target_under_test = "default_sdk_versions_selected_xcode__foo",
1608+
# TODO: Remove once we test with Bazel 8+
1609+
tags = ["manual"],
15561610
)
15571611
return ["default_sdk_versions_selected_xcode"]
15581612

@@ -1625,6 +1679,8 @@ def _override_default_sdk_versions(namer):
16251679
_override_default_sdk_versions_test(
16261680
name = "override_default_sdk_versions",
16271681
target_under_test = "override_default_sdk_versions__foo",
1682+
# TODO: Remove once we test with Bazel 8+
1683+
tags = ["manual"],
16281684
)
16291685
return ["override_default_sdk_versions"]
16301686

@@ -1682,6 +1738,8 @@ def _default_without_version(namer):
16821738
_default_without_version_test(
16831739
name = "default_without_version",
16841740
target_under_test = "default_without_version__foo",
1741+
# TODO: Remove once we test with Bazel 8+
1742+
tags = ["manual"],
16851743
)
16861744
return ["default_without_version"]
16871745

@@ -1731,6 +1789,8 @@ def _version_does_not_contain_default(namer):
17311789
_version_does_not_contain_default_test(
17321790
name = "version_does_not_contain_default",
17331791
target_under_test = "version_does_not_contain_default__foo",
1792+
# TODO: Remove once we test with Bazel 8+
1793+
tags = ["manual"],
17341794
)
17351795
return ["version_does_not_contain_default"]
17361796

@@ -1786,10 +1846,14 @@ def _configuration_field_for_rule(namer):
17861846
_configuration_field_for_rule_1_test(
17871847
name = "configuration_field_for_rule_1",
17881848
target_under_test = namer("provider_grabber"),
1849+
# TODO: Remove once we test with Bazel 8+
1850+
tags = ["manual"],
17891851
)
17901852
_configuration_field_for_rule_2_test(
17911853
name = "configuration_field_for_rule_2",
17921854
target_under_test = namer("provider_grabber"),
1855+
# TODO: Remove once we test with Bazel 8+
1856+
tags = ["manual"],
17931857
)
17941858
return [
17951859
"configuration_field_for_rule_1",
@@ -1876,10 +1940,14 @@ def _configuration_field_for_aspect(namer):
18761940
_configuration_field_for_aspect_1_test(
18771941
name = "configuration_field_for_aspect_1",
18781942
target_under_test = namer("provider_grabber"),
1943+
# TODO: Remove once we test with Bazel 8+
1944+
tags = ["manual"],
18791945
)
18801946
_configuration_field_for_aspect_2_test(
18811947
name = "configuration_field_for_aspect_2",
18821948
target_under_test = namer("provider_grabber"),
1949+
# TODO: Remove once we test with Bazel 8+
1950+
tags = ["manual"],
18831951
)
18841952
return [
18851953
"configuration_field_for_aspect_1",
@@ -1939,6 +2007,8 @@ def _explicit_xcodes_mode_no_flag(namer):
19392007
_explicit_xcodes_mode_no_flag_test(
19402008
name = "explicit_xcodes_mode_no_flag",
19412009
target_under_test = "explicit_xcodes_mode_no_flag__foo",
2010+
# TODO: Remove once we test with Bazel 8+
2011+
tags = ["manual"],
19422012
)
19432013
return ["explicit_xcodes_mode_no_flag"]
19442014

@@ -1976,6 +2046,8 @@ def _explicit_xcodes_mode_with_flag(namer):
19762046
_explicit_xcodes_mode_with_flag_test(
19772047
name = "explicit_xcodes_mode_with_flag",
19782048
target_under_test = "explicit_xcodes_mode_with_flag__foo",
2049+
# TODO: Remove once we test with Bazel 8+
2050+
tags = ["manual"],
19792051
)
19802052
return ["explicit_xcodes_mode_with_flag"]
19812053

@@ -2017,6 +2089,8 @@ def _available_xcodes_mode_no_flag(namer):
20172089
_available_xcodes_mode_no_flag_test(
20182090
name = "available_xcodes_mode_no_flag",
20192091
target_under_test = "available_xcodes_mode_no_flag__foo",
2092+
# TODO: Remove once we test with Bazel 8+
2093+
tags = ["manual"],
20202094
)
20212095
return ["available_xcodes_mode_no_flag"]
20222096

@@ -2056,6 +2130,8 @@ def _available_xcodes_mode_different_alias(namer):
20562130
_available_xcodes_mode_different_alias_test(
20572131
name = "available_xcodes_mode_different_alias",
20582132
target_under_test = "available_xcodes_mode_different_alias__foo",
2133+
# TODO: Remove once we test with Bazel 8+
2134+
tags = ["manual"],
20592135
)
20602136
return ["available_xcodes_mode_different_alias"]
20612137

@@ -2093,6 +2169,8 @@ def _available_xcodes_mode_different_alias_fully_specified(namer):
20932169
_available_xcodes_mode_different_alias_fully_specified_test(
20942170
name = "available_xcodes_mode_different_alias_fully_specified",
20952171
target_under_test = "available_xcodes_mode_different_alias_fully_specified__foo",
2172+
# TODO: Remove once we test with Bazel 8+
2173+
tags = ["manual"],
20962174
)
20972175
return ["available_xcodes_mode_different_alias_fully_specified"]
20982176

@@ -2135,6 +2213,8 @@ def _available_xcodes_mode_with_flag(namer):
21352213
_available_xcodes_mode_with_flag_test(
21362214
name = "available_xcodes_mode_with_flag",
21372215
target_under_test = "available_xcodes_mode_with_flag__foo",
2216+
# TODO: Remove once we test with Bazel 8+
2217+
tags = ["manual"],
21382218
)
21392219
return ["available_xcodes_mode_with_flag"]
21402220

test/xcode_version_test.bzl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616

1717
load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts")
1818
load("//xcode:xcode_version.bzl", "xcode_version")
19+
load(
20+
"//xcode/private:providers.bzl",
21+
"XcodeVersionPropertiesInfo",
22+
) # buildifier: disable=bzl-visibility
1923
load(":test_helpers.bzl", "FIXTURE_TAGS", "make_all_tests")
2024

2125
visibility("private")
@@ -44,7 +48,7 @@ def _read_version_from_provider_test_impl(ctx):
4448
env = analysistest.begin(ctx)
4549

4650
target_under_test = analysistest.target_under_test(env)
47-
xcode_properties = target_under_test[apple_common.XcodeProperties]
51+
xcode_properties = target_under_test[XcodeVersionPropertiesInfo]
4852

4953
asserts.equals(env, "8", xcode_properties.xcode_version)
5054
asserts.equals(env, "9.0", xcode_properties.default_ios_sdk_version)

0 commit comments

Comments
 (0)