From bccac53a45db9bac13839909f16a5fa93642ac1d Mon Sep 17 00:00:00 2001 From: Jeffrey Beauchamp Date: Wed, 8 May 2019 16:39:34 -0700 Subject: [PATCH] Revert D15240810: [react-native][PR] Fix RNTester on iOS Differential Revision: D15240810 Original commit changeset: 76f498222b6a fbshipit-source-id: c6bb1bb0738609b36faccbee93a32e76d17cde87 --- RNTester/RCTTest/RCTTestRunner.m | 5 ++++- RNTester/RNTester.xcodeproj/project.pbxproj | 7 ------- .../xcshareddata/xcschemes/RNTester.xcscheme | 4 ++-- RNTester/RNTester/AppDelegate.mm | 5 ++++- RNTester/RNTester/Info.plist | 2 -- RNTester/RNTesterIntegrationTests/RCTLoggingTests.m | 5 ++++- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/RNTester/RCTTest/RCTTestRunner.m b/RNTester/RCTTest/RCTTestRunner.m index bf2228c0ae2..3e530a5e102 100644 --- a/RNTester/RCTTest/RCTTestRunner.m +++ b/RNTester/RCTTest/RCTTestRunner.m @@ -87,7 +87,10 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init) - (NSURL *)defaultScriptURL { if (getenv("CI_USE_PACKAGER") || _useBundler) { - NSString *bundlePrefix = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"RN_BUNDLE_PREFIX"]; + NSString *bundlePrefix = @""; + if (getenv("CI_USE_BUNDLE_PREFIX")) { + bundlePrefix = @"react-native-github/"; + } return [NSURL URLWithString:[NSString stringWithFormat:@"http://localhost:8081/%@%@.bundle?platform=ios&dev=true", bundlePrefix, _appPath]]; } else { return [[NSBundle bundleForClass:[RCTBridge class]] URLForResource:@"main" withExtension:@"jsbundle"]; diff --git a/RNTester/RNTester.xcodeproj/project.pbxproj b/RNTester/RNTester.xcodeproj/project.pbxproj index e2288089cd2..f25ba253c6c 100644 --- a/RNTester/RNTester.xcodeproj/project.pbxproj +++ b/RNTester/RNTester.xcodeproj/project.pbxproj @@ -1913,11 +1913,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; BUNDLE_CONFIG = "$(SRCROOT)/../metro.config.js"; DEVELOPMENT_TEAM = VYK7DLU38Z; - GCC_PREPROCESSOR_DEFINITIONS = ( - "RN_BUNDLE_PREFIX=$(RN_BUNDLE_PREFIX)", - "DEBUG=1", - "$(inherited)", - ); HEADER_SEARCH_PATHS = ( "$(SRCROOT)/../third-party/boost_1_63_0", "$(SRCROOT)/../third-party/folly-2018.10.22.00", @@ -1929,7 +1924,6 @@ LIBRARY_SEARCH_PATHS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.react.uiapp; PRODUCT_NAME = RNTester; - RN_BUNDLE_PREFIX = ""; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -1940,7 +1934,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; BUNDLE_CONFIG = "$(SRCROOT)/../metro.config.js"; DEVELOPMENT_TEAM = VYK7DLU38Z; - GCC_PREPROCESSOR_DEFINITIONS = "RN_BUNDLE_PREFIX=$(RN_BUNDLE_PREFIX)"; HEADER_SEARCH_PATHS = ( "$(SRCROOT)/../third-party/boost_1_63_0", "$(SRCROOT)/../third-party/folly-2018.10.22.00", diff --git a/RNTester/RNTester.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme b/RNTester/RNTester.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme index ff2e9c27c1c..4f65fc29891 100644 --- a/RNTester/RNTester.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme +++ b/RNTester/RNTester.xcodeproj/xcshareddata/xcschemes/RNTester.xcscheme @@ -144,8 +144,8 @@ isEnabled = "YES"> diff --git a/RNTester/RNTester/AppDelegate.mm b/RNTester/RNTester/AppDelegate.mm index 17f089a43cb..4e11db00845 100644 --- a/RNTester/RNTester/AppDelegate.mm +++ b/RNTester/RNTester/AppDelegate.mm @@ -109,7 +109,10 @@ - (NSURL *)sourceURLForBridge:(__unused RCTBridge *)bridge { - NSString *bundlePrefix = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"RN_BUNDLE_PREFIX"]; + NSString *bundlePrefix = @""; + if (getenv("CI_USE_BUNDLE_PREFIX")) { + bundlePrefix = @"react-native-github/"; + } NSString *bundleRoot = [NSString stringWithFormat:@"%@RNTester/js/RNTesterApp.ios", bundlePrefix]; return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:bundleRoot fallbackResource:nil]; diff --git a/RNTester/RNTester/Info.plist b/RNTester/RNTester/Info.plist index 3b0806d0b90..13573d49b86 100644 --- a/RNTester/RNTester/Info.plist +++ b/RNTester/RNTester/Info.plist @@ -60,7 +60,5 @@ NSPhotoLibraryUsageDescription You need to add NSPhotoLibraryUsageDescription key in Info.plist to enable photo library usage, otherwise it is going to *fail silently*! - RN_BUNDLE_PREFIX - $(RN_BUNDLE_PREFIX) diff --git a/RNTester/RNTesterIntegrationTests/RCTLoggingTests.m b/RNTester/RNTesterIntegrationTests/RCTLoggingTests.m index e1ed8b0b80f..8cc22ef0e0e 100644 --- a/RNTester/RNTesterIntegrationTests/RCTLoggingTests.m +++ b/RNTester/RNTesterIntegrationTests/RCTLoggingTests.m @@ -30,7 +30,10 @@ { NSURL *scriptURL; if (getenv("CI_USE_PACKAGER")) { - NSString *bundlePrefix = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"RN_BUNDLE_PREFIX"]; + NSString *bundlePrefix = @""; + if (getenv("CI_USE_BUNDLE_PREFIX")) { + bundlePrefix = @"react-native-github/"; + } NSString *app = @"IntegrationTests/IntegrationTestsApp"; scriptURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://localhost:8081/%@%@.bundle?platform=ios&dev=true", bundlePrefix, app]]; } else {