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

Fix compatibility with CocoaPods frameworks #25393

Closed
wants to merge 8 commits into from
2 changes: 1 addition & 1 deletion Libraries/ART/React-ART.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Pod::Spec.new do |s|
s.source = source
s.source_files = "**/*.{h,m}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.header_dir = "React"
s.header_dir = "ART"

s.dependency "React-Core", version
end
2 changes: 1 addition & 1 deletion Libraries/ActionSheetIOS/React-RCTActionSheet.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Pod::Spec.new do |s|
s.source = source
s.source_files = "*.{h,m}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.header_dir = "React"
s.header_dir = "RCTActionSheet"

s.dependency "React-Core", version
end
14 changes: 12 additions & 2 deletions Libraries/Blob/RCTBlobManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,21 @@
#import <mutex>

#import <React/RCTConvert.h>
#import <React/RCTNetworking.h>
#import <React/RCTUtils.h>
#import <React/RCTWebSocketModule.h>
#import "RCTBlobCollector.h"

#if __has_include(<React/RCTNetworking.h>)
#import <React/RCTNetworking.h>
#else
#import <RCTNetwork/RCTNetworking.h>
#endif

#if __has_include(<React/RCTWebSocketModule.h>)
#import <React/RCTWebSocketModule.h>
#else
#import <RCTWebSocket/RCTWebSocketModule.h>
#endif

static NSString *const kBlobURIScheme = @"blob";

@interface RCTBlobManager () <RCTNetworkingRequestHandler, RCTNetworkingResponseHandler, RCTWebSocketContentHandler>
Expand Down
3 changes: 2 additions & 1 deletion Libraries/Blob/React-RCTBlob.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ Pod::Spec.new do |s|
s.source = source
s.source_files = "*.{h,m,mm}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.header_dir = "React"
s.header_dir = "RCTBlob"

s.dependency "React-Core", version
s.dependency "React-jsi", version
s.dependency "React-RCTNetwork", version
s.dependency "React-RCTWebSocket", version
end
2 changes: 1 addition & 1 deletion Libraries/Image/RCTGIFImageDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

#import <React/RCTImageLoader.h>
#import "RCTImageLoader.h"

@interface RCTGIFImageDecoder : NSObject <RCTImageDataDecoder>

Expand Down
4 changes: 4 additions & 0 deletions Libraries/Image/RCTImage.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
139A38841C4D587C00862840 /* RCTResizeMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 139A38831C4D587C00862840 /* RCTResizeMode.m */; };
13EF7F7F1BC825B1003F47DD /* RCTLocalAssetImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 13EF7F7E1BC825B1003F47DD /* RCTLocalAssetImageLoader.m */; };
143879381AAD32A300F088A5 /* RCTImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 143879371AAD32A300F088A5 /* RCTImageLoader.m */; };
1ADE600C22C26D790062EAE9 /* RCTResizeMode.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D5FA63E1DE4B44A0058FD77 /* RCTResizeMode.h */; };
1ADE601022C26DB60062EAE9 /* RCTResizeMode.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D5FA63E1DE4B44A0058FD77 /* RCTResizeMode.h */; };
2D3B5F1A1D9B0D0400451313 /* RCTImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = CCD34C261D4B8FE900268922 /* RCTImageCache.m */; };
2D3B5F1B1D9B0D0700451313 /* RCTImageBlurUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = EEF314711C9B0DD30049118E /* RCTImageBlurUtils.m */; };
2D3B5F1C1D9B0D1300451313 /* RCTResizeMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 139A38831C4D587C00862840 /* RCTResizeMode.m */; };
Expand Down Expand Up @@ -70,6 +72,7 @@
dstPath = include/RCTImage;
dstSubfolderSpec = 16;
files = (
1ADE600C22C26D790062EAE9 /* RCTResizeMode.h in Copy Headers */,
3D302E181DF8228100D6DDAE /* RCTImageUtils.h in Copy Headers */,
);
name = "Copy Headers";
Expand All @@ -81,6 +84,7 @@
dstPath = include/RCTImage;
dstSubfolderSpec = 16;
files = (
1ADE601022C26DB60062EAE9 /* RCTResizeMode.h in Copy Headers */,
3D302F211DF8269200D6DDAE /* RCTImageUtils.h in Copy Headers */,
);
name = "Copy Headers";
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Image/RCTImageCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#import <Foundation/Foundation.h>

#import <React/RCTImageLoader.h>
#import "RCTImageLoader.h"

@interface RCTImageCache : NSObject <RCTImageCache>
@end
9 changes: 7 additions & 2 deletions Libraries/Image/RCTImageCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@
#import <ImageIO/ImageIO.h>

#import <React/RCTConvert.h>
#import <React/RCTNetworking.h>
#import <React/RCTUtils.h>
#import <React/RCTResizeMode.h>
#import "RCTResizeMode.h"

#if __has_include(<React/RCTNetworking.h>)
#import <React/RCTNetworking.h>
#else
#import <RCTNetwork/RCTNetworking.h>
#endif

#import "RCTImageUtils.h"

Expand Down
2 changes: 1 addition & 1 deletion Libraries/Image/RCTImageLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#import <UIKit/UIKit.h>

#import <React/RCTBridge.h>
#import <React/RCTResizeMode.h>
#import "RCTResizeMode.h"
#import <React/RCTURLRequestHandler.h>

typedef void (^RCTImageLoaderProgressBlock)(int64_t progress, int64_t total);
Expand Down
9 changes: 7 additions & 2 deletions Libraries/Image/RCTImageLoader.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@

#import <React/RCTConvert.h>
#import <React/RCTDefines.h>
#import <React/RCTImageLoader.h>
#import "RCTImageLoader.h"
#import <React/RCTLog.h>
#import <React/RCTNetworking.h>
#import <React/RCTUtils.h>

#if __has_include(<React/RCTNetworking.h>)
#import <React/RCTNetworking.h>
#else
#import <RCTNetwork/RCTNetworking.h>
#endif

#import "RCTImageCache.h"
#import "RCTImageUtils.h"

Expand Down
2 changes: 1 addition & 1 deletion Libraries/Image/RCTImageUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import <UIKit/UIKit.h>

#import <React/RCTDefines.h>
#import <React/RCTResizeMode.h>
#import "RCTResizeMode.h"

NS_ASSUME_NONNULL_BEGIN

Expand Down
2 changes: 1 addition & 1 deletion Libraries/Image/RCTImageView.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#import <UIKit/UIKit.h>
#import <React/RCTView.h>
#import <React/RCTResizeMode.h>
#import "RCTResizeMode.h"

@class RCTBridge;
@class RCTImageSource;
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Image/RCTLocalAssetImageLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

#import <React/RCTImageLoader.h>
#import "RCTImageLoader.h"

@interface RCTLocalAssetImageLoader : NSObject <RCTImageURLLoader>

Expand Down
2 changes: 1 addition & 1 deletion Libraries/Image/React-RCTImage.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Pod::Spec.new do |s|
s.source = source
s.source_files = "*.{h,m}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.header_dir = "React"
s.header_dir = "RCTImage"

s.dependency "React-Core", version
s.dependency "React-RCTNetwork", version
Expand Down
2 changes: 1 addition & 1 deletion Libraries/LinkingIOS/React-RCTLinking.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Pod::Spec.new do |s|
s.source = source
s.source_files = "*.{h,m}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.header_dir = "React"
s.header_dir = "RCTLinking"

s.dependency "React-Core", version
end
2 changes: 1 addition & 1 deletion Libraries/NativeAnimation/React-RCTAnimation.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Pod::Spec.new do |s|
s.source = source
s.source_files = "{Drivers/*,Nodes/*,*}.{h,m}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.header_dir = "React"
s.header_dir = "RCTAnimation"

s.dependency "React-Core", version
end
2 changes: 1 addition & 1 deletion Libraries/Network/RCTNetworkTask.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#import "RCTNetworkTask.h"
#import <React/RCTLog.h>
#import <React/RCTNetworkTask.h>
#import <React/RCTUtils.h>

@implementation RCTNetworkTask
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Network/RCTNetworking.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

#import "RCTNetworkTask.h"
#import <React/RCTEventEmitter.h>
#import <React/RCTNetworkTask.h>
#import <React/RCTURLRequestHandler.h>

@protocol RCTNetworkingRequestHandler <NSObject>
Expand Down
4 changes: 2 additions & 2 deletions Libraries/Network/RCTNetworking.mm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#import <React/RCTConvert.h>
#import <React/RCTEventDispatcher.h>
#import <React/RCTLog.h>
#import <React/RCTNetworkTask.h>
#import <React/RCTNetworking.h>
#import "RCTNetworkTask.h"
#import "RCTNetworking.h"
#import <React/RCTUtils.h>

#import "RCTHTTPRequestHandler.h"
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Network/React-RCTNetwork.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Pod::Spec.new do |s|
s.source = source
s.source_files = "*.{h,m,mm}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.header_dir = "React"
s.header_dir = "RCTNetwork"

s.dependency "React-Core", version
end
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Pod::Spec.new do |s|
s.source = source
s.source_files = "*.{h,m}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.header_dir = "React"
s.header_dir = "RCTPushNotification"

s.dependency "React-Core", version
end
2 changes: 1 addition & 1 deletion Libraries/Settings/React-RCTSettings.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Pod::Spec.new do |s|
s.source = source
s.source_files = "*.{h,m}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.header_dir = "React"
s.header_dir = "RCTSettings"

s.dependency "React-Core", version
end
2 changes: 1 addition & 1 deletion Libraries/Text/React-RCTText.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Pod::Spec.new do |s|
s.source = source
s.source_files = "**/*.{h,m}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.header_dir = "React"
s.header_dir = "RCTText"

s.dependency "React-Core", version
end
2 changes: 1 addition & 1 deletion Libraries/Vibration/React-RCTVibration.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Pod::Spec.new do |s|
s.source = source
s.source_files = "*.{h,m}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.header_dir = "React"
s.header_dir = "RCTVibration"

s.dependency "React-Core", version
end
2 changes: 1 addition & 1 deletion Libraries/WebSocket/React-RCTWebSocket.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Pod::Spec.new do |s|
s.source = source
s.source_files = "*.{h,m}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.header_dir = "React"
s.header_dir = "RCTWebSocket"

s.dependency "React-Core", version
end
2 changes: 1 addition & 1 deletion RNTester/RCTTest/React-RCTTest.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Pod::Spec.new do |s|
s.source_files = "**/*.{h,m}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.framework = "XCTest"
s.header_dir = "React"
s.header_dir = "RCTTest"

s.dependency "React-Core", version
end
4 changes: 4 additions & 0 deletions RNTester/RNTesterUnitTests/RCTAnimationUtilsTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

#import <XCTest/XCTest.h>

#if __has_include(<React/RCTAnimationUtils.h>)
#import <RCTAnimation/RCTAnimationUtils.h>
#else
#import <RCTAnimation/RCTAnimationUtils.h>
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use React/RCTAnimationUtils.h I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right and I just pushed as you commented this 😄 Thanks!


@interface RCTAnimationUtilsTests : XCTestCase

Expand Down
4 changes: 4 additions & 0 deletions RNTester/RNTesterUnitTests/RCTBlobManagerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

#import <XCTest/XCTest.h>

#if __has_include(<React/RCTBlobManager.h>)
#import <React/RCTBlobManager.h>
#else
#import <RCTBlob/RCTBlobManager.h>
#endif

@interface RCTBlobManagerTests : XCTestCase

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@

#import <OCMock/OCMock.h>

#import <React/RCTUIManager.h>

#if __has_include(<React/RCTValueAnimatedNode.h>)
#import <React/RCTNativeAnimatedNodesManager.h>
#import <React/RCTValueAnimatedNode.h>
#else
#import <RCTAnimation/RCTNativeAnimatedNodesManager.h>
#import <RCTAnimation/RCTValueAnimatedNode.h>
#import <React/RCTUIManager.h>
#endif

static const NSTimeInterval FRAME_LENGTH = 1.0 / 60.0;

Expand Down
2 changes: 1 addition & 1 deletion React/DevSupport/RCTInspectorDevServerHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#import <UIKit/UIKit.h>

#import <React/RCTDefines.h>
#import <React/RCTInspectorPackagerConnection.h>
#import "RCTInspectorPackagerConnection.h"

#if RCT_DEV

Expand Down
7 changes: 6 additions & 1 deletion React/DevSupport/RCTPackagerClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
#import "RCTPackagerClient.h"

#import <React/RCTLog.h>
#import <React/RCTReconnectingWebSocket.h>
#import <React/RCTUtils.h>

#if __has_include(<React/RCTReconnectingWebSocket.h>)
#import <React/RCTReconnectingWebSocket.h>
#else
#import <RCTWebSocket/RCTReconnectingWebSocket.h>
#endif

#if RCT_DEV // Only supported in dev mode

const int RCT_PACKAGER_CLIENT_PROTOCOL_VERSION = 2;
Expand Down
10 changes: 8 additions & 2 deletions React/DevSupport/RCTPackagerConnection.mm
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@
#import <React/RCTConvert.h>
#import <React/RCTDefines.h>
#import <React/RCTLog.h>
#import <React/RCTPackagerClient.h>
#import "RCTPackagerClient.h"
#import <React/RCTUtils.h>

#if __has_include(<React/RCTReconnectingWebSocket.h>)
#import <React/RCTReconnectingWebSocket.h>
#import <React/RCTSRWebSocket.h>
#import <React/RCTUtils.h>
#else
#import <RCTWebSocket/RCTReconnectingWebSocket.h>
#import <RCTWebSocket/RCTSRWebSocket.h>
#endif

#if RCT_DEV
@interface RCTPackagerConnection () <RCTReconnectingWebSocketDelegate>
Expand Down
7 changes: 6 additions & 1 deletion React/Fabric/RCTSurfacePresenter.mm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#import <React/RCTComponentViewRegistry.h>
#import <React/RCTFabricSurface.h>
#import <React/RCTFollyConvert.h>
#import <React/RCTImageLoader.h>
#import <React/RCTMountingManager.h>
#import <React/RCTMountingManagerDelegate.h>
#import <React/RCTScheduler.h>
Expand All @@ -27,6 +26,12 @@
#import <React/RCTSurfaceView.h>
#import <React/RCTUtils.h>

#if __has_include(<React/RCTImageLoader.h>)
#import <React/RCTImageLoader.h>
#else
#import <RCTImage/RCTImageLoader.h>
#endif

#import <react/components/root/RootShadowNode.h>
#import <react/core/LayoutConstraints.h>
#import <react/core/LayoutContext.h>
Expand Down
Loading