From 1a3b8dee7c16e17d5771558e6d2974ecb236fbf1 Mon Sep 17 00:00:00 2001 From: James Ide Date: Tue, 17 Feb 2015 00:34:01 -0800 Subject: [PATCH] [Headers] Add an umbrella header for the library The umbrella header allows projects that link React Native using CocoaPods to import it in standard fashion: `#import `. Only some headers are included based on what I've found to be useful. Generated with `scripts/generate-umbrella-header.sh`, which is a script that scans the Base and Executors directories for all headers and also includes some handpicked Views headers as well. --- React/React.h | 56 +++++++++++++++++++++++++++ React/React.xcodeproj/project.pbxproj | 3 ++ scripts/generate-umbrella-header.sh | 49 +++++++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 React/React.h create mode 100755 scripts/generate-umbrella-header.sh diff --git a/React/React.h b/React/React.h new file mode 100644 index 00000000000000..2de1b08dc1fbb6 --- /dev/null +++ b/React/React.h @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +#import +#import + +#import +#import + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/React/React.xcodeproj/project.pbxproj b/React/React.xcodeproj/project.pbxproj index 1e193d9b2c9b07..0b425a58d82367 100644 --- a/React/React.xcodeproj/project.pbxproj +++ b/React/React.xcodeproj/project.pbxproj @@ -212,6 +212,8 @@ 58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDatePickerManager.h; sourceTree = ""; }; 63F014BE1B02080B003B75D2 /* RCTPointAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTPointAnnotation.h; sourceTree = ""; }; 63F014BF1B02080B003B75D2 /* RCTPointAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTPointAnnotation.m; sourceTree = ""; }; + 783ABB341B38A9D3003FFD95 /* RCTJavaScriptExecutor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTJavaScriptExecutor.m; sourceTree = ""; }; + 78BEE2481ABABC2E00F44561 /* React.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = React.h; sourceTree = ""; }; 830213F31A654E0800B993E6 /* RCTBridgeModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTBridgeModule.h; sourceTree = ""; }; 830A229C1A66C68A008503DA /* RCTRootView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRootView.h; sourceTree = ""; }; 830A229D1A66C68A008503DA /* RCTRootView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootView.m; sourceTree = ""; }; @@ -396,6 +398,7 @@ 83CBBA2F1A601D0F00E9B192 /* React */ = { isa = PBXGroup; children = ( + 78BEE2481ABABC2E00F44561 /* React.h */, 83CBBA491A601E3B00E9B192 /* Base */, 134FCB381A6E7F0800051CC8 /* Executors */, 13B07FC41A68125100A75B9A /* Layout */, diff --git a/scripts/generate-umbrella-header.sh b/scripts/generate-umbrella-header.sh new file mode 100755 index 00000000000000..6b9e9537a075e8 --- /dev/null +++ b/scripts/generate-umbrella-header.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +set -e + +SCRIPTS=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +ROOT=$(dirname $SCRIPTS) + +LIBRARY_NAME="React" +UMBRELLA_HEADER_PATH="${ROOT}/React/${LIBRARY_NAME}.h" + +cd $ROOT + +LIBRARY_HEADERS="\ +$(find React/Base -name "*.h") + +$(find React/Executors -name "*.h") + +React/Modules/RCTExceptionsManager.h +React/Modules/RCTUIManager.h + +React/Views/RCTAnimationType.h +React/Views/RCTAutoInsetsProtocol.h +React/Views/RCTConvert+CoreLocation.h +React/Views/RCTConvert+MapKit.h +React/Views/RCTPointerEvents.h +React/Views/RCTScrollableProtocol.h +React/Views/RCTShadowView.h +React/Views/RCTView.h +React/Views/RCTViewControllerProtocol.h +React/Views/RCTViewManager.h +React/Views/RCTViewNodeProtocol.h +React/Views/UIView+React.h\ +" + +echo \ +"/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +$( + echo "${LIBRARY_HEADERS}" | + awk -v lib="${LIBRARY_NAME}" '{if (NF) print "#import <"lib"/"$0">"; else print;}' + )\ +" > "${UMBRELLA_HEADER_PATH}"