Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions ReactAndroid/Android-prebuilt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,3 @@ LOCAL_SRC_FILES := $(REACT_NDK_EXPORT_DIR)/$(TARGET_ARCH_ABI)/libruntimeexecutor
LOCAL_C_INCLUDES := $(REACT_COMMON_DIR)/runtimeexecutor
LOCAL_EXPORT_C_INCLUDES := $(REACT_COMMON_DIR)/runtimeexecutor
include $(PREBUILT_SHARED_LIBRARY)

# fbjni
include $(FIRST_PARTY_NDK_DIR)/fbjni/Android.mk
27 changes: 7 additions & 20 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -255,20 +255,6 @@ tasks.register("packageReactNdkReleaseLibsForBuck", Copy) {
into("src/main/jni/prebuilt/lib")
}

final def extractNativeDependencies = tasks.register('extractNativeDependencies', ExtractJniAndHeadersTask) {
it.extractHeadersConfiguration.setFrom(configurations.extractHeaders)
it.extractJniConfiguration.setFrom(configurations.extractJNI)
it.baseOutputDir = project.file("src/main/jni/first-party/")
// Sadly this task as an output folder path that is directly dependent on
// the task input (i.e. src/main/jni/first-party/<package-name>/...
// This means that this task is using the parent folder (first-party/) as
// @OutputFolder. The `prepareHermes` task will also output inside that
// folder and if the two tasks happen to be inside the same run, we want
// `extractNativeDependencies` to run after `prepareHermes` to do not
// invalidate the input/output calculation for this task.
it.mustRunAfter(prepareHermes)
}

