diff --git a/messaging/MessagingExample.xcodeproj/project.pbxproj b/messaging/MessagingExample.xcodeproj/project.pbxproj index 89eac1a2f..bba95ee9e 100644 --- a/messaging/MessagingExample.xcodeproj/project.pbxproj +++ b/messaging/MessagingExample.xcodeproj/project.pbxproj @@ -17,6 +17,8 @@ 5F99610D1AE0CF4F0034F503 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5F9961071AE0CF4F0034F503 /* LaunchScreen.xib */; }; 8DC73D8C2D41AE850092B6EE /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = 8DC73D8B2D41AE850092B6EE /* FirebaseMessaging */; }; 978E6F2CAAC2AD673D158985 /* GoogleService-Info.plist in Sources */ = {isa = PBXBuildFile; fileRef = 82E79B6D15A982EAE7B0E31B /* GoogleService-Info.plist */; }; + EA2B4E6C2ED4F571003F9A40 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EA2B4E662ED4F571003F9A40 /* Main.storyboard */; }; + EA2B4E752ED4F571003F9A40 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EA2B4E662ED4F571003F9A40 /* Main.storyboard */; }; EAC902A32EC6849A000761B8 /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = EAC902A22EC6849A000761B8 /* FirebaseMessaging */; }; /* End PBXBuildFile section */ @@ -69,6 +71,7 @@ DEB13BC723AEC9DF0066A6F3 /* FIREGHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FIREGHelper.m; sourceTree = ""; }; DEB13BC823AEC9DF0066A6F3 /* FIREGSignInHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FIREGSignInHelper.h; sourceTree = ""; }; DED65CF723E9DE6400461312 /* FIREGSignInInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FIREGSignInInfo.h; sourceTree = ""; }; + EA2B4E652ED4F571003F9A40 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; EAE93A8D2E86E558005ABAF0 /* MessagingExample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MessagingExample.entitlements; sourceTree = ""; }; /* End PBXFileReference section */ @@ -175,6 +178,7 @@ EAE93A8A2E86E465005ABAF0 /* MessagingExample */ = { isa = PBXGroup; children = ( + EA2B4E662ED4F571003F9A40 /* Main.storyboard */, EAE93A8D2E86E558005ABAF0 /* MessagingExample.entitlements */, 5F5A537D1ADE67D500F81DF0 /* AppDelegate.swift */, 5F5A537F1ADE67D500F81DF0 /* ViewController.swift */, @@ -310,6 +314,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + EA2B4E6C2ED4F571003F9A40 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -319,6 +324,7 @@ files = ( 5F99610D1AE0CF4F0034F503 /* LaunchScreen.xib in Resources */, 5F99610B1AE0CF4F0034F503 /* Images.xcassets in Resources */, + EA2B4E752ED4F571003F9A40 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -367,6 +373,17 @@ }; /* End PBXTargetDependency section */ +/* Begin PBXVariantGroup section */ + EA2B4E662ED4F571003F9A40 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + EA2B4E652ED4F571003F9A40 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + /* Begin XCBuildConfiguration section */ 0718C8C02E8F256800AA7788 /* Debug */ = { isa = XCBuildConfiguration; diff --git a/messaging/MessagingExample/Base.lproj/Main.storyboard b/messaging/MessagingExample/Base.lproj/Main.storyboard new file mode 100644 index 000000000..5734736de --- /dev/null +++ b/messaging/MessagingExample/Base.lproj/Main.storyboard @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/build-for-testing.sh b/scripts/build-for-testing.sh index d5fdf0978..5df9eb4c3 100755 --- a/scripts/build-for-testing.sh +++ b/scripts/build-for-testing.sh @@ -22,11 +22,30 @@ set -euo pipefail +xcode_version=$(xcodebuild -version | grep Xcode) +xcode_version="${xcode_version/Xcode /}" +xcode_major="${xcode_version/.*/}" + +if [[ "$xcode_major" -ge 26 ]]; then + iphone_version="17" +elif [[ "$xcode_major" -ge 16 ]]; then + iphone_version="16" +else + echo "Unsupported Xcode version $xcode_version; exiting." 1>&2 + exit 1 +fi + # Set default parameters if [[ -z "${SPM:-}" ]]; then SPM=false echo "Defaulting to SPM=$SPM" fi +if [[ -z "${OS:-}" ]]; then + OS=iOS + DEVICE="iPhone ${iphone_version}" + echo "Defaulting to OS=$OS" + echo "Defaulting to DEVICE=$DEVICE" +fi # Set have_secrets to true or false. source scripts/check_secrets.sh @@ -45,7 +64,26 @@ fi # Set scheme if [[ -z "${SCHEME:-}" ]]; then if [[ "$SPM" == true ]];then - SCHEME="${SAMPLE}Example (${OS})" + # Get the list of schemes + schemes=$(xcodebuild -list -project "${DIR}/${SAMPLE}Example.xcodeproj" | + grep -E '^\s+' | + sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + + # Check for the OS-suffixed scheme name + if echo "$schemes" | grep -q "^${SAMPLE}Example (${OS})$"; then + SCHEME="${SAMPLE}Example (${OS})" + # Check for the Swift-suffixed scheme + elif echo "$schemes" | grep -q "^${SAMPLE}ExampleSwift$"; then + SCHEME="${SAMPLE}ExampleSwift" + # Check for the base scheme name + elif echo "$schemes" | grep -q "^${SAMPLE}Example$"; then + SCHEME="${SAMPLE}Example" + else + echo "Error: Could not find a suitable scheme for ${SAMPLE}Example in ${OS}." + echo "Available schemes:" + echo "$schemes" + exit 1 + fi else SCHEME="${SAMPLE}Example${SWIFT_SUFFIX:-}" fi @@ -82,7 +120,7 @@ function xcb() { } # Run xcodebuild -sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer +sudo xcode-select -p xcb "${flags[@]}" echo "$message"