Skip to content

Commit 193ab4c

Browse files
committed
chore: update example using fabric arch
1 parent 8f2e117 commit 193ab4c

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

example/android/app/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ android {
152152
"GENERATED_SRC_DIR=$buildDir/generated/source",
153153
"PROJECT_BUILD_DIR=$buildDir",
154154
"REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
155-
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build"
155+
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
156+
"NODE_MODULES_DIR=$rootDir/../node_modules/"
156157
cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
157158
cppFlags "-std=c++17"
158159
// Make sure this target name is the same you specify inside the

example/android/app/src/main/jni/Android.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ include $(REACT_ANDROID_DIR)/Android-prebuilt.mk
55
# If you wish to add a custom TurboModule or Fabric component in your app you
66
# will have to include the following autogenerated makefile.
77
# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk
8+
9+
# Includes the MK file for `react-native-fast-shadow`
10+
include $(NODE_MODULES_DIR)/../../android/build/generated/source/codegen/jni/Android.mk
11+
812
include $(CLEAR_VARS)
913

1014
LOCAL_PATH := $(THIS_DIR)
@@ -33,6 +37,7 @@ LOCAL_SHARED_LIBRARIES := \
3337
libglog \
3438
libjsi \
3539
libreact_codegen_rncore \
40+
libreact_codegen_FastShadowView \
3641
libreact_debug \
3742
libreact_nativemodule_core \
3843
libreact_render_componentregistry \

example/android/app/src/main/jni/MainComponentsRegistry.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <fbjni/fbjni.h>
55
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
66
#include <react/renderer/components/rncore/ComponentDescriptors.h>
7+
#include <react/renderer/components/FastShadowView/ComponentDescriptors.h>
78

89
namespace facebook {
910
namespace react {
@@ -19,6 +20,7 @@ MainComponentsRegistry::sharedProviderRegistry() {
1920
//
2021
// providerRegistry->add(concreteComponentDescriptorProvider<
2122
// AocViewerComponentDescriptor>());
23+
providerRegistry->add(concreteComponentDescriptorProvider<FastShadowViewComponentDescriptor>());
2224
return providerRegistry;
2325
}
2426

example/android/gradle.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ android.useAndroidX=true
2424
# Automatically convert third-party libraries to use AndroidX
2525
android.enableJetifier=true
2626

27+
org.gradle.parallel=true
28+
org.gradle.caching=true
29+
2730
# Version of flipper SDK to use with React Native
2831
FLIPPER_VERSION=0.125.0
2932

@@ -37,4 +40,4 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
3740
# your application. You should enable this flag either if you want
3841
# to write custom TurboModules/Fabric components OR use libraries that
3942
# are providing them.
40-
newArchEnabled=false
43+
newArchEnabled=true

0 commit comments

Comments
 (0)