Revert D15240810: [react-native][PR] Fix RNTester on iOS

Differential Revision:
D15240810

Original commit changeset: 76f498222b6a

fbshipit-source-id: c6bb1bb0738609b36faccbee93a32e76d17cde87
This commit is contained in:
Jeffrey Beauchamp
2019-05-08 16:39:34 -07:00
committed by Facebook Github Bot
parent 58328558c6
commit bccac53a45
6 changed files with 14 additions and 14 deletions

View File

@@ -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"];

View File

@@ -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",

View File

@@ -144,8 +144,8 @@
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "RN_BUNDLE_PREFIX"
value = ""
key = "CI_USE_BUNDLE_PREFIX"
value = "0"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>

View File

@@ -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];

View File

@@ -60,7 +60,5 @@
<false/>
<key>NSPhotoLibraryUsageDescription</key>
<string>You need to add NSPhotoLibraryUsageDescription key in Info.plist to enable photo library usage, otherwise it is going to *fail silently*!</string>
<key>RN_BUNDLE_PREFIX</key>
<string>$(RN_BUNDLE_PREFIX)</string>
</dict>
</plist>

View File

@@ -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 {