From ea240b84d659ec39e42b769c058f657dfce7091f Mon Sep 17 00:00:00 2001 From: Nicholas Levin Date: Fri, 26 Jan 2024 09:26:12 -0800 Subject: [PATCH] Append the Xcode build version to the appintentsmetadataprocessor for Xcode 15.3 builds, based on the version string reported from the XcodeVersionConfig provider. PiperOrigin-RevId: 601786735 --- apple/internal/resource_actions/app_intents.bzl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apple/internal/resource_actions/app_intents.bzl b/apple/internal/resource_actions/app_intents.bzl index 58f63649aa..b4514af05c 100644 --- a/apple/internal/resource_actions/app_intents.bzl +++ b/apple/internal/resource_actions/app_intents.bzl @@ -108,6 +108,18 @@ Could not find a module name for app_intents. One is required for App Intents me ) transitive_inputs.append(depset(constvalues_files)) args.add("--compile-time-extraction") + if xcode_version_config.xcode_version() >= apple_common.dotted_version("15.3"): + # Read the build version from the fourth component of the Xcode version. + xcode_version_split = str(xcode_version_config.xcode_version()).split(".") + if len(xcode_version_split) < 4: + fail("""\ +Internal Error: Expected xcode_config to report the Xcode version with the build version as the \ +fourth component of the full version string, but instead found {xcode_version_string}. Please file \ +an issue with the Apple BUILD rules with repro steps. +""".format( + xcode_version_string = str(xcode_version_config.xcode_version()), + )) + args.add("--xcode-version", xcode_version_split[3]) apple_support.run( actions = actions,