From 6e2ea47aeb29416da3ee514ed815dfb35cfe2bb2 Mon Sep 17 00:00:00 2001 From: Steve Kirkland Date: Mon, 4 Nov 2024 18:03:43 +0000 Subject: [PATCH] Build the XcFramework macOS app --- .buildkite/pipeline.full.yml | 2 +- .gitignore | 1 + Makefile | 2 +- .../scripts/export_xcframework_mac_app.sh | 44 +++++++++++++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100755 features/scripts/export_xcframework_mac_app.sh diff --git a/.buildkite/pipeline.full.yml b/.buildkite/pipeline.full.yml index ea593d13e..c8c0947ec 100644 --- a/.buildkite/pipeline.full.yml +++ b/.buildkite/pipeline.full.yml @@ -16,8 +16,8 @@ steps: download: "Bugsnag.xcframework.zip" upload: - features/fixtures/ios/output/iOSTestAppXcFramework.ipa - # - features/fixtures/macos/output/macOSTestApp.zip - features/fixtures/ios/output/xcframework_ipa_url_bb.txt + - features/fixtures/macos/output/macOSTestAppXcFramework.zip commands: - unzip Bugsnag.xcframework.zip - bundle install diff --git a/.gitignore b/.gitignore index fb42ca13e..38108f197 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ Package.resolved bb.ready /maze_output Gemfile.lock +Bugsnag.xcframework.zip \ No newline at end of file diff --git a/Makefile b/Makefile index b07ceeff6..176679f75 100644 --- a/Makefile +++ b/Makefile @@ -139,7 +139,7 @@ test-fixtures: ## Build the end-to-end test fixture xcframework-test-fixtures: ## Build the xcframework end-to-end test fixture @./features/scripts/export_xcframework_ios_app.sh -# @./features/scripts/export_xcframework_mac_app.sh + @./features/scripts/export_xcframework_mac_app.sh e2e_ios_local: @./features/scripts/export_ios_app.sh diff --git a/features/scripts/export_xcframework_mac_app.sh b/features/scripts/export_xcframework_mac_app.sh new file mode 100755 index 000000000..f46d61350 --- /dev/null +++ b/features/scripts/export_xcframework_mac_app.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +set -euo pipefail + +pushd features/fixtures/macos + + echo "--- macOSTestAppXcFramework: xcodebuild archive" + + BUILD_ARGS=( + -workspace macOSTestAppXcFramework.xcodeproj/project.xcworkspace + -scheme macOSTestAppXcFramework + -destination generic/platform=macOS + -configuration Release + -archivePath archive/macOSTestAppXcFramework.xcarchive + -quiet + archive + ONLY_ACTIVE_ARCH=NO + ) + + if [ "${ENABLE_CODE_COVERAGE:-}" = YES ]; then + BUILD_ARGS+=( + OTHER_CFLAGS='$(inherited) -fprofile-instr-generate -fcoverage-mapping' + OTHER_LDFLAGS='$(inherited) -fprofile-instr-generate' + OTHER_SWIFT_FLAGS='$(inherited) -profile-generate -profile-coverage-mapping' + ) + fi + + xcodebuild "${BUILD_ARGS[@]}" + + echo "--- macOSTestAppXcFramework: xcodebuild -exportArchive" + + xcrun xcodebuild \ + -exportArchive \ + -exportPath output/ \ + -exportOptionsPlist exportOptions.plist \ + -archivePath archive/macOSTestAppXcFramework.xcarchive \ + -destination generic/platform=macOS \ + -quiet + + pushd output + echo "--- macOSTestApp: zip" + zip -qr macOSTestAppXcFramework.zip macOSTestAppXcFramework.app + popd +popd