Using shared bridge path for RN

Reviewed By: javache

Differential Revision: D5002111

fbshipit-source-id: 86c2856145a6595823fd027145b050a6fba3d90d
This commit is contained in:
Kathy Gray 2017-07-07 05:20:43 -07:00 committed by Facebook Github Bot
parent a8a29a92a0
commit 6796abbe55
2 changed files with 19 additions and 9 deletions

View File

@ -224,7 +224,8 @@ public class ReactInstanceManager {
boolean setupReactContextInBackgroundEnabled,
boolean useSeparateUIBackgroundThread,
int minNumShakes,
boolean splitPackagesEnabled) {
boolean splitPackagesEnabled,
boolean useOnlyDefaultPackages) {
Log.d(ReactConstants.TAG, "ReactInstanceManager.ctor()");
initializeSoLoaderIfNecessary(applicationContext);
@ -267,14 +268,16 @@ public class ReactInstanceManager {
mPackages.add(coreModulesPackage);
} else {
mPackages.add(new BridgeCorePackage(this, mBackBtnHandler));
if (mUseDeveloperSupport) {
mPackages.add(new DebugCorePackage());
if (!useOnlyDefaultPackages) {
if (mUseDeveloperSupport) {
mPackages.add(new DebugCorePackage());
}
mPackages.add(
new ReactNativeCorePackage(
this,
mUIImplementationProvider,
mLazyViewManagersEnabled));
}
mPackages.add(
new ReactNativeCorePackage(
this,
mUIImplementationProvider,
mLazyViewManagersEnabled));
}
mPackages.addAll(packages);

View File

@ -48,6 +48,7 @@ public class ReactInstanceManagerBuilder {
protected boolean mUseSeparateUIBackgroundThread;
protected int mMinNumShakes = 1;
protected boolean mEnableSplitPackage;
protected boolean mUseOnlyDefaultPackages;
/* package protected */ ReactInstanceManagerBuilder() {
}
@ -219,6 +220,11 @@ public class ReactInstanceManagerBuilder {
return this;
}
public ReactInstanceManagerBuilder setUseOnlyDefaultPackages(boolean useOnlyDefaultPackages) {
mUseOnlyDefaultPackages = useOnlyDefaultPackages;
return this;
}
/**
* Instantiates a new {@link ReactInstanceManager}.
* Before calling {@code build}, the following must be called:
@ -269,6 +275,7 @@ public class ReactInstanceManagerBuilder {
mSetupReactContextInBackground,
mUseSeparateUIBackgroundThread,
mMinNumShakes,
mEnableSplitPackage);
mEnableSplitPackage,
mUseOnlyDefaultPackages);
}
}