task installArchives {
dependsOn("publishReleasePublicationToNpmRepository")
}
Expand Down Expand Up @@ -314,6 +300,7 @@ android {
"REACT_COMMON_DIR=$projectDir/../ReactCommon",
"REACT_GENERATED_SRC_DIR=$buildDir/generated/source",
"REACT_SRC_DIR=$projectDir/src/main/java/com/facebook/react",
"APP_STL=c++_shared",
"-j${ndkBuildJobs()}"

if (Os.isFamily(Os.FAMILY_MAC)) {
Expand All @@ -333,7 +320,7 @@ android {
}
}

preBuild.dependsOn(prepareJSC, prepareHermes, prepareBoost, prepareDoubleConversion, prepareFmt, prepareFolly, prepareGlog, prepareLibevent, extractNativeDependencies)
preBuild.dependsOn(prepareJSC, prepareHermes, prepareBoost, prepareDoubleConversion, prepareFmt, prepareFolly, prepareGlog, prepareLibevent)
preBuild.dependsOn("generateCodegenArtifactsFromSchema")

sourceSets.main {
Expand Down Expand Up @@ -362,10 +349,12 @@ android {
}

configurations {
extractHeaders
extractJNI
javadocDeps.extendsFrom api
}

buildFeatures {
prefab true
}
}

dependencies {
Expand All @@ -384,9 +373,7 @@ dependencies {
api("com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}")
api("com.squareup.okhttp3:okhttp-urlconnection:${OKHTTP_VERSION}")
api("com.squareup.okio:okio:2.9.0")
api("com.facebook.fbjni:fbjni-java-only:0.2.2")
extractHeaders("com.facebook.fbjni:fbjni:0.2.2:headers")
extractJNI("com.facebook.fbjni:fbjni:0.2.2")
api("com.facebook.fbjni:fbjni:0.2.2")

javadocDeps("com.squareup:javapoet:1.13.0")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ include $(BUILD_SHARED_LIBRARY)
$(call import-module,fbgloginit)
$(call import-module,folly)
$(call import-module,fb)
$(call import-module,fbjni)
$(call import-module,yogajni)
$(call import-module,glog)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ include $(BUILD_SHARED_LIBRARY)
$(call import-module,fbgloginit)
$(call import-module,folly)
$(call import-module,fb)
$(call import-module,fbjni)
$(call import-module,yogajni)
$(call import-module,glog)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ include $(BUILD_SHARED_LIBRARY)
$(call import-module,fbgloginit)
$(call import-module,folly)
$(call import-module,fb)
$(call import-module,fbjni)
$(call import-module,yogajni)
$(call import-module,glog)

Expand Down
2 changes: 0 additions & 2 deletions ReactAndroid/src/main/jni/first-party/fbjni/.gitignore

This file was deleted.

14 changes: 0 additions & 14 deletions ReactAndroid/src/main/jni/first-party/fbjni/Android.mk

This file was deleted.

1 change: 0 additions & 1 deletion ReactAndroid/src/main/jni/first-party/yogajni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ include $(BUILD_SHARED_LIBRARY)

$(call import-module,yoga)
$(call import-module,fb)
$(call import-module,fbjni)
8 changes: 7 additions & 1 deletion ReactAndroid/src/main/jni/react/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ endif
# Build the files in this directory as a shared library
include $(BUILD_SHARED_LIBRARY)

# This block is needed only because we build the project on NDK r17 internally.
ifneq ($(call ndk-major-at-least,21),true)
$(call import-add-path,$(NDK_GRADLE_INJECTED_IMPORT_PATH))
endif

$(call import-module,prefab/fbjni)

# Compile the c++ dependencies required for ReactAndroid
#
# How does the import-module function work?
Expand All @@ -133,7 +140,6 @@ include $(BUILD_SHARED_LIBRARY)
$(call import-module,butter)
$(call import-module,folly)
$(call import-module,fb)
$(call import-module,fbjni)
$(call import-module,jsc)
$(call import-module,fbgloginit)
$(call import-module,yogajni)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ LOCAL_SHARED_LIBRARIES := \

include $(BUILD_STATIC_LIBRARY)

$(call import-module,fbjni)
$(call import-module,folly)
$(call import-module,fbgloginit)
$(call import-module,glog)
Expand Down
1 change: 0 additions & 1 deletion ReactCommon/react/renderer/components/slider/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ LOCAL_SHARED_LIBRARIES := \

include $(BUILD_STATIC_LIBRARY)

$(call import-module,fbjni)
$(call import-module,folly)
$(call import-module,fbgloginit)
$(call import-module,glog)
Expand Down
1 change: 0 additions & 1 deletion ReactCommon/react/renderer/components/switch/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ LOCAL_SHARED_LIBRARIES := \

include $(BUILD_STATIC_LIBRARY)

$(call import-module,fbjni)
$(call import-module,folly)
$(call import-module,fbgloginit)
$(call import-module,glog)
Expand Down
1 change: 0 additions & 1 deletion ReactCommon/react/renderer/graphics/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall
include $(BUILD_SHARED_LIBRARY)

$(call import-module,glog)
$(call import-module,fbjni)
$(call import-module,fb)
$(call import-module,folly)
$(call import-module,react/debug)
1 change: 0 additions & 1 deletion ReactCommon/react/renderer/textlayoutmanager/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall
include $(BUILD_SHARED_LIBRARY)

$(call import-module,glog)
$(call import-module,fbjni)
$(call import-module,fb)
$(call import-module,folly)
$(call import-module,react/renderer/componentregistry)
Expand Down

This file was deleted.

This file was deleted.

4 changes: 4 additions & 0 deletions packages/rn-tester/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ android {
pickFirst '**/libhermes.so'
pickFirst '**/libjsc.so'
}

buildFeatures {
prefab true
}
}

configurations {
Expand Down
7 changes: 7 additions & 0 deletions packages/rn-tester/android/app/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,10 @@ LOCAL_CFLAGS := \
-DLOG_TAG=\"ReactNative\"
LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall
include $(BUILD_SHARED_LIBRARY)

# This block is needed only because we build the project on NDK r17 internally.
ifneq ($(call ndk-major-at-least,21),true)
$(call import-add-path,$(NDK_GRADLE_INJECTED_IMPORT_PATH))
endif

$(call import-module,prefab/fbjni)
4 changes: 4 additions & 0 deletions template/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ android {
}
}

buildFeatures {
prefab true
}

// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
Expand Down
9 changes: 8 additions & 1 deletion template/android/app/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)

# If you wish to add a custom TurboModule or Fabric component in your app you
# will have to uncomment those lines to include the generated source
# will have to uncomment those lines to include the generated source
# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)
#
# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni
Expand Down Expand Up @@ -46,4 +46,11 @@ LOCAL_SHARED_LIBRARIES := \

LOCAL_CFLAGS := -DLOG_TAG=\"ReactNative\" -fexceptions -frtti -std=c++17 -Wall

# This block is needed only if you're building on NDK < r21 internally.
ifneq ($(call ndk-major-at-least,21),true)
$(call import-add-path,$(NDK_GRADLE_INJECTED_IMPORT_PATH))
endif

$(call import-module,prefab/fbjni)

include $(BUILD_SHARED_LIBRARY)