[ ] I am removing an existing difference between facebook/react-native and microsoft/react-native-macos :thumbsup:
[ ] I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos :thumbsup:
[ ] I am making a fix / change for the macOS implementation of react-native
[x] I am making a change required for Microsoft usage of react-native
Summary:
This PR is part of a series of PRs for adding support for visionOS to the repository. See #2019 .
The way cocoapods works, the platforms a pod targets must be specified in its' pod spec, otherwise the generated Xcodeproj target won't output that platform's static library. AKA, if Pod A targets {:iOS => 13.4, :osx => 10.15}, then targets that output libA-iOS.a and libA-macOS.a will be generated, but not targets that output libA-visionOS.a. For most pod dependencies of react native, we set the platforms using min_supported_versions helper method, which we can override to return as many platforms as we want. However, there are a few pods where we don't control the podspec because we're getting it from the cocoapods registry. Without updating the pod in its own repo, we wouldn't be able to override the platforms, even if we're perfectly able to compile for said platform. In our case, that would be:
main:
SocketRocket
0.73 and 0.72:
SocketRocket
fmt
Rather than wait for those repos to update (SocketRocket has been taking a while), we can instead make local podspecs, stick in the folder third_party_podspecs, and reference them in our ruby methods. Let's do that.
We don't need to add fmt.podspec for main because https://github.com/facebook/react-native/commit/bb9ed0e9061288e56796fe6fe6a69541c3e09c90 already did so. For the back ports to 0.73-stable and 0.72-stable, I will cherry-pick that change with the caveat it is newer than the version of fmt used on those branches before. I tried to downgrade to 6.2.1... but then it failed to build. This is a library for formatting print statements and iostream, which should be relatively safe to upgrade.
Changelog:
[IOS] [CHANGED] - Add local podspecs to override supported platforms
Please select one of the following
Summary:
This PR is part of a series of PRs for adding support for visionOS to the repository. See #2019 .
The way cocoapods works, the platforms a pod targets must be specified in its' pod spec, otherwise the generated Xcodeproj target won't output that platform's static library. AKA, if Pod A targets
{:iOS => 13.4, :osx => 10.15}
, then targets that outputlibA-iOS.a
andlibA-macOS.a
will be generated, but not targets that outputlibA-visionOS.a
. For most pod dependencies of react native, we set the platforms usingmin_supported_versions
helper method, which we can override to return as many platforms as we want. However, there are a few pods where we don't control the podspec because we're getting it from the cocoapods registry. Without updating the pod in its own repo, we wouldn't be able to override the platforms, even if we're perfectly able to compile for said platform. In our case, that would be:main
:0.73
and0.72
:Rather than wait for those repos to update (SocketRocket has been taking a while), we can instead make local podspecs, stick in the folder
third_party_podspecs
, and reference them in our ruby methods. Let's do that.We don't need to add
fmt.podspec
formain
because https://github.com/facebook/react-native/commit/bb9ed0e9061288e56796fe6fe6a69541c3e09c90 already did so. For the back ports to0.73-stable
and0.72-stable
, I will cherry-pick that change with the caveat it is newer than the version offmt
used on those branches before. I tried to downgrade to 6.2.1... but then it failed to build. This is a library for formatting print statements and iostream, which should be relatively safe to upgrade.Changelog:
[IOS] [CHANGED] - Add local podspecs to override supported platforms
Test Plan:
CI should pass.