Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove multiple Xcode targets #97

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

barkoded
Copy link

@barkoded barkoded commented Jan 5, 2025

Updated the Xcode project to contain only one library target and a test target. The library target has been updated to support multiple platforms (including visionOS) and multiple TARGETED_DEVICE_FAMILY. All configuration related to the target platforms have been extracted into XcodeTargets.xcconfig including the deployment targets. Additionally the Cartfile, Podspec and makeXCFramework.sh have been updated to reflect these changes.

There may be one outstanding issue as makeXCFramework.sh fails when it reaches the last command in the script (xcodebuild -create-xcframework) where it is trying to create a XCFramework. It looks like it is related to macOS and Catalyst:

A library with the identifier 'macos-arm64_arm64e_x86_64' already exists.
OCHamcrest build failed

Updated the Xcode config file by reducing the number of targets (one per platform) as the same can be achived by adding multiple platforms to TARGETED_DEVICE_FAMILY and SUPPORTED_PLATFORMS for a single target. This have been done using the XcodeTargets config file. Additionally the Cartfile and Podspec have been updated to reflect these changes and to support xros (visionOS).
@coveralls
Copy link

coveralls commented Jan 7, 2025

Coverage Status

coverage: 99.158%. remained the same
when pulling 9c76f2f on barkoded:feature/merge-multiple-targets-into-one
into bb73578 on hamcrest:main.

barkoded and others added 2 commits January 7, 2025 12:59
Updated the workflow to reflect the changes in the project file. Additionally added build support for visionOS.
@jonreid
Copy link
Member

jonreid commented Jan 10, 2025

So many platforms, so few targets… wow. I think we can get rid of the old libochamcrest scheme, so I'm doing that.

@jonreid
Copy link
Member

jonreid commented Jan 10, 2025

Now if we can resolve the makeXCFramework.sh failure…

@barkoded
Copy link
Author

barkoded commented Jan 10, 2025

Thanks for fixing the Podfile and I wasn't sure about the libochamcrest scheme so thanks for removing that one as well.

I've updated the makeXCFramework.sh and executed it on a MacBook Pro M1 Max where it works as expected but I need to try it on an Intel machine

Updated almost all xcodebuild archive calls to include the destination argument. Additionally change the arguments for the xcodebuild -create-xcframework to use the archive argument in a combination with the framework argument (please see https://developer.apple.com/documentation/xcode/creating-a-multi-platform-binary-framework-bundle).
@jonreid
Copy link
Member

jonreid commented Jan 11, 2025

Wow, you fixed the script!

@barkoded
Copy link
Author

barkoded commented Jan 13, 2025

Wow, you fixed the script!

I just tried to call the MakeDistribution.sh from an Intel Mac running Xcode 16 on Sonoma 14.7 and it fails when reaching the following:

xcodebuild archive -scheme OCHamcrest -archivePath ./build/archives/xr_sim.xcarchive -sdk xrsimulator -destination "generic/platform=visionOS Simulator" SKIP_INSTALL=NO

and I assume that is due to you can't run the visionOS Simulator on an Intel Mac. Should we consider updating the MakeDistribution.sh to only run archive for the installed sdks (and maybe that would be a different issue)?

@jonreid
Copy link
Member

jonreid commented Jan 14, 2025

Honestly, I don't think anyone will run that script from an Intel Mac. A cheap workaround might be to add a comment saying so… what do you think?

@barkoded
Copy link
Author

barkoded commented Jan 14, 2025

@jonreid, For now I think your suggestion would do it but later we could explore if using the destinations from the xcodebuild -scheme "OCHamcrest" -showdestinations command could help us improve the script to only execute the supported destinations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants