From a06c649ebeae380539f2607c2ea60a3cca786b7f Mon Sep 17 00:00:00 2001 From: rh389 Date: Tue, 6 Sep 2016 09:12:42 -0700 Subject: [PATCH] Include CSSLayout.h consistently with other project includes Summary: Include CSSLayout headers in the same way as other project headers, ie `#import ` becomes `#import "CSSLayout.h"`. CSSLayout is not a framework or system dependency, so shouldn't (AFAIK) be included with angle brackets. Doing so breaks framework builds, such as when RN is used as a pod in a swift project. In combination with https://github.com/facebook/css-layout/pull/217 this fixes https://github.com/facebook/react-native/issues/9014 (specifically swift cocoapods projects). There is then no need for a separate CSSLayout pod subspec. Tests run on the RN project in isolation (with changes inside `CSSLayout` itself also applied) and against a dummy swift project with RN included as a pod. NB: This effectively reverts https://github.com/facebook/react-native/pull/9015 and may break non-swift cocoapods projects unless https://github.com/facebook/css-layout/pull/217 is merged and synced first. Update: As discussed with alloy and emilsjolander, wrap these imports in a preprocess Closes https://github.com/facebook/react-native/pull/9544 Differential Revision: D3821791 Pulled By: javache fbshipit-source-id: d27ac8be9ce560d03479b43d3db740cd196c24da --- Libraries/Text/RCTTextManager.m | 6 ++++++ React.podspec | 8 +------- React/Base/RCTConvert.h | 6 ++++++ React/Modules/RCTUIManager.m | 6 ++++++ React/Views/RCTShadowView.h | 6 ++++++ 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/Libraries/Text/RCTTextManager.m b/Libraries/Text/RCTTextManager.m index 0e66829e67aacf..0f47dfd2555f9d 100644 --- a/Libraries/Text/RCTTextManager.m +++ b/Libraries/Text/RCTTextManager.m @@ -9,7 +9,13 @@ #import "RCTTextManager.h" +//Internally we reference a separate library. See https://github.com/facebook/react-native/pull/9544 +#if __has_include() #import +#else +#import "CSSLayout.h" +#endif + #import "RCTAccessibilityManager.h" #import "RCTAssert.h" #import "RCTConvert.h" diff --git a/React.podspec b/React.podspec index 6b071b47000098..98eed7cc8ea513 100644 --- a/React.podspec +++ b/React.podspec @@ -29,9 +29,8 @@ Pod::Spec.new do |s| s.preserve_paths = "cli.js", "Libraries/**/*.js", "lint", "linter.js", "node_modules", "package.json", "packager", "PATENTS", "react-native-cli" s.subspec 'Core' do |ss| - ss.dependency 'React/CSSLayout' ss.source_files = "React/**/*.{c,h,m,mm,S}" - ss.exclude_files = "**/__tests__/*", "IntegrationTests/*", "React/CSSLayout/*" + ss.exclude_files = "**/__tests__/*", "IntegrationTests/*" ss.frameworks = "JavaScriptCore" ss.libraries = "stdc++" ss.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++14" } @@ -43,11 +42,6 @@ Pod::Spec.new do |s| ss.preserve_paths = "Libraries/ART/**/*.js" end - s.subspec 'CSSLayout' do |ss| - ss.source_files = "React/CSSLayout/**/*.{c,h}" - ss.header_mappings_dir = "React" - end - s.subspec 'RCTActionSheet' do |ss| ss.dependency 'React/Core' ss.source_files = "Libraries/ActionSheetIOS/*.{h,m}" diff --git a/React/Base/RCTConvert.h b/React/Base/RCTConvert.h index 68a3e25dcd5399..86e80abb33b80b 100644 --- a/React/Base/RCTConvert.h +++ b/React/Base/RCTConvert.h @@ -10,7 +10,13 @@ #import #import +//Internally we reference a separate library. See https://github.com/facebook/react-native/pull/9544 +#if __has_include() #import +#else +#import "CSSLayout.h" +#endif + #import "RCTAnimationType.h" #import "RCTBorderStyle.h" #import "RCTTextDecorationLineType.h" diff --git a/React/Modules/RCTUIManager.m b/React/Modules/RCTUIManager.m index 264c01950fcdf9..2fa0aa97c80862 100644 --- a/React/Modules/RCTUIManager.m +++ b/React/Modules/RCTUIManager.m @@ -11,7 +11,13 @@ #import +//Internally we reference a separate library. See https://github.com/facebook/react-native/pull/9544 +#if __has_include() #import +#else +#import "CSSLayout.h" +#endif + #import "RCTAccessibilityManager.h" #import "RCTAnimationType.h" #import "RCTAssert.h" diff --git a/React/Views/RCTShadowView.h b/React/Views/RCTShadowView.h index c24cc404937b7b..fc620642da855c 100644 --- a/React/Views/RCTShadowView.h +++ b/React/Views/RCTShadowView.h @@ -9,7 +9,13 @@ #import +//Internally we reference a separate library. See https://github.com/facebook/react-native/pull/9544 +#if __has_include() #import +#else +#import "CSSLayout.h" +#endif + #import "RCTComponent.h" #import "RCTRootView.h"