From b70465f9b6ee6b3c5a4ade4302998186d72dadda Mon Sep 17 00:00:00 2001 From: max-mironov Date: Thu, 3 Aug 2017 11:48:11 +0300 Subject: [PATCH] Updated Android/ios parts for DemoApp with RN0.47.1 --- Examples/CodePushDemoApp/.babelrc | 4 +- Examples/CodePushDemoApp/.flowconfig | 8 +- .../CodePushDemoApp/android/app/build.gradle | 9 +- .../android/app/proguard-rules.pro | 4 + .../com/codepushdemoapp/MainApplication.java | 2 +- .../app/src/main/res/values/strings.xml | 2 +- Examples/CodePushDemoApp/demo.js | 2 +- Examples/CodePushDemoApp/demo.jse | 162 ------------------ .../CodePushDemoApp.xcodeproj/project.pbxproj | 154 +++++++---------- .../contents.xcworkspacedata | 7 - .../iOS/CodePushDemoApp/AppDelegate.m | 4 +- .../iOS/CodePushDemoApp/Info.plist | 2 +- .../CodePushDemoAppTests.m | 1 - Examples/CodePushDemoApp/index.android.js | 2 +- Examples/CodePushDemoApp/index.ios.js | 2 +- Examples/CodePushDemoApp/package.json | 44 ++--- 16 files changed, 111 insertions(+), 298 deletions(-) delete mode 100644 Examples/CodePushDemoApp/demo.jse delete mode 100644 Examples/CodePushDemoApp/iOS/CodePushDemoApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Examples/CodePushDemoApp/.babelrc b/Examples/CodePushDemoApp/.babelrc index 8df53fe..a9ce136 100644 --- a/Examples/CodePushDemoApp/.babelrc +++ b/Examples/CodePushDemoApp/.babelrc @@ -1,3 +1,3 @@ { -"presets": ["react-native"] -} \ No newline at end of file + "presets": ["react-native"] +} diff --git a/Examples/CodePushDemoApp/.flowconfig b/Examples/CodePushDemoApp/.flowconfig index dcd5fd6..8346120 100644 --- a/Examples/CodePushDemoApp/.flowconfig +++ b/Examples/CodePushDemoApp/.flowconfig @@ -26,8 +26,6 @@ emoji=true module.system=haste -experimental.strict_type_args=true - munge_underscores=true module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' @@ -36,12 +34,12 @@ suppress_type=$FlowIssue suppress_type=$FlowFixMe suppress_type=$FixMe -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-0]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-0]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ +suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) +suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError unsafe.enable_getters_and_setters=true [version] -^0.40.0 +^0.49.1 diff --git a/Examples/CodePushDemoApp/android/app/build.gradle b/Examples/CodePushDemoApp/android/app/build.gradle index 6ca2950..8497f05 100644 --- a/Examples/CodePushDemoApp/android/app/build.gradle +++ b/Examples/CodePushDemoApp/android/app/build.gradle @@ -33,6 +33,13 @@ import com.android.build.OutputFile * // bundleInPaidRelease: true, * // bundleInBeta: true, * + * // whether to disable dev mode in custom build variants (by default only disabled in release) + * // for example: to disable dev mode in the staging build type (if configured) + * devDisabledInStaging: true, + * // The configuration property can be in the following formats + * // 'devDisabledIn${productFlavor}${buildType}' + * // 'devDisabledIn${buildType}' + * * // the root of your project, i.e. where "package.json" lives * root: "../../", * @@ -58,7 +65,7 @@ import com.android.build.OutputFile * inputExcludes: ["android/**", "ios/**"], * * // override which node gets called and with what additional arguments - * nodeExecutableAndArgs: ["node"] + * nodeExecutableAndArgs: ["node"], * * // supply additional arguments to the packager * extraPackagerArgs: [] diff --git a/Examples/CodePushDemoApp/android/app/proguard-rules.pro b/Examples/CodePushDemoApp/android/app/proguard-rules.pro index 48361a9..6e8516c 100644 --- a/Examples/CodePushDemoApp/android/app/proguard-rules.pro +++ b/Examples/CodePushDemoApp/android/app/proguard-rules.pro @@ -50,6 +50,10 @@ -dontwarn com.facebook.react.** +# TextLayoutBuilder uses a non-public Android constructor within StaticLayout. +# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details. +-dontwarn android.text.StaticLayout + # okhttp -keepattributes Signature diff --git a/Examples/CodePushDemoApp/android/app/src/main/java/com/codepushdemoapp/MainApplication.java b/Examples/CodePushDemoApp/android/app/src/main/java/com/codepushdemoapp/MainApplication.java index 14af729..d7e4f62 100644 --- a/Examples/CodePushDemoApp/android/app/src/main/java/com/codepushdemoapp/MainApplication.java +++ b/Examples/CodePushDemoApp/android/app/src/main/java/com/codepushdemoapp/MainApplication.java @@ -30,7 +30,7 @@ public class MainApplication extends Application implements ReactApplication { protected List getPackages() { return Arrays.asList( new MainReactPackage(), - new CodePush("deployment-key-here", getApplicationContext(), BuildConfig.DEBUG) + new CodePush(getResources().getString(R.string.reactNativeCodePush_androidDeploymentKey), getApplicationContext(), BuildConfig.DEBUG) ); } }; diff --git a/Examples/CodePushDemoApp/android/app/src/main/res/values/strings.xml b/Examples/CodePushDemoApp/android/app/src/main/res/values/strings.xml index 921f8cd..8d53fb3 100644 --- a/Examples/CodePushDemoApp/android/app/src/main/res/values/strings.xml +++ b/Examples/CodePushDemoApp/android/app/src/main/res/values/strings.xml @@ -1,4 +1,4 @@ - + deployment-key-here CodePushDemoApp diff --git a/Examples/CodePushDemoApp/demo.js b/Examples/CodePushDemoApp/demo.js index 1a66d1f..7e39d73 100644 --- a/Examples/CodePushDemoApp/demo.js +++ b/Examples/CodePushDemoApp/demo.js @@ -159,4 +159,4 @@ let codePushOptions = { checkFrequency: CodePush.CheckFrequency.MANUAL }; CodePushDemoApp = CodePush(codePushOptions)(CodePushDemoApp); -AppRegistry.registerComponent("CodePushDemoApp", () => CodePushDemoApp); \ No newline at end of file +AppRegistry.registerComponent("CodePushDemoApp", () => CodePushDemoApp); diff --git a/Examples/CodePushDemoApp/demo.jse b/Examples/CodePushDemoApp/demo.jse deleted file mode 100644 index 1a66d1f..0000000 --- a/Examples/CodePushDemoApp/demo.jse +++ /dev/null @@ -1,162 +0,0 @@ -import React, { Component } from "react"; -import { - AppRegistry, - Dimensions, - Image, - StyleSheet, - Text, - TouchableOpacity, - View, -} from "react-native"; - -import CodePush from "react-native-code-push"; - -class CodePushDemoApp extends Component { - constructor() { - super(); - this.state = { restartAllowed: true }; - } - - codePushStatusDidChange(syncStatus) { - switch(syncStatus) { - case CodePush.SyncStatus.CHECKING_FOR_UPDATE: - this.setState({ syncMessage: "Checking for update." }); - break; - case CodePush.SyncStatus.DOWNLOADING_PACKAGE: - this.setState({ syncMessage: "Downloading package." }); - break; - case CodePush.SyncStatus.AWAITING_USER_ACTION: - this.setState({ syncMessage: "Awaiting user action." }); - break; - case CodePush.SyncStatus.INSTALLING_UPDATE: - this.setState({ syncMessage: "Installing update." }); - break; - case CodePush.SyncStatus.UP_TO_DATE: - this.setState({ syncMessage: "App up to date.", progress: false }); - break; - case CodePush.SyncStatus.UPDATE_IGNORED: - this.setState({ syncMessage: "Update cancelled by user.", progress: false }); - break; - case CodePush.SyncStatus.UPDATE_INSTALLED: - this.setState({ syncMessage: "Update installed and will be applied on restart.", progress: false }); - break; - case CodePush.SyncStatus.UNKNOWN_ERROR: - this.setState({ syncMessage: "An unknown error occurred.", progress: false }); - break; - } - } - - codePushDownloadDidProgress(progress) { - this.setState({ progress }); - } - - toggleAllowRestart() { - this.state.restartAllowed - ? CodePush.disallowRestart() - : CodePush.allowRestart(); - - this.setState({ restartAllowed: !this.state.restartAllowed }); - } - - getUpdateMetadata() { - CodePush.getUpdateMetadata(CodePush.UpdateState.RUNNING) - .then((metadata: LocalPackage) => { - this.setState({ syncMessage: metadata ? JSON.stringify(metadata) : "Running binary version", progress: false }); - }, (error: any) => { - this.setState({ syncMessage: "Error: " + error, progress: false }); - }); - } - - /** Update is downloaded silently, and applied on restart (recommended) */ - sync() { - CodePush.sync( - {}, - this.codePushStatusDidChange.bind(this), - this.codePushDownloadDidProgress.bind(this) - ); - } - - /** Update pops a confirmation dialog, and then immediately reboots the app */ - syncImmediate() { - CodePush.sync( - { installMode: CodePush.InstallMode.IMMEDIATE, updateDialog: true }, - this.codePushStatusDidChange.bind(this), - this.codePushDownloadDidProgress.bind(this) - ); - } - - render() { - let progressView; - - if (this.state.progress) { - progressView = ( - {this.state.progress.receivedBytes} of {this.state.progress.totalBytes} bytes received - ); - } - - return ( - - - Welcome to CodePush! - - - Press for background sync - - - Press for dialog-driven sync - - {progressView} - - - Restart { this.state.restartAllowed ? "allowed" : "forbidden"} - - - Press for Update Metadata - - {this.state.syncMessage || ""} - - ); - } -} - -const styles = StyleSheet.create({ - container: { - flex: 1, - alignItems: "center", - backgroundColor: "#F5FCFF", - paddingTop: 50 - }, - image: { - margin: 30, - width: Dimensions.get("window").width - 100, - height: 365 * (Dimensions.get("window").width - 100) / 651, - }, - messages: { - marginTop: 30, - textAlign: "center", - }, - restartToggleButton: { - color: "blue", - fontSize: 17 - }, - syncButton: { - color: "green", - fontSize: 17 - }, - welcome: { - fontSize: 20, - textAlign: "center", - margin: 20 - }, -}); - -/** - * Configured with a MANUAL check frequency for easy testing. For production apps, it is recommended to configure a - * different check frequency, such as ON_APP_START, for a 'hands-off' approach where CodePush.sync() does not - * need to be explicitly called. All options of CodePush.sync() are also available in this decorator. - */ -let codePushOptions = { checkFrequency: CodePush.CheckFrequency.MANUAL }; - -CodePushDemoApp = CodePush(codePushOptions)(CodePushDemoApp); - -AppRegistry.registerComponent("CodePushDemoApp", () => CodePushDemoApp); \ No newline at end of file diff --git a/Examples/CodePushDemoApp/iOS/CodePushDemoApp.xcodeproj/project.pbxproj b/Examples/CodePushDemoApp/iOS/CodePushDemoApp.xcodeproj/project.pbxproj index 7dc696b..f5e3cd1 100644 --- a/Examples/CodePushDemoApp/iOS/CodePushDemoApp.xcodeproj/project.pbxproj +++ b/Examples/CodePushDemoApp/iOS/CodePushDemoApp.xcodeproj/project.pbxproj @@ -5,7 +5,6 @@ }; objectVersion = 46; objects = { - /* Begin PBXBuildFile section */ 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; @@ -36,8 +35,8 @@ 2DCD954D1E0B4F2C00145EB5 /* CodePushDemoAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* CodePushDemoAppTests.m */; }; 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; - D28EB2FC32954427A4422B25 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = CC9DF758D6864DCAA11289C9 /* libz.tbd */; }; - EA397BA422464BCC859F3D42 /* libCodePush.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BD09103A2D2E47629DB319C2 /* libCodePush.a */; }; + AB864E6BF35941E790272F04 /* libCodePush.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5AF76915BB4C0398E0C977 /* libCodePush.a */; }; + 98A25BEBDB1E4B5FAF46F12A /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D6DEDCA1554F47D39983C1C8 /* libz.tbd */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -230,13 +229,6 @@ remoteGlobalIDString = 58B5119B1A9E6C1200147676; remoteInfo = RCTText; }; - C38CCDB11E97B5770004B299 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D107D63A8C0145D7806614BF /* CodePush.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 134814201AA4EA6300B7C361; - remoteInfo = CodePush; - }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -264,9 +256,9 @@ 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; }; 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; - BD09103A2D2E47629DB319C2 /* libCodePush.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libCodePush.a; sourceTree = ""; }; - CC9DF758D6864DCAA11289C9 /* libz.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; - D107D63A8C0145D7806614BF /* CodePush.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = CodePush.xcodeproj; path = "../node_modules/react-native-code-push/ios/CodePush.xcodeproj"; sourceTree = ""; }; + 8E077457544D4B4F914AAB17 /* CodePush.xcodeproj */ = {isa = PBXFileReference; name = "CodePush.xcodeproj"; path = "../node_modules/react-native-code-push/ios/CodePush.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; + 0C5AF76915BB4C0398E0C977 /* libCodePush.a */ = {isa = PBXFileReference; name = "libCodePush.a"; path = "libCodePush.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; + D6DEDCA1554F47D39983C1C8 /* libz.tbd */ = {isa = PBXFileReference; name = "libz.tbd"; path = "usr/lib/libz.tbd"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = sourcecode.text-based-dylib-definition; explicitFileType = undefined; includeInIndex = 0; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -293,8 +285,8 @@ 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, - EA397BA422464BCC859F3D42 /* libCodePush.a in Frameworks */, - D28EB2FC32954427A4422B25 /* libz.tbd in Frameworks */, + AB864E6BF35941E790272F04 /* libCodePush.a in Frameworks */, + 98A25BEBDB1E4B5FAF46F12A /* libz.tbd in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -382,14 +374,6 @@ name = "Supporting Files"; sourceTree = ""; }; - 08BF36A1FE0A4A28A3889572 /* Frameworks */ = { - isa = PBXGroup; - children = ( - CC9DF758D6864DCAA11289C9 /* libz.tbd */, - ); - name = Frameworks; - sourceTree = ""; - }; 139105B71AF99BAD00B5F7CC /* Products */ = { isa = PBXGroup; children = ( @@ -469,7 +453,7 @@ 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, - D107D63A8C0145D7806614BF /* CodePush.xcodeproj */, + 8E077457544D4B4F914AAB17 /* CodePush.xcodeproj */, ); name = Libraries; sourceTree = ""; @@ -490,7 +474,7 @@ 832341AE1AAA6A7D00B99B32 /* Libraries */, 00E356EF1AD99517003FC87E /* CodePushDemoAppTests */, 83CBBA001A601CBA00E9B192 /* Products */, - 08BF36A1FE0A4A28A3889572 /* Frameworks */, + A9CA20E9184A41829D5427DA /* Frameworks */, ); indentWidth = 2; sourceTree = ""; @@ -507,13 +491,14 @@ name = Products; sourceTree = ""; }; - C38CCDAE1E97B5770004B299 /* Products */ = { - isa = PBXGroup; + A9CA20E9184A41829D5427DA /* Frameworks */ = { + isa = "PBXGroup"; children = ( - C38CCDB21E97B5770004B299 /* libCodePush.a */, + D6DEDCA1554F47D39983C1C8 /* libz.tbd */, ); - name = Products; + name = Frameworks; sourceTree = ""; + path = ""; }; /* End PBXGroup section */ @@ -626,10 +611,6 @@ productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; projectDirPath = ""; projectReferences = ( - { - ProductGroup = C38CCDAE1E97B5770004B299 /* Products */; - ProjectRef = D107D63A8C0145D7806614BF /* CodePush.xcodeproj */; - }, { ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; @@ -861,13 +842,6 @@ remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - C38CCDB21E97B5770004B299 /* libCodePush.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libCodePush.a; - remoteRef = C38CCDB11E97B5770004B299 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -917,7 +891,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; + shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; }; 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = { isa = PBXShellScriptBuildPhase; @@ -931,7 +905,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; + shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; }; /* End PBXShellScriptBuildPhase section */ @@ -1006,23 +980,23 @@ "DEBUG=1", "$(inherited)", ); - HEADER_SEARCH_PATHS = ( - "$(inherited)", - "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", - ); INFOPLIST_FILE = CodePushDemoAppTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - ); OTHER_LDFLAGS = ( "-ObjC", "-lc++", ); PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CodePushDemoApp.app/CodePushDemoApp"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", + ); }; name = Debug; }; @@ -1031,23 +1005,23 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COPY_PHASE_STRIP = NO; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", - ); INFOPLIST_FILE = CodePushDemoAppTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - ); OTHER_LDFLAGS = ( "-ObjC", "-lc++", ); PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CodePushDemoApp.app/CodePushDemoApp"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", + ); }; name = Release; }; @@ -1057,10 +1031,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CURRENT_PROJECT_VERSION = 1; DEAD_CODE_STRIPPING = NO; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", - ); INFOPLIST_FILE = CodePushDemoApp/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_LDFLAGS = ( @@ -1070,6 +1040,10 @@ ); PRODUCT_NAME = CodePushDemoApp; VERSIONING_SYSTEM = "apple-generic"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", + ); }; name = Debug; }; @@ -1078,10 +1052,6 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CURRENT_PROJECT_VERSION = 1; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", - ); INFOPLIST_FILE = CodePushDemoApp/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_LDFLAGS = ( @@ -1091,6 +1061,10 @@ ); PRODUCT_NAME = CodePushDemoApp; VERSIONING_SYSTEM = "apple-generic"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", + ); }; name = Release; }; @@ -1106,16 +1080,8 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_TESTABILITY = YES; GCC_NO_COMMON_BLOCKS = YES; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", - ); INFOPLIST_FILE = "CodePushDemoApp-tvOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - ); OTHER_LDFLAGS = ( "-ObjC", "-lc++", @@ -1125,6 +1091,14 @@ SDKROOT = appletvos; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.2; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", + ); }; name = Debug; }; @@ -1140,16 +1114,8 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_NO_COMMON_BLOCKS = YES; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", - ); INFOPLIST_FILE = "CodePushDemoApp-tvOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - ); OTHER_LDFLAGS = ( "-ObjC", "-lc++", @@ -1159,6 +1125,14 @@ SDKROOT = appletvos; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.2; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**", + ); }; name = Release; }; @@ -1175,15 +1149,15 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "CodePushDemoApp-tvOSTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - ); PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.CodePushDemoApp-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CodePushDemoApp-tvOS.app/CodePushDemoApp-tvOS"; TVOS_DEPLOYMENT_TARGET = 10.1; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); }; name = Debug; }; @@ -1200,15 +1174,15 @@ GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "CodePushDemoApp-tvOSTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - ); PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.CodePushDemoApp-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CodePushDemoApp-tvOS.app/CodePushDemoApp-tvOS"; TVOS_DEPLOYMENT_TARGET = 10.1; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); }; name = Release; }; diff --git a/Examples/CodePushDemoApp/iOS/CodePushDemoApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Examples/CodePushDemoApp/iOS/CodePushDemoApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/Examples/CodePushDemoApp/iOS/CodePushDemoApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Examples/CodePushDemoApp/iOS/CodePushDemoApp/AppDelegate.m b/Examples/CodePushDemoApp/iOS/CodePushDemoApp/AppDelegate.m index 9ef3f08..df3b903 100644 --- a/Examples/CodePushDemoApp/iOS/CodePushDemoApp/AppDelegate.m +++ b/Examples/CodePushDemoApp/iOS/CodePushDemoApp/AppDelegate.m @@ -21,9 +21,9 @@ #ifdef DEBUG - jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; + jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; #else - jsCodeLocation = [CodePush bundleURL]; + jsCodeLocation = [CodePush bundleURL]; #endif RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation diff --git a/Examples/CodePushDemoApp/iOS/CodePushDemoApp/Info.plist b/Examples/CodePushDemoApp/iOS/CodePushDemoApp/Info.plist index 29dab54..a99ec84 100644 --- a/Examples/CodePushDemoApp/iOS/CodePushDemoApp/Info.plist +++ b/Examples/CodePushDemoApp/iOS/CodePushDemoApp/Info.plist @@ -54,4 +54,4 @@ CodePushDeploymentKey deployment-key-here - + \ No newline at end of file diff --git a/Examples/CodePushDemoApp/iOS/CodePushDemoAppTests/CodePushDemoAppTests.m b/Examples/CodePushDemoApp/iOS/CodePushDemoAppTests/CodePushDemoAppTests.m index 5dc746f..72bad37 100644 --- a/Examples/CodePushDemoApp/iOS/CodePushDemoAppTests/CodePushDemoAppTests.m +++ b/Examples/CodePushDemoApp/iOS/CodePushDemoAppTests/CodePushDemoAppTests.m @@ -12,7 +12,6 @@ #import #import -#import #define TIMEOUT_SECONDS 600 #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" diff --git a/Examples/CodePushDemoApp/index.android.js b/Examples/CodePushDemoApp/index.android.js index 8f8f835..f481fa4 100644 --- a/Examples/CodePushDemoApp/index.android.js +++ b/Examples/CodePushDemoApp/index.android.js @@ -1 +1 @@ -require("./demo"); \ No newline at end of file +require("./demo"); diff --git a/Examples/CodePushDemoApp/index.ios.js b/Examples/CodePushDemoApp/index.ios.js index 8f8f835..f481fa4 100644 --- a/Examples/CodePushDemoApp/index.ios.js +++ b/Examples/CodePushDemoApp/index.ios.js @@ -1 +1 @@ -require("./demo"); \ No newline at end of file +require("./demo"); diff --git a/Examples/CodePushDemoApp/package.json b/Examples/CodePushDemoApp/package.json index 2169b70..4c5f96d 100644 --- a/Examples/CodePushDemoApp/package.json +++ b/Examples/CodePushDemoApp/package.json @@ -1,24 +1,24 @@ { - "name": "CodePushDemoApp", - "version": "0.0.1", - "private": true, - "scripts": { - "start": "react-native start", - "test": "jest" - }, - "dependencies": { - "react": "16.0.0-alpha.6", - "react-native": "^0.43.2", - "react-native-code-push": "file:../../", - "react-native-windows": "^0.43.0-rc.0" - }, - "devDependencies": { - "babel-jest": "19.0.0", - "babel-preset-react-native": "1.9.1", - "jest": "19.0.2", - "react-test-renderer": "16.0.0-alpha.6" - }, - "jest": { - "preset": "react-native" - } + "name": "CodePushDemoApp", + "version": "0.0.1", + "private": true, + "scripts": { + "start": "react-native start", + "test": "jest" + }, + "dependencies": { + "react": "16.0.0-alpha.12", + "react-native": "^0.47.1", + "react-native-code-push": "file:../../", + "react-native-windows": "^0.43.0-rc.0" + }, + "devDependencies": { + "babel-jest": "20.0.3", + "babel-preset-react-native": "2.1.0", + "jest": "20.0.4", + "react-test-renderer": "16.0.0-alpha.12" + }, + "jest": { + "preset": "react-native" + } }