Include the product version as an alias when generating xcode_version targets
This allows passing `--xcode_version=$XCODE_PRODUCT_BUILD_VERSION` in the context of an Xcode shell script build phase
Closes #12563.
PiperOrigin-RevId: 345763331
diff --git a/tools/osx/xcode_configure.bzl b/tools/osx/xcode_configure.bzl
index e43e161..5b14fcb 100644
--- a/tools/osx/xcode_configure.bzl
+++ b/tools/osx/xcode_configure.bzl
@@ -74,7 +74,7 @@
build_contents += "xcode_version(\n name = '%s'," % name
build_contents += "\n version = '%s'," % version
if aliases:
- build_contents += "\n aliases = [%s]," % " ,".join(decorated_aliases)
+ build_contents += "\n aliases = [%s]," % ", ".join(decorated_aliases)
if ios_sdk_version:
build_contents += "\n default_ios_sdk_version = '%s'," % ios_sdk_version
if tvos_sdk_version:
@@ -231,7 +231,7 @@
if (version.startswith(default_xcode_version) and
version.endswith(default_xcode_build_version)):
default_xcode_target = target_label
- buildcontents += "xcode_config(name = 'host_xcodes',"
+ buildcontents += "xcode_config(\n name = 'host_xcodes',"
if target_names:
buildcontents += "\n versions = [%s]," % ", ".join(target_names)
if not default_xcode_target and target_names:
@@ -242,7 +242,7 @@
buildcontents += "\n default = %s," % default_xcode_target
buildcontents += "\n)\n"
- buildcontents += "available_xcodes(name = 'host_available_xcodes',"
+ buildcontents += "available_xcodes(\n name = 'host_available_xcodes',"
if target_names:
buildcontents += "\n versions = [%s]," % ", ".join(target_names)
if default_xcode_target: