-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make RCTTestModule TurboModule-compatible
Reviewed By: fkgozali Differential Revision: D18545790 fbshipit-source-id: 035df69671ec44d13b79b014bfe90f5af9f43e58
- Loading branch information
1 parent
6adba40
commit ff3b839
Showing
7 changed files
with
175 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @generated by an internal plugin build system | ||
*/ | ||
|
||
#ifdef RN_DISABLE_OSS_PLUGIN_HEADER | ||
|
||
// FB Internal: FBRCTTestPlugins.h is autogenerated by the build system. | ||
#import <React/FBRCTTestPlugins.h> | ||
|
||
#else | ||
|
||
// OSS-compatibility layer | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
// RCTTurboModuleManagerDelegate should call this to resolve module classes. | ||
Class RCTTestClassProvider(const char *name); | ||
|
||
// Lookup functions | ||
Class RCTTestModuleCls(void) __attribute__((used)); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#pragma GCC diagnostic pop | ||
|
||
#endif // RN_DISABLE_OSS_PLUGIN_HEADER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @generated by an internal plugin build system | ||
*/ | ||
|
||
#ifndef RN_DISABLE_OSS_PLUGIN_HEADER | ||
|
||
// OSS-compatibility layer | ||
|
||
#import "RCTTestPlugins.h" | ||
|
||
#import <string> | ||
#import <unordered_map> | ||
|
||
Class RCTTestClassProvider(const char *name) { | ||
static std::unordered_map<std::string, Class (*)(void)> sCoreModuleClassMap = { | ||
{"TestModule", RCTTestModuleCls}, | ||
}; | ||
|
||
auto p = sCoreModuleClassMap.find(name); | ||
if (p != sCoreModuleClassMap.end()) { | ||
auto classFunc = p->second; | ||
return classFunc(); | ||
} | ||
return nil; | ||
} | ||
|
||
#endif // RN_DISABLE_OSS_PLUGIN_HEADER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,11 @@ | |
27F441EC1BEBE5030039B79C /* FlexibleSizeExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */; }; | ||
2DDEF0101F84BF7B00DBDF73 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2DDEF00F1F84BF7B00DBDF73 /* Images.xcassets */; }; | ||
3D2AFAF51D646CF80089D1A3 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 3D2AFAF41D646CF80089D1A3 /* [email protected] */; }; | ||
42C7FD8921D436BBA216216D /* libPods-RNTester.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA4C77A9826FF02A56911142 /* libPods-RNTester.a */; }; | ||
57E63A755AEDF197848E52C0 /* libPods-RNTesterIntegrationTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 076801A3AA34E645F870C076 /* libPods-RNTesterIntegrationTests.a */; }; | ||
5C60EB1C226440DB0018C04F /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C60EB1B226440DB0018C04F /* AppDelegate.mm */; }; | ||
5CB07C9B226467E60039471C /* RNTesterTurboModuleProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CB07C99226467E60039471C /* RNTesterTurboModuleProvider.mm */; }; | ||
69B65AC442B001534251D909 /* libPods-RNTesterIntegrationTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BBFF3E3792E27C4FBA2CB43 /* libPods-RNTesterIntegrationTests.a */; }; | ||
C23B0809CAE8A115772B092E /* libPods-RNTesterUnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42A6C306038665FDDA3E54E2 /* libPods-RNTesterUnitTests.a */; }; | ||
CA98220F79ABB17F6FE10829 /* libPods-RNTester.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4610AEE3F1885AD3F6741BD1 /* libPods-RNTester.a */; }; | ||
E24D92BB73326FCC593E9450 /* libPods-RNTesterUnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 060D8FF3BA18357FD288E8C8 /* libPods-RNTesterUnitTests.a */; }; | ||
E7C1241A22BEC44B00DA25C0 /* RNTesterIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7C1241922BEC44B00DA25C0 /* RNTesterIntegrationTests.m */; }; | ||
E7DB20D122B2BAA6005AC45F /* RCTBundleURLProviderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7DB20A922B2BAA3005AC45F /* RCTBundleURLProviderTests.m */; }; | ||
E7DB20D222B2BAA6005AC45F /* RCTModuleInitNotificationRaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7DB20AA22B2BAA3005AC45F /* RCTModuleInitNotificationRaceTests.m */; }; | ||
|
@@ -69,6 +69,8 @@ | |
/* End PBXContainerItemProxy section */ | ||
|
||
/* Begin PBXFileReference section */ | ||
060D8FF3BA18357FD288E8C8 /* libPods-RNTesterUnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterUnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
076801A3AA34E645F870C076 /* libPods-RNTesterIntegrationTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterIntegrationTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
13B07F961A680F5B00A75B9A /* RNTester.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RNTester.app; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = RNTester/AppDelegate.h; sourceTree = "<group>"; }; | ||
13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; }; | ||
|
@@ -81,8 +83,7 @@ | |
2DDEF00F1F84BF7B00DBDF73 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = RNTester/Images.xcassets; sourceTree = "<group>"; }; | ||
34028D6B10F47E490042EB27 /* Pods-RNTesterUnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterUnitTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.debug.xcconfig"; sourceTree = "<group>"; }; | ||
3D2AFAF41D646CF80089D1A3 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "[email protected]"; path = "RNTester/[email protected]"; sourceTree = "<group>"; }; | ||
42A6C306038665FDDA3E54E2 /* libPods-RNTesterUnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterUnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
5BBFF3E3792E27C4FBA2CB43 /* libPods-RNTesterIntegrationTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterIntegrationTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
4610AEE3F1885AD3F6741BD1 /* libPods-RNTester.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTester.a"; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
5BEC8567F3741044B6A5EFC5 /* Pods-RNTester.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTester.release.xcconfig"; path = "Pods/Target Support Files/Pods-RNTester/Pods-RNTester.release.xcconfig"; sourceTree = "<group>"; }; | ||
5C60EB1B226440DB0018C04F /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = RNTester/AppDelegate.mm; sourceTree = "<group>"; }; | ||
5CB07C99226467E60039471C /* RNTesterTurboModuleProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RNTesterTurboModuleProvider.mm; path = RNTester/RNTesterTurboModuleProvider.mm; sourceTree = "<group>"; }; | ||
|
@@ -163,15 +164,14 @@ | |
E7DB216122B2F3EC005AC45F /* RCTRootViewIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootViewIntegrationTests.m; sourceTree = "<group>"; }; | ||
E7DB218B22B41FCD005AC45F /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; | ||
E9618482EC8608D4872A6E28 /* Pods-RNTesterUnitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterUnitTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.release.xcconfig"; sourceTree = "<group>"; }; | ||
EA4C77A9826FF02A56911142 /* libPods-RNTester.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTester.a"; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
/* End PBXFileReference section */ | ||
|
||
/* Begin PBXFrameworksBuildPhase section */ | ||
13B07F8C1A680F5B00A75B9A /* Frameworks */ = { | ||
isa = PBXFrameworksBuildPhase; | ||
buildActionMask = 2147483647; | ||
files = ( | ||
42C7FD8921D436BBA216216D /* libPods-RNTester.a in Frameworks */, | ||
CA98220F79ABB17F6FE10829 /* libPods-RNTester.a in Frameworks */, | ||
); | ||
runOnlyForDeploymentPostprocessing = 0; | ||
}; | ||
|
@@ -181,7 +181,7 @@ | |
files = ( | ||
E7DB213122B2C649005AC45F /* JavaScriptCore.framework in Frameworks */, | ||
E7DB213222B2C67D005AC45F /* libOCMock.a in Frameworks */, | ||
C23B0809CAE8A115772B092E /* libPods-RNTesterUnitTests.a in Frameworks */, | ||
E24D92BB73326FCC593E9450 /* libPods-RNTesterUnitTests.a in Frameworks */, | ||
); | ||
runOnlyForDeploymentPostprocessing = 0; | ||
}; | ||
|
@@ -191,7 +191,7 @@ | |
files = ( | ||
E7DB218C22B41FCD005AC45F /* XCTest.framework in Frameworks */, | ||
E7DB216722B2F69F005AC45F /* JavaScriptCore.framework in Frameworks */, | ||
69B65AC442B001534251D909 /* libPods-RNTesterIntegrationTests.a in Frameworks */, | ||
57E63A755AEDF197848E52C0 /* libPods-RNTesterIntegrationTests.a in Frameworks */, | ||
); | ||
runOnlyForDeploymentPostprocessing = 0; | ||
}; | ||
|
@@ -261,9 +261,9 @@ | |
E7DB211822B2BD53005AC45F /* libReact-RCTText.a */, | ||
E7DB211A22B2BD53005AC45F /* libReact-RCTVibration.a */, | ||
E7DB212222B2BD53005AC45F /* libyoga.a */, | ||
EA4C77A9826FF02A56911142 /* libPods-RNTester.a */, | ||
5BBFF3E3792E27C4FBA2CB43 /* libPods-RNTesterIntegrationTests.a */, | ||
42A6C306038665FDDA3E54E2 /* libPods-RNTesterUnitTests.a */, | ||
4610AEE3F1885AD3F6741BD1 /* libPods-RNTester.a */, | ||
076801A3AA34E645F870C076 /* libPods-RNTesterIntegrationTests.a */, | ||
060D8FF3BA18357FD288E8C8 /* libPods-RNTesterUnitTests.a */, | ||
); | ||
name = Frameworks; | ||
sourceTree = "<group>"; | ||
|