Skip to content

Commit

Permalink
Move all header imports to "<React/..>"
Browse files Browse the repository at this point in the history
Summary:
To make React Native play nicely with our internal build infrastructure we need to properly namespace all of our header includes.

Where previously you could do `#import "RCTBridge.h"`, you must now write this as `#import <React/RCTBridge.h>`. If your xcode project still has a custom header include path, both variants will likely continue to work, but for new projects, we're defaulting the header include path to `$(BUILT_PRODUCTS_DIR)/usr/local/include`, where the React and CSSLayout targets will copy a subset of headers too. To make Xcode copy headers phase work properly, you may need to add React as an explicit dependency to your app's scheme and disable "parallelize build".

Reviewed By: mmmulani

Differential Revision: D4213120

fbshipit-source-id: 84a32a4b250c27699e6795f43584f13d594a9a82
  • Loading branch information
javache authored and Facebook Github Bot committed Nov 23, 2016
1 parent 5850165 commit e1577df
Show file tree
Hide file tree
Showing 220 changed files with 1,492 additions and 1,197 deletions.
61 changes: 33 additions & 28 deletions Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
2D4BD8E61DA2E20D005AC8A8 /* TestBundle.js in Resources */ = {isa = PBXBuildFile; fileRef = 3DD981D51D33C6FB007DC7BE /* TestBundle.js */; };
2D4BD8E71DA2E20D005AC8A8 /* libOCMock.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14D6D7101B220EB3001FB087 /* libOCMock.a */; };
2D8C2E321DA40403000EE098 /* RCTMultipartStreamReaderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 001BFCE31D838343008E587E /* RCTMultipartStreamReaderTests.m */; };
2DD0EFF41DA853B200B0C975 /* libRCTPushNotification-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD0EFF31DA853B200B0C975 /* libRCTPushNotification-tvOS.a */; };
2DD323DC1DA2DDBF000FE1B8 /* FlexibleSizeExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */; };
2DD323DD1DA2DDBF000FE1B8 /* UpdatePropertiesExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */; };
2DD323DE1DA2DDBF000FE1B8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
Expand Down Expand Up @@ -212,13 +211,6 @@
remoteGlobalIDString = 2DD3238F1DA2DD8A000FE1B8;
remoteInfo = "UIExplorer-tvOS";
};
2DD0EFF21DA853B200B0C975 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 14DC67E71AB71876001358AB /* RCTPushNotification.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 2DD0EFE61DA8533A00B0C975;
remoteInfo = "RCTPushNotification-tvOS";
};
2DD323A61DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
Expand Down Expand Up @@ -303,6 +295,20 @@
remoteGlobalIDString = 3D13F83D1D6F6AE000E69E0E;
remoteInfo = UIExplorerBundle;
};
3D3C08801DE3424E00C268FA /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D3C059A1DE3340900C268FA;
remoteInfo = CSSLayout;
};
3D3C08821DE3424E00C268FA /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D3C06751DE3340C00C268FA;
remoteInfo = "CSSLayout-tvOS";
};
58005BED1ABA80530062E044 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 58005BE41ABA80530062E044 /* RCTTest.xcodeproj */;
Expand Down Expand Up @@ -438,9 +444,9 @@
13E501F11D07A84A005F35D8 /* libRCTAnimation.a in Frameworks */,
138DEE241B9EDFB6007F4EA5 /* libRCTCameraRoll.a in Frameworks */,
134A8A2A1AACED7A00945AAE /* libRCTGeolocation.a in Frameworks */,
1341802C1AA9178B003F314A /* libRCTNetwork.a in Frameworks */,
13417FE91AA91432003F314A /* libRCTImage.a in Frameworks */,
3578590A1B28D2CF00341EDB /* libRCTLinking.a in Frameworks */,
1341802C1AA9178B003F314A /* libRCTNetwork.a in Frameworks */,
14DC67F41AB71881001358AB /* libRCTPushNotification.a in Frameworks */,
834C36EC1AF8DED70019C93C /* libRCTSettings.a in Frameworks */,
134180011AA9153C003F314A /* libRCTText.a in Frameworks */,
Expand Down Expand Up @@ -469,7 +475,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
2DD0EFF41DA853B200B0C975 /* libRCTPushNotification-tvOS.a in Frameworks */,
2DD323E31DA2DE3F000FE1B8 /* libRCTAnimation-tvOS.a in Frameworks */,
2DD323E41DA2DE3F000FE1B8 /* libRCTImage-tvOS.a in Frameworks */,
2DD323E51DA2DE3F000FE1B8 /* libRCTLinking-tvOS.a in Frameworks */,
Expand Down Expand Up @@ -681,6 +686,8 @@
children = (
14AADF041AC3DB95002390C9 /* libReact.a */,
2DD323D91DA2DD8B000FE1B8 /* libReact-tvOS.a */,
3D3C08811DE3424E00C268FA /* libCSSLayout.a */,
3D3C08831DE3424E00C268FA /* libCSSLayout-tvOS.a */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -712,7 +719,6 @@
isa = PBXGroup;
children = (
14DC67F11AB71876001358AB /* libRCTPushNotification.a */,
2DD0EFF31DA853B200B0C975 /* libRCTPushNotification-tvOS.a */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -1134,13 +1140,6 @@
remoteRef = 14DC67F01AB71876001358AB /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
2DD0EFF31DA853B200B0C975 /* libRCTPushNotification-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libRCTPushNotification-tvOS.a";
remoteRef = 2DD0EFF21DA853B200B0C975 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
2DD323B51DA2DD8B000FE1B8 /* libRCTAnimation-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
Expand Down Expand Up @@ -1211,6 +1210,20 @@
remoteRef = 357859001B28D2C500341EDB /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
3D3C08811DE3424E00C268FA /* libCSSLayout.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libCSSLayout.a;
remoteRef = 3D3C08801DE3424E00C268FA /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
3D3C08831DE3424E00C268FA /* libCSSLayout-tvOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libCSSLayout-tvOS.a";
remoteRef = 3D3C08821DE3424E00C268FA /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
58005BEE1ABA80530062E044 /* libRCTTest.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
Expand Down Expand Up @@ -1798,11 +1811,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/../../React/**",
"$(SRCROOT)/../../ReactCommon/**",
"$(SRCROOT)/../../Libraries/**",
);
HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/usr/local/include";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -1862,11 +1871,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/../../React/**",
"$(SRCROOT)/../../ReactCommon/**",
"$(SRCROOT)/../../Libraries/**",
);
HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/usr/local/include";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_LDFLAGS = (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
parallelizeBuildables = "NO"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192"
BuildableName = "libReact.a"
BlueprintName = "React"
ReferencedContainer = "container:../../React/React.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
Expand Down
13 changes: 7 additions & 6 deletions Examples/UIExplorer/UIExplorer/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@

#import "AppDelegate.h"

#import "RCTBridge.h"
#import "RCTBundleURLProvider.h"
#import "RCTJavaScriptLoader.h"
#import "RCTLinkingManager.h"
#import "RCTRootView.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTJavaScriptLoader.h>
#import <React/RCTLinkingManager.h>
#import <React/RCTRootView.h>

#if !TARGET_OS_TV
#import "RCTPushNotificationManager.h"
#import <React/RCTPushNotificationManager.h>
#endif

@interface AppDelegate() <RCTBridgeDelegate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
*/

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

#import <React/RCTView.h>

@interface FlexibleSizeExampleView : RCTView

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#import "AppDelegate.h"

#import "FlexibleSizeExampleView.h"
#import "RCTJavaScriptLoader.h"
#import "RCTBridge.h"
#import "RCTRootView.h"
#import "RCTRootViewDelegate.h"

#import "RCTViewManager.h"
#import <React/RCTBridge.h>
#import <React/RCTRootView.h>
#import <React/RCTRootViewDelegate.h>
#import <React/RCTViewManager.h>

#import "AppDelegate.h"

@interface FlexibleSizeExampleViewManager : RCTViewManager

Expand All @@ -38,7 +37,7 @@ - (UIView *)view
@end


@interface FlexibleSizeExampleView ()<RCTRootViewDelegate>
@interface FlexibleSizeExampleView () <RCTRootViewDelegate>

@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
*/

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

#import <React/RCTView.h>

@interface UpdatePropertiesExampleView : RCTView

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#import "AppDelegate.h"

#import "UpdatePropertiesExampleView.h"
#import "RCTJavaScriptLoader.h"
#import "RCTBridge.h"
#import "RCTRootView.h"
#import "RCTViewManager.h"

#import <React/RCTRootView.h>
#import <React/RCTViewManager.h>

#import "AppDelegate.h"

@interface UpdatePropertiesExampleViewManager : RCTViewManager

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* under the License.
*/

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


@interface OCMStubRecorder : OCMRecorder
Expand Down Expand Up @@ -51,6 +51,3 @@
@property (nonatomic, readonly) OCMStubRecorder *(^ _andForwardToRealObject)(void);

@end



Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

#import <XCTest/XCTest.h>

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

#import "RCTUtils.h"

@interface RCTConvert_NSURLTests : XCTestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

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

typedef BOOL (^RCTImageURLLoaderCanLoadImageURLHandler)(NSURL *requestURL);
typedef RCTImageLoaderCancellationBlock (^RCTImageURLLoaderLoadImageURLHandler)(NSURL *imageURL, CGSize size, CGFloat scale, RCTResizeMode resizeMode, RCTImageLoaderProgressBlock progressHandler, RCTImageLoaderCompletionBlock completionHandler);
Expand Down
36 changes: 3 additions & 33 deletions Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,12 @@
14C644C41AB0DFC900DE3C65 /* RCTActionSheetManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 14C644C21AB0DFC900DE3C65 /* RCTActionSheetManager.m */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
58B511D91A9E6C8500147676 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "include/$(PRODUCT_NAME)";
dstSubfolderSpec = 16;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
134814201AA4EA6300B7C361 /* libRCTActionSheet.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTActionSheet.a; sourceTree = BUILT_PRODUCTS_DIR; };
14C644C11AB0DFC900DE3C65 /* RCTActionSheetManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTActionSheetManager.h; sourceTree = "<group>"; };
14C644C11AB0DFC900DE3C65 /* RCTActionSheetManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = RCTActionSheetManager.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
14C644C21AB0DFC900DE3C65 /* RCTActionSheetManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTActionSheetManager.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
58B511D81A9E6C8500147676 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
134814211AA4EA7D00B7C361 /* Products */ = {
isa = PBXGroup;
Expand Down Expand Up @@ -66,8 +44,6 @@
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTActionSheet" */;
buildPhases = (
58B511D71A9E6C8500147676 /* Sources */,
58B511D81A9E6C8500147676 /* Frameworks */,
58B511D91A9E6C8500147676 /* CopyFiles */,
);
buildRules = (
);
Expand Down Expand Up @@ -156,10 +132,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/../../React/**",
"$(SRCROOT)/../../ReactCommon/**",
);
HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/usr/local/include";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -200,10 +173,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/../../React/**",
"$(SRCROOT)/../../ReactCommon/**",
);
HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/usr/local/include";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
Expand Down
2 changes: 1 addition & 1 deletion Libraries/ActionSheetIOS/RCTActionSheetManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#import <UIKit/UIKit.h>

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

@interface RCTActionSheetManager : NSObject <RCTBridgeModule>

Expand Down
10 changes: 5 additions & 5 deletions Libraries/ActionSheetIOS/RCTActionSheetManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

#import "RCTActionSheetManager.h"

#import "RCTConvert.h"
#import "RCTLog.h"
#import "RCTUtils.h"
#import "RCTBridge.h"
#import "RCTUIManager.h"
#import <React/RCTBridge.h>
#import <React/RCTConvert.h>
#import <React/RCTLog.h>
#import <React/RCTUIManager.h>
#import <React/RCTUtils.h>

@interface RCTActionSheetManager () <UIActionSheetDelegate>
@end
Expand Down
Loading

0 comments on commit e1577df

Please sign in to comment